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

how to "do not announce to ASxxxx"

gbcbooksmj
Level 1
Level 1

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 

4 Replies 4

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

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 .  

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


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

Getting Started

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:

Review Cisco Networking products for a $25 gift card