Conditional Advertisement
Last updated
Last updated
Topology: russo-bgp-iol
Load unix:lab1.init.cfg
This is the Nick Russo BGP Multi-Homing topology using IOL nodes.
Configure R4 and R5 to advertise an IPv4 and IPv6 default route to R6.
R6 should prefer the default routes via R4.
Configure R6 to only advertise its IPv4/IPv6 loopback addresses to R5 if the default route via R4 is gone.
This is quite a configuration intensive task. R6 must use prefix lists to identify the default routes and the local routes to advertise to R5. These must also belong to a route-map. Additionally, we need to match only R4’s default route. We cannot use a nexthop match for this. Instead, we assign a community to all routes received from R4, and match on this community. (Besides the prefix itself, you can only match on the AS_PATH and community).
Pay attention to the syntax to achieve the desired functionality. The router will only advertise 192.0.2.6/32 if a 0.0.0.0/0 route with community 65006:4 does not exist in the BGP RIB.
When the defaults from R4 exist, R6 is withdrawing its local prefixes from R5.
Next, on R4 we remove the default origination for both address-families.
On R6 we debug IPv4 and IPv6 unicast updates. We see that the default routes have been withdrawn. In response, the BGP scanner on R6 changes the condition of the route-maps to Advertise. As a note, the bgp scan timer was lowered for IPv4 but not IPv6, which is why the IPv6 change takes so much longer. (If you are using this in production, you likely want to lower the scan timer as much as possible to reduce the outage interval).
Once the defaults via R4 are lost, R6 advertises its local prefixes to R5 again. If these defaults are learned later, R6 withdraws these.
Besides the non-exist-map, there is also the option for an exist-map. With a non-exist-map, the prefix is only advertised if the route-map condition is not met. With the exist-map, the prefix is only advertised when the route-map condition is met.