cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3160
Views
0
Helpful
4
Replies

Prefix-list matching to set community

Cody Lo
Level 1
Level 1

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

1 Accepted Solution

Accepted Solutions

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..

HTH, John *** Please rate all useful posts ***

View solution in original post

4 Replies 4

John Blakley
VIP Alumni
VIP Alumni

Cody,

It should be matching your first sequence in your route-map.

HTH,

John

HTH, John *** Please rate all useful posts ***

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

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..

HTH, John *** Please rate all useful posts ***

Thank you John, having tested with 2 routers today and the result is like what you point out. Thanks.

Review Cisco Networking products for a $25 gift card