Advertise a prefix only when another one disappears.
Advanced · 15 min read
You'll learn to configure advertise-map with non-exist-map, verify the condition, and explain why it reacts to routes in the BGP table and not to link state.
Withholding a prefix until it is needed
Normal advertisement is unconditional. Sometimes you want a prefix sent to the backup ISP only if the primary has failed, for example so that no traffic enters through the backup while the primary works. Conditional advertisement makes the advertisement depend on the BGP table.
Conditional advertisement logic
On small screens, swipe sideways or focus the diagram and use the arrow keys.
non-exist-map advertises the backup only when the watched prefix is missing.
Advertise the backup only when the primary has gone
On small screens, swipe sideways or focus the diagram and use the arrow keys.
Conditional advertisement reacts to a route, not to a link. It watches BGP table contents.
Conditional advertisement towards ISP B
On small screens, swipe sideways or focus the diagram and use the arrow keys.
The condition is checked against the local BGP table, so it follows what R2 can actually see. It is a way to hold a backup path back until it is needed.
Configure it on R2
R2 watches for a route that proves ISP A is working: 203.0.113.0/24 learned through R1. While it exists, R2 does not advertise the company prefix to ISP B. When it disappears, R2 advertises it.
exist-map and non-exist-map
On small screens, swipe sideways or focus the diagram and use the arrow keys.
Pick the one that matches the failure you want to react to.
ip prefix-list WATCH-ISPA seq 10 permit 203.0.113.0/24
ip prefix-list COMPANY-ONLY seq 10 permit 198.51.100.0/24
route-map ADVERTISE permit 10
match ip address prefix-list COMPANY-ONLY
route-map NONEXIST permit 10
match ip address prefix-list WATCH-ISPA
router bgp 64500
address-family ipv4 unicast
neighbor 192.0.2.5 advertise-map ADVERTISE non-exist-map NONEXIST
R2. advertise-map lists what to advertise. non-exist-map lists the prefix whose absence triggers advertising. Both prefixes must be in the BGP table for the logic to work.
Illustrative Cisco IOS XE output written for this lesson, not a router capture
R2#show ip bgp neighbors 192.0.2.5 | include Condition
Condition-map NONEXIST, Advertise-map ADVERTISE, status: Withdraw
Withdraw means the watched route exists, so the company prefix is held back. When the watched route disappears the status changes to Advertise.
Use a lab or a window. Remove the watched route, wait for the next scan, and check that the backup prefix is now advertised. Restore the watched route and confirm that the advertisement is withdrawn again.
The router checks the condition on a scan interval, so changes are not instant. Allow for that delay in any recovery calculation.
Failover and recovery timeline
On small screens, swipe sideways or focus the diagram and use the arrow keys.
Recovery time includes the scan interval and normal BGP convergence.
Check your understanding
Predict · scenario 1
The watched route is in the table. What happens to the company prefix toward ISP B?
Predict · scenario 2
What does the non-exist-map match?
Predict · scenario 3
What does conditional advertisement watch?
FAQ
Why not just prepend heavily to the backup ISP?
Prepending still advertises the prefix, and some networks will use the longer path. Conditional advertisement withholds the prefix entirely until it is needed.
Does the condition react to a link failure?
Indirectly. If a failed link makes the watched route leave the BGP table, the condition changes. The router is watching routes, not interfaces.
What are the two maps?
The advertise-map names the prefixes to advertise conditionally. The non-exist-map names the prefix whose absence triggers the advertisement.