Vaibhav Singh

Blog - vaibhavsingh.com

BGP aggregation – suppress generation of anchor null0 local routes

A scenario came up when a colleague was working on a project where his router was peering with a 3rd party router over eBGP. The router was performing aggregation for 10.x.x.x subnets, summary-only as 10.x/16.

We know that BGP will generate a null0 anchor route automatically for the summary address. Now a situation occurred where the peering between the two routers went down but the null0 generation didn’t go away from the RIB (because the router had various SVIs in 10.x net).

Finally, we increased the internal route’s AD to 255 under BGP process which also increases the AD of null0 route to 255. Routes with 255 as their AD don’t make it to the routing table (RIB).

router bgp 4
 bgp log-neighbor-changes
 aggregate-address 10.0.0.0 255.0.0.0 summary-only

!--Null0 anchor generated automatically
R4#sh ip route | i ull
B     200.1.0.0/16 [200/0] via 0.0.0.0, 00:00:50, Null0

!--Tuning the distance under BGP process
R4(config-router)#distance bgp ?
<1-255> Distance for routes external to the AS

R4(config-router)#distance bgp 20 ?
<1-255> Distance for routes internal to the AS

R4(config-router)#distance bgp 20 200 ?
<1-255> Distance for local routes

R4(config-router)#distance bgp 20 200 255

After this, we have to wait for the aggregation sub-process to be able to detect this change, as far as I can tell, there is a trigger. Anyway, google to find how to tune the timers for that specific process to speed up. To force the change, clear the BGP peering.

R4#sh ip route | i ull
!--nothing to show in the output, we have a success!

R4#sh ip bgp rib-failure
Network            Next Hop                      RIB-failure   RIB-NH Matches
200.1.0.0/16       0.0.0.0             Admin distance >= 255              n/a

The aggregated summary prefix will still be sent over to the peer. But it won’t be part of your RIB.

Conclusion

Such situation is likely not a common occurrence, still it is good to make a note of it as it may come handy in a pinch, if you ever get pushed into a corner with a real world problem such as this.

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top