04-24-2012 06:57 AM - edited 03-04-2019 04:08 PM
I would like to know if the following configuration, the announced route "192.168.1.0/24" will have the community "123:200 123:999" or "123:200 123:600", or other combination of community attribute? Thank you!
ip prefix-list routes1 seq 5 permit 192.168.1.0/24
ip prefix-list routes2 seq 5 permit 192.168.1.0/24
ip prefix-list routes2 seq 10 permit 192.168.100.0/24
!
route-map COMMUNITY_TO_R1 permit 10
match ip address prefix-list routes1
set community 123:200 123:999
route-map COMMUNITY_TO_R1 permit 20
match ip address prefix-list routes2
set community 123:200 123:600
!
router bgp 40
no synchronization
bgp router-id 10.1.1.2
bgp log-neighbor-changes
network 192.168.1.0 mask 255.255.255.0
network 192.168.100.0 mask 255.255.255.0
neighbor 10.1.1.1 remote-as 123
neighbor 10.1.1.1 send-community
neighbor 10.1.1.1 route-map COMMUNITY_TO_R1 out
no auto-summary
Solved! Go to Solution.
04-24-2012 09:23 AM
Cody,
That's correct. If you need it to match another one in a later sequence you could use the "continue" clause in the route-map.
ip prefix-list Test permit 192.168.1.0/24
ip prefix-list Test2 permit 192.168.1.0/24
ip prefix-list Test2 permit 192.168.2.0/24
route-map Testing permit 10
match ip address prefix Test
set community 123:999
continue
route-map Testing permit 20
match ip address prefix Test2
set metric 50
The above would set your community to 123:999 and it would set both 192.168.1.0/24 and 192.168.2.0/24 metrics to 50. If you didn't have the continue, it would only set the metric to 50 for the 192.168.2.0/24 subnet.
HTH,
John
Please rate helpful posts..
04-24-2012 07:26 AM
Cody,
It should be matching your first sequence in your route-map.
HTH,
John
04-24-2012 08:00 AM
Ho John,
Thanks for the prompt reply.
Does that mean if a route appear in 2 different prefix list and match in the same route map it will only match and altered at "permit 10" but not "permit 20" ?
Thanks!
Cody
04-24-2012 09:23 AM
Cody,
That's correct. If you need it to match another one in a later sequence you could use the "continue" clause in the route-map.
ip prefix-list Test permit 192.168.1.0/24
ip prefix-list Test2 permit 192.168.1.0/24
ip prefix-list Test2 permit 192.168.2.0/24
route-map Testing permit 10
match ip address prefix Test
set community 123:999
continue
route-map Testing permit 20
match ip address prefix Test2
set metric 50
The above would set your community to 123:999 and it would set both 192.168.1.0/24 and 192.168.2.0/24 metrics to 50. If you didn't have the continue, it would only set the metric to 50 for the 192.168.2.0/24 subnet.
HTH,
John
Please rate helpful posts..
04-25-2012 07:00 AM
Thank you John, having tested with 2 routers today and the result is like what you point out. Thanks.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide