Cisco Support Community
Showing results for 
Search instead for 
Did you mean: 
New Member

BGP Conditional Advertisement

We are running BGP with two Service Providers, The requirement is to use SP1 as primary and SP2 as backup. Want to achieve this by using conditional advertisement.

Current config is:

router bgp xxxxx

no synchronization

bgp log-neighbor-changes

network xxx.xx.x44.0

network xxx.xx.x48.0

network xxx.xx.x49.0

network xxx.xx.x50.0

network xxx.xx.x51.0

neighbor yy.yyy.yyy.17 remote-as yyyyy

neighbor yy.yyy.yyy.17 route-map localonly out

neighbor zzz.zzz.zzz.189 remote-as zzzzz

neighbor zzz.zzz.zzz.189 route-map localonly out


ip route yy.yyy.yyy.17

ip route zzz.zzz.zzz.189

ip as-path access-list 10 permit ^$


route-map localonly permit 10

match as-path 10

x is for my network

y is for SP1

z is for SP2

VIP Purple

Re: BGP Conditional Advertisement


if you want to use conditional advertising, you could do the following:

Add a tag to the default route pointing to your primary ISP:

ip route yy.yyy.yyy.17 tag 10

Add the following to your route map:

route-map localonly permit 10

match tag 10

set weight 200

This way you default route pointing to SP1 would always have a higher wight and therefor be preferred.

The same could be achieved by spwcifying the weight in your neighbor statement:

neighbor yy.yyy.yyy.17 weight 200

Or you could use local preference:

neighbor yy.yyy.yyy.17 local-preference 200



New Member

Re: BGP Conditional Advertisement

Your answer serves the purpose, but there are some upcoming requirements in which I have to advertise certain classes on one network and other class on second network. And in case of any link failure remaining link will carry all the traffic.

New Member

Re: BGP Conditional Advertisement

Your requirement is to use SP1 as primary and SP2 as backup - OK..What can be done is -

1. For the incoming traffic from Internet -

a. Advertise all your IP subnets on both of the SP links.. For the Sec SP link add a route map to the outgoing advertisement and set AS PAth Prepend..

2. For the outgoing traffic from ur network ..

a. Set local preference for the incoming traffic..

Hope the above solution will work..

Pls let me know for further queries..

Cisco Employee

Re: BGP Conditional Advertisement

Here's a good paper on the BGP conditional advertisement feature.

Let me know if it helps,

Harold Ritter
Sr. Technical Leader
CCIE 4168 (R&S, SP)
México móvil: +52 1 55 8312 4915
Cisco México
Paseo de la Reforma 222
Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
CreatePlease to create content