Facing an issue while using community for BGP


#1

My vyos vm1 is having IP 23.0.0.50 which is connected to two other vyos vms(23.0.0.74, 23.0.0.227) via ebgp. vm1 is having static routes for sunets 17.0.0.0/24, 18.0.0.0/24, 19.0.0.0/24. I want to distribute 17.0.0.0/24 and 18.0.0.0/24 to vyos vm 23.0.0.74 and want distribute 17.0.0.0/24 and 19.0.0.0/24 to vyos vm 23.0.0.227. That is working for 23.0.0.74 but there is no route distributed to vm 23.0.0.227. Following is my bgp config on vm1 peer vms are not having any extra filtering.

set policy community-list 100 rule 1 action ‘deny’
set policy community-list 100 rule 1 regex ‘^1:101$’

set policy community-list 100 rule 2 action ‘deny’
set policy community-list 100 rule 2 regex ‘^1:201$’

set policy community-list 100 rule 3 action ‘deny’
set policy community-list 100 rule 3 regex ‘^1:200$’

allow other routes having any community

set policy community-list 100 rule 4 action ‘permit’
set policy community-list 100 rule 4 regex ‘.*’

set policy community-list 200 rule 1 action ‘deny’
set policy community-list 200 rule 1 regex ‘^1:201$’

set policy community-list 200 rule 2 action ‘deny’
set policy community-list 200 rule 2 regex ‘^1:101$’

set policy community-list 200 rule 3 action ‘deny’
set policy community-list 200 rule 3 regex ‘^1:100$’

allow other routes having any community

set policy community-list 200 rule 4 action ‘permit’
set policy community-list 200 rule 4 regex ‘.*’

set policy prefix-list allow-routes rule 1 action ‘permit’
set policy prefix-list allow-routes rule 1 prefix ‘17.0.0.0/24’
set policy prefix-list allow-routes rule 2 action ‘permit’
set policy prefix-list allow-routes rule 2 prefix ‘18.0.0.0/24’
set policy prefix-list deny-routes rule 1 action ‘permit’
set policy prefix-list deny-routes rule 1 prefix ‘19.0.0.0/24’
set policy prefix-list deny-routes rule 2 action ‘permit’
set policy prefix-list deny-routes rule 2 prefix ‘0.0.0.0/0’

set policy prefix-list allow-routes-2 rule 1 action ‘permit’
set policy prefix-list allow-routes-2 rule 1 prefix ‘17.0.0.0/24’
set policy prefix-list allow-routes-2 rule 2 action ‘permit’
set policy prefix-list allow-routes-2 rule 2 prefix ‘19.0.0.0/24’
set policy prefix-list deny-routes-2 rule 1 action ‘permit’
set policy prefix-list deny-routes-2 rule 1 prefix ‘18.0.0.0/24’
set policy prefix-list deny-routes-2 rule 2 action ‘permit’
set policy prefix-list deny-routes-2 rule 2 prefix ‘0.0.0.0/0’

set policy route-map STATIC-2-BGP rule 10 action ‘permit’
set policy route-map STATIC-2-BGP rule 10 match ip address prefix-list ‘allow-routes’
set policy route-map STATIC-2-BGP rule 10 set community ‘1:100’
set policy route-map STATIC-2-BGP rule 20 action ‘permit’
set policy route-map STATIC-2-BGP rule 20 match ip address prefix-list ‘deny-routes’
set policy route-map STATIC-2-BGP rule 20 set community ‘1:101’
set policy route-map STATIC-2-BGP rule 30 action ‘permit’
set policy route-map STATIC-2-BGP rule 30 match ip address prefix-list ‘allow-routes-2’
set policy route-map STATIC-2-BGP rule 30 set community ‘1:200’
set policy route-map STATIC-2-BGP rule 40 action ‘permit’
set policy route-map STATIC-2-BGP rule 40 match ip address prefix-list ‘deny-routes-2’
set policy route-map STATIC-2-BGP rule 40 set community ‘1:201’

set policy route-map BGP-OUT rule 100 action ‘permit’
set policy route-map BGP-OUT rule 100 match community community-list ‘100’
set policy route-map BGP-OUT-2 rule 100 action ‘permit’
set policy route-map BGP-OUT-2 rule 100 match community community-list ‘200’

set protocols bgp 100 neighbor 23.0.0.74 remote-as ‘200’
set protocols bgp 100 neighbor 23.0.0.227 remote-as ‘300’
set protocols bgp 100 parameters router-id ‘23.0.0.50’
set protocols bgp 100 redistribute static route-map ‘STATIC-2-BGP’
set protocols bgp 100 neighbor 23.0.0.74 route-map export ‘BGP-OUT’
set protocols bgp 100 neighbor 23.0.0.227 route-map export ‘BGP-OUT-2’

++++++++++++++