Showing results for 
Search instead for 
Did you mean: 
Vivek Ganapathi

BGP Conditional Advertisement ?

Hello All,

Having a project requirement which i was labbing up on GNS3 yesterday night. Attaching the diagram.

  • Routers R1, R2, R3, R4, R5 are running OSPF in area 0.
  • R4 & R5 are ASBR.
  • R4, R5 are connected via MPLS to R6 & running BGP.


1) All the traffic originated from R1 should be Source NAT at R4 or R5 from an allocated pool not part of global outside.

2) R4 should be a preferred path for inbound/outbound. Used AS-PATH Prepend on R5 to be less preferred inbound. Redistributed BGP into OSPF with a better cost via R4.


Detailed configuration is attached into this the discussion thread.

  • BGP is redistributed into OSPF
  •     Source NAT the traffic originated from R1's Loopback 1 interface. Specific ACLs used depending on the destination

      • Source as seen by R6 is if the destination is set to, then the source is
      • Source as seeb by R6 if the destination is set to, then the source is
  • As & is not in the routing table, i originated the route using Null interface.


  • If there is a failure on the last mile of R4, then things are fine. R1 gets to learn about the destinations / via R3 & moves out via R5.
  • But if there is a failure of R2 or link between R2 & R4, then the issues comes in. Though R1 starts learning the destination routes via R3 & passes through R5 to R6, but the return traffic tries coming back via R4. The reason is, R6 still knows the return path to / via R4.

How to tackle this?

I thought BGP Conditional Advertisement would work for me. I thought of creating a condition on R4 - ADVERTISE / only if a route exist in the routing table. ( is a loopback interface created on R1). Now, a good thing is, as soon as i shutdown the interface on R1 connected to R2, the route for vanishes from the routing table of R4 & BGP stops advertising the routes set in Advertise-map. But once i bring back the interface, BGP doesn't advertise those routes back. Not sure, if issue could be a GNS3 bug ?

Kindly request your help & suggestion.



Vivek Ganapathi

Got the answer !

To do a successful conditional advertisement, the route must be present in the BGP routing table. In my case, was learnt via OSPF & wasn't redistributed into BGP which stopped the conditional advertisement.