08-26-2024 09:46 AM
Hi Dears
I recieve Routes X.X.X.X/24 le 32
/24 by community 650001:100
/32 by community 650001:200
Now i Want remove /24 community and change each subnet /32 Get from Neighbor to 650001:300
How do this by route-maps?
08-26-2024 12:10 PM - edited 08-26-2024 12:14 PM
Hello admin@atrinnet.net ,
standard BGP communities are 32 bit integer in the format ASN:value.
You can use ip community-list to match the community values you are interested in.
ip community-list 1 permit 65001:100
ip community-list 2 permit 65001:200
A route-map can match on community values using ip communty-list(s) and it can set community values to none , to a new value or it can add addtional value with the keyword additive.
route-map SETCOM permit 10
match community 1
set community none
route-map SETCOM permit 20
match community 2
set community 65001:300
route-map SETCOM permit 30
! last clause to allow other prefixes with not changes
The question becomes where you can apply a route-map like this.
You can make a single route-map used in ingress using also prefix-lists as match in addition to match the community values
ip prefix-list BLOCK1 seq 5 permit X.X.X.X/24
ip prefix-list SUBNETS seq 5 permit X.X.X.X/24 ge 25 le 32
You can easily combine match address prefix <name> and match community <com-list-number> in same route-map clause
Hope to help
Giuseppe
08-26-2024 12:11 PM
Hi admin@atrinnet.net ,
You can do something as simple as that.
route-map setCommunity permit 10
match community 1
set community none # remove all communities from the path, including 65001:100
route-map setCommunity permit 20
match community 2
set community 65001:300 # replace 65001:200 by 65001:300
route-map setCommunity permit 30
!
ip community-list 1 permit 65001:100
ip community-list 2 permit 65001:200
Regards,
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