Course contents

Module 1: Communities and MultihomingLesson 1.3 (3 of 3 in this module)3 of 11 in the Advanced BGP course

Conditional advertisement

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
Conditional advertisement logicThe router watches one prefix and decides whether to advertise another.Watchthe primary prefixPresent?yes: backup withheldAbsent?backup advertisedResulttraffic shifts to thebackup path

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
Advertise the backup only when the primary has goneA non-exist map watches for a prefix from ISP A. While it is present, R2 does not advertise the company prefix to ISP B. When it disappears, R2 advertises it.R2watches primaryIs the watchedprefix in the table?Presenthold the advertMissingadvertise to ISP B

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
Conditional advertisement towards ISP BR2 learns the route 203.0.113.0/24 from ISP A. A non-exist-map watches for that route. While it is present in the BGP table, R2 does not advertise the backup prefix 198.51.100.0/25 to ISP B. If the route from ISP A disappears, R2 starts advertising the backup prefix to ISP B so traffic can arrive another way.ISP AR2AS 64500ISP B203.0.113.0/24198.51.100.0/25Route from ISP A presentbackup prefix is not advertisedRoute from ISP A missingbackup prefix advertised to ISP Bneighbor 192.0.2.5 advertise-map ADV non-exist-map NON-EXIST

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
exist-map and non-exist-mapexist-map advertises when the watched route is present. non-exist-map advertises when it is absent.advertise-map + exist-mapAdvertise only whilethe watched route existsadvertise-map + non-exist-mapAdvertise only whilethe watched route is goneor

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.

Technical reference: Cisco, BGP conditional advertisement. Output above is illustrative.

How to test it

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
Failover and recovery timelineThe primary prefix disappears, the scanner notices, and the backup is advertised.Primary lostwatched route goneScannext condition checkBackup advertisedUPDATE sentPrimary backbackup withdrawn

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.