BGP Conditional Advertisement
What is BGP conditional Advertisement
The Border Gateway Protocol (BGP) conditional advertisement feature provides additional control of route advertisement, depending on the existence of other prefixes in the BGP table.
Normally, routes are propagated regardless of the existence of a different path.
The BGP conditional advertisement feature uses the non-exist-map and the advertise-map keywords of the neighbor advertise-map command in order to track routes by the route prefix. If a route prefix is not present in output of the non-exist-map command, then the route specified by the advertise-map command is announced.
Configuration Example
Example-1:
The following means that BGP router will advertise the prefix 192.168.224.0/20 to neighbor 172.16.4.2 ONLY IF route 172.16.31.0/24 exist locally in BGP table.
Which aslo means if 172.16.31.0/24 BGP route lost at some point, the prefix 92.168.224.0/20 will be withdrawn.
router bgp 65010
address-family ipv4
neighbor 172.16.4.2 advertise-map LD_MAP exist-map EXIST
route-map LD_MAP permit 10
match ip address prefix-list IP_AD
ip prefix-list IP_AD seq 10 permit 192.168.224.0/20
route-map EXIST permit 20
match ip address prefix-list ROUTE-X
ip prefix-list ROUTE-X seq 5 permit 172.16.31.0/24
Code language: PHP (php)
Example-2:
For example, we can set up condition to only advertise a default route to a neighbor when you have specific routes from a peer:
router bgp 65010
address-family ipv4
neighbor 172.16.4.2 advertise-map LD_MAP exist-map EXIST
route-map LD_MAP permit 10
match ip address prefix-list DEF_ROUTE
ip prefix-list DEF_ROUTE seq 10 permit 0.0.0.0/0
route-map EXIST permit 20
match ip address prefix-list ROUTE-X
ip prefix-list ROUTE-X seq 5 permit 172.16.29.0/24
Code language: PHP (php)
This feature is useful for multihomed networks, in which some prefixes are advertised to one of the providers only if information from the other provider is not present (this indicates a failure in the peering session or partial reachability).
TBC