Tuesday, April 27, 2010

BGP Conditional Advertisements

I am still preparing for my BGP exam, and found myself going through Narbiks old Soup-to-Nuts BGP labs.  They are very interesting.  One thing that caught me off guard was conditional route advertisements in bgp.  They were not discussed in either of the BGP books I read unfortunately.  So, I decided to post a bit here.  Take the following topo:

Now suppose R1 is the hub in AS 100, the other two are in AS 200, 300.  The only router with an EBGP peering with all other routers is R1.  So we want R1 to only advertise to R3 only if is present in the BGP table. If disappears we want to also not be advertised to R3.  So how can we do this...well by advertise maps is how. The config looks like this....first we create access-lists and route-maps to identify those two routes:

Then we configure our neighbor statement under our BGP process:

So lets go through what this means...To neighbor we want to advertise NotThere ( only if advertise ( *exists*.  So if is present, is advertised to R3 as well.  If its not present, and is, is pulled from the advertisements.  Its worth mentioning that there is also a non-exist-map you can use to say advertise this when this (non-advertise-map) is absent from the bgp table.  Handy little tools.  You can verify with the "show ip bgp neighbor [ip address] advertised-routes" command, or this:

You should see the condition-map line third up from the bottom.  It tells you the route-map mappings by name, and also the status of the condition-map.  Here it is advertise because the route is up.  If I were to shut down that interface the status would move to withdrawn.   On a side note, today when I initially set this up I got a status uninitialized message.  After quite a bit of digging, thanks Brian McGahan, I found a groupstudy post that mentioned that there was a bug in the 12.0(T) release that made this happen.  I upgraded the IOS and got some joy from my router.  Thanks for listening.

No comments:

Post a Comment