cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3409
Views
10
Helpful
6
Replies

BGP Community - set on inbound and match on outbound

Alex Willoughby
Level 1
Level 1

Hello all,

 

Im labbing a scenario with BGP communities in GNS3. im trying to set a community string inbound and then match that same set community outbound. I've created a brief diagram below showing the scenario

 

bgp_community.jpg

 

Thus my config on R1 as per the below:

router bgp 1
 bgp log-neighbor-changes
 network 172.16.1.0 mask 255.255.255.252
 network 172.16.1.4 mask 255.255.255.252
 network 172.16.1.8 mask 255.255.255.252
 network 172.16.1.12 mask 255.255.255.252
 neighbor 172.16.1.2 remote-as 2
 neighbor 172.16.1.2 description *** to R2 ***
 neighbor 172.16.1.2 send-community
 neighbor 172.16.1.2 soft-reconfiguration inbound
 neighbor 172.16.1.2 route-map RM_R1>R2 out
 neighbor 172.16.1.6 remote-as 3
 neighbor 172.16.1.6 description *** to 3P ***
 neighbor 172.16.1.6 soft-reconfiguration inbound
 neighbor 172.16.1.6 route-map RM_3P>R1 in
 neighbor 172.16.1.14 remote-as 4
 neighbor 172.16.1.14 description *** to R3 ***
 neighbor 172.16.1.14 send-community
 neighbor 172.16.1.14 soft-reconfiguration inbound
 neighbor 172.16.1.14 route-map RM_R1>R3 out
! route-map RM_3P>R1 permit 10 set community 64609:1 !
route-map RM_R1>R2 permit 10
match community 64609:1
! R1#sh ip bgp neighbors 172.16.1.6 received-routes ... Network Next Hop Metric LocPrf Weight Path * 10.53.0.0/16 172.16.1.6 0 0 3 i * 172.16.1.4/30 172.16.1.6 0 0 3 i Total number of prefixes 2
R1#sh ip bgp 10.53.0.0/16
BGP routing table entry for 10.53.0.0/16, version 9 Paths: (1 available, no best path) Not advertised to any peer Refresh Epoch 1 3, (received-only) 172.16.1.6 from 172.16.1.6 (172.16.1.6) Origin IGP, metric 0, localpref 100, valid, external rx pathid: 0, tx pathid: 0
R1#sh ip bgp route-map RM_R1>R3 R1#sh ip bgp neighbors 172.16.1.14 advertised-routes Total number of prefixes 0 R1#

it looks like the route 10.53.0.0/16 does not have the community string set in the bgp table hence it not matching in the route map nor the advertised routes, is it possible to set strings inbound? is this a limitation of the way things are processed a limitation of GNS3 or other?

 

Thanks

Alex

 

1 Accepted Solution

Accepted Solutions

Hi

To match a community you should not use the community number, instead use a community-list.

ip community-list 3 permit 64609:1

route-map RM_R1>R2 permit 10

match community 3

/Mikael

View solution in original post

6 Replies 6

Pawan Raut
Level 4
Level 4

where is router 4 connected in the diagram? and from the config it is not clear which BGP neighbor for which router 

ive cleaned everything up now, I was using the lab for two scenarios and lazy copied the Configuration as is, apologies hopefully all is clear now?

Richard Burts
Hall of Fame
Hall of Fame

Alex

 

Your drawing indicates that you want to advertise differenty to R2 and R3. But the configuration posted shows it is using exactly the same route map for both neighbors. Therefore exactly the same advertisements (or lack of advertisements) to both neighbors.

 

HTH

 

Rick

HTH

Rick

Hi Rick,

Apologies that was my lazy config pasting, and it probably threw the query. The issue seen is that ive set inbound and im trying to match outbound, but unsuccessfully. As you can see when the route-map is run against the bgp table its empty, the neighbour also receives empty routes too.

The outbound route map should match the routes set inbound from the device 3P

Thanks
Alex

Hi

To match a community you should not use the community number, instead use a community-list.

ip community-list 3 permit 64609:1

route-map RM_R1>R2 permit 10

match community 3

/Mikael

Thanks Mikael,

 

That did the trick, odd that you need to use a list and can't use a community  directly even though the commands are there though?

Review Cisco Networking for a $25 gift card