09-19-2017 07:02 AM - edited 03-05-2019 09:09 AM
i asume i have three peer on my Router (AS65100)
peer 1 : AS65200
peer 2 : AS65300
peer 3 : AS65400
how to write a route-map when a bgp routes bring community : 100:65200 , the route will only announce to AS65200, when a bgp route bring community 101:65200 , the route will not announce to AS65200 but will announce to other AS
09-19-2017 10:22 AM
Hello,
the config below should accomplish what you are asking:
ip community-list 1 permit 100:65200
ip community-list 2 permit 101:65200
route-map PEER_1 permit 10
match community 1
route-map PEER_2 permit 10
match community 2
route-map PEER_3 permit 10
match community 2
neighbor 192.168.1.2 remote-as 65200
neighbor 192.168.1.2 route-map PEER_1 out
neighbor 192.168.2.2 remote-as 65300
neighbor 192.168.2.2 route-map PEER_2 out
neighbor 192.168.3.2 remote-as 65400
neighbor 192.168.3.2 route-map PEER_3 out
09-19-2017 06:53 PM
i did not mean speacific community , 100:65200 ,can be replace with any ASxxxx , such 100:65300 , 100:65400 ,
that final target is when you replace with a AS number as you want , BGP will be announce to this AS .
09-19-2017 11:56 PM
Hello,
you can change the communities matched in the community list to anything you want. The idea is to match what you want to announce, and apply the route map with the community lists to the appropriate neighbors. Everything you don't match is (implicitly) denied...
09-23-2017 12:41 AM
ip community-list basic exceptAS65200 permit 100:65200
ip community-list basic exceptAS65300 permit 100:65300
ip community-list basic exceptAS65400 permit 100:65400
ip community-list basic onlytoAS permit 100:65200
ip community-list basic onlytoAS permit 100:65300
ip community-list basic onlytoAS permit 100:65400
ip community-list basic onlytoAS65200 permit 200:65200
ip community-list basic onlytoAS65300 permit 200:65300
ip community-list basic onlytoAS65400 permit 200:65400
route-policy 65200-out permit node 103
if-match community name onlytoAS65200
route-policy 65200-out deny node 105
if-match community name onlytoAS
route-policy 65200-out deny node 107
if-match community name exceptAS65200
route-policy 65200-out permit node 150
route-policy 65300-out permit node 103
if-match community name onlytoAS65300
route-policy 65300-out deny node 105
if-match community name onlytoAS
route-policy 65300-out deny node 107
if-match community name exceptAS65300
route-policy 65300-out permit node 150
route-policy 65400-out permit node 103
if-match community name onlytoAS65400
route-policy 65400-out deny node 105
if-match community name onlytoAS
route-policy 65400-out deny node 107
if-match community name exceptAS65400
route-policy 65400-out permit node 150
neighbor 192.168.1.2 remote-as 65200
neighbor 192.168.1.2 route-map 65200-out
neighbor 192.168.2.2 remote-as 65300
neighbor 192.168.1.2 route-map 65300-out
neighbor 192.168.3.2 remote-as 65400
neighbor 192.168.1.2 route-map 65400-out
this is what i deploy to satisified the requrement .
onlyAS
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: