It took me awhile to get this going for some reason but here is the doc that helped me out:
Configuring and Verifying the BGP Conditional Advertisement Feature
Here's my example
[R1]---[R4]---[R5]
Each router is in its own AS.
R1 is advertising 10.1.0.0/16 to R4.
if this route should fail, then R4 should advertise 4.4.4.0/24 to R5.
If 10.1.0.0/16 appears in R4's BGP table, then it should stop advertising 4.4.4.0/24.
R4 is where the action is so let's have a look:
!
interface Loopback0
ip address 4.4.4.4 255.255.255.0
!
router bgp 4
no synchronization
bgp log-neighbor-changes
network 4.4.4.0 mask 255.255.255.0
neighbor 155.1.45.5 remote-as 5
neighbor 155.1.45.5 advertise-map ADV non-exist-map NON
neighbor 155.1.146.1 remote-as 1
no auto-summary
!
access-list 10 permit 10.1.0.0 0.0.255.255
access-list 40 permit 4.4.4.0 0.0.0.255
!
route-map NON permit 10
match ip address 10
!
route-map ADV permit 10
match ip address 40
10.1.0.0 is actually the loopback network on R1 so we can test easy by shutting/no shutting the interface. Right now it is up. Let's check the BGP tables on R4 and R5:
R4#show ip bgp | begin Network
Network Next Hop Metric LocPrf Weight Path
*> 4.4.4.0/24 0.0.0.0 0 32768 i
*> 10.1.0.0/16 155.1.146.1 0 0 1 i
R5#show ip bgp | begin Network
Network Next Hop Metric LocPrf Weight Path
*> 10.1.0.0/16 155.1.45.4 0 4 1 i
Now let's shut the interface on R1:
R1(config)#int lo 1
R1(config-if)#shut
Now check R4 and R5 again:
R4#show ip bgp | begin Network
Network Next Hop Metric LocPrf Weight Path
*> 4.4.4.0/24 0.0.0.0 0 32768 i
R5#debug ip bgp updates
BGP updates debugging is on for address family: IPv4 Unicast
*Mar 1 01:59:35.787: BGP(0): 155.1.45.4 rcvd UPDATE w/ attr: nexthop 155.1.45.4, origin i, metric 0, path 4
*Mar 1 01:59:35.791: BGP(0): 155.1.45.4 rcvd 4.4.4.0/24
*Mar 1 01:59:35.799: BGP(0): Revise route installing 1 of 1 routes for 4.4.4.0/24 -> 155.1.45.4(main) to main IP table
R5#show ip bgp | begin Network
Network Next Hop Metric LocPrf Weight Path
*> 4.4.4.0/24 155.1.45.4 0 0 4 i
Configuring and Verifying the BGP Conditional Advertisement Feature
Here's my example
[R1]---[R4]---[R5]
Each router is in its own AS.
R1 is advertising 10.1.0.0/16 to R4.
if this route should fail, then R4 should advertise 4.4.4.0/24 to R5.
If 10.1.0.0/16 appears in R4's BGP table, then it should stop advertising 4.4.4.0/24.
R4 is where the action is so let's have a look:
!
interface Loopback0
ip address 4.4.4.4 255.255.255.0
!
router bgp 4
no synchronization
bgp log-neighbor-changes
network 4.4.4.0 mask 255.255.255.0
neighbor 155.1.45.5 remote-as 5
neighbor 155.1.45.5 advertise-map ADV non-exist-map NON
neighbor 155.1.146.1 remote-as 1
no auto-summary
!
access-list 10 permit 10.1.0.0 0.0.255.255
access-list 40 permit 4.4.4.0 0.0.0.255
!
route-map NON permit 10
match ip address 10
!
route-map ADV permit 10
match ip address 40
10.1.0.0 is actually the loopback network on R1 so we can test easy by shutting/no shutting the interface. Right now it is up. Let's check the BGP tables on R4 and R5:
R4#show ip bgp | begin Network
Network Next Hop Metric LocPrf Weight Path
*> 4.4.4.0/24 0.0.0.0 0 32768 i
*> 10.1.0.0/16 155.1.146.1 0 0 1 i
R5#show ip bgp | begin Network
Network Next Hop Metric LocPrf Weight Path
*> 10.1.0.0/16 155.1.45.4 0 4 1 i
Now let's shut the interface on R1:
R1(config)#int lo 1
R1(config-if)#shut
Now check R4 and R5 again:
R4#show ip bgp | begin Network
Network Next Hop Metric LocPrf Weight Path
*> 4.4.4.0/24 0.0.0.0 0 32768 i
R5#debug ip bgp updates
BGP updates debugging is on for address family: IPv4 Unicast
*Mar 1 01:59:35.787: BGP(0): 155.1.45.4 rcvd UPDATE w/ attr: nexthop 155.1.45.4, origin i, metric 0, path 4
*Mar 1 01:59:35.791: BGP(0): 155.1.45.4 rcvd 4.4.4.0/24
*Mar 1 01:59:35.799: BGP(0): Revise route installing 1 of 1 routes for 4.4.4.0/24 -> 155.1.45.4(main) to main IP table
R5#show ip bgp | begin Network
Network Next Hop Metric LocPrf Weight Path
*> 4.4.4.0/24 155.1.45.4 0 0 4 i