Saturday, March 9, 2013

BGP Community - No-export

I am continuing from my previous post on BGP communities. Since the topology is the same we will skip the interface and BGP configurations and dive right into what is no-export community, how to configure it and see how it affects routing updates.

Same topology as my previous blogtorial BGP Communities No-Advertise 
Complete configs can be downloaded here.
The purpose of the no-export community is to mark a destination so that the peer does not advertise it outside of its own AS. If confederations are used then the route should stay within the confederation meaning the routes can pass to sub-confederations.

Again if you need to look at the interface / BGP configuration check out my previous post. The only thing we are going to modify here is the route-map on R1 so that the loopback (11.11.11.11/32) can be advertised to R2 with no-export community.

 !  
 hostname R1  
 !  
 ip access-list standard acl-loopback-advertise-with-community  
  remark match loopback  
  permit 11.11.11.11  
 !  
 route-map loopback-advertise-with-comunity permit 10  
  match ip address acl-loopback-advertise-with-community  
  set community no-export  
 !  
 router bgp 1  
  no synchronization  
  bgp log-neighbor-changes  
  network 11.11.11.11 mask 255.255.255.255  
  neighbor 1.1.1.2 remote-as 2  
  neighbor 1.1.1.2 send-community both  
  neighbor 1.1.1.2 route-map loopback-advertise-with-comunity out  
  no auto-summary  
 !  

 !  
 hostname R2  
 !  
 router bgp 2  
  no synchronization  
  bgp log-neighbor-changes  
  neighbor 1.1.1.1 remote-as 1  
  neighbor 2.2.2.3 remote-as 2  
 !!next-hop-self is needed for the iBGP peer to R3. If not, R3 would see the next hop as 1.1.1.1
   and since it does not have a route to 1.1.1.1 the loopback route will not be installed in the 
   routing table.!!   
  neighbor 2.2.2.3 next-hop-self  
  neighbor 4.4.4.4 remote-as 4  
  no auto-summary  
 !  

Let's make sure that 11.11.11.11/32 from R1 is being advertised by R2 to R3 (iBGP) and not R4 (eBGP).

R2 advertises the route 11.11.11.11/32 to R3 since they are iBGP neighbors. 
R3 does have the route in its routing table. 
Share within your AS and forget the rest.

Many more articles to come so stay tuned.

Please subscribe/comment/+1 if you like my posts as it keeps me motivated to write more and spread the knowledge.

No comments:

Post a Comment