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

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. If you'd prefer to explore, try our test area to get started. And see here for current known issues.

New Member

default route if route is a BGP route

Hey All,

I'm trying to figure out how to propigate a default route from OSPF if the devices default route is learned via BGP.

This is what I have in my config. I've removed the non-relevant commands.

router ospf 100

default-information originate metric-type 1 route-map CHECK_DEFAULT



ip prefix-list CHECK_DEFAULT seq 5 permit


route-map CHECK_DEFAULT permit 20

match ip address prefix-list CHECK_DEFAULT

match source-protocol bgp 65001

My problem is that this router, when BGP is down, will learn a default route from a backup router. This it readvertises the default route again and creates a ping pong effect.

This is what the route looks like when coming from BGP.

Routing entry for, supernet

  Known via "bgp 65001", distance 20, metric 0, candidate default path

  Tag 209, type external

  Redistributing via ospf 100

  Last update from 00:00:15 ago

  Routing Descriptor Blocks:

  *, from, 00:00:15 ago

      Route metric is 0, traffic share count is 1

      AS Hops 2

      Route tag 209

And this is what is looks like when coming from OSPF.

Routing entry for, supernet

  Known via "ospf 100", distance 110, metric 1, candidate default path

  Tag 100, type extern 2, forward metric 110

  Redistributing via bgp 65001

  Last update from on FastEthernet0/1, 02:37:50 ago

  Routing Descriptor Blocks:

  *, from, 02:37:50 ago, via FastEthernet0/1

      Route metric is 1, traffic share count is 1

      Route tag 100

If BGP is up then I want to advertise the default inbound via OSPF. If it is not, I do not.

It seems that the route-map is doing an either or match. I need it to do a AND match.

Any ideas?


  • WAN Routing and Switching

default route if route is a BGP route

Hi Patrick,

From my understanding, the route-map option at the end of the OSPF 'default-information originate' command is only used for conditional advertisement where a default route will only be advertised when certain other routes are present in the routing table.

So in your example, when BGP is down and the BGP default is withdrawn, a default route still exists in the routing table via the backup so the route-map is still matched and OSPF advertises the default to its neighbors.

A workaround is to use conditional route advertisement with object tracking. Here we can setup a IP SLA monitor to ping your BGP neighbor and if successful install a dummy route in the routing table, this dummy route is then matched in the route-map and allow OSPF to advertise the default. If the BGP neighbor is down, the IP SLA fails and the dummy route is withdrawn resulting is OSPF from withdrawing its default route.

I can send you an example config if that helps.


New Member

default route if route is a BGP route


I'd love to see an example.

I made a little progress. I was able to get my config working when I used this route map.

route-map CHECK_DEFAULT permit 10

match ip address prefix-list CHECK_DEFAULT

match tag 209

The route tag from my BGP network is 209. I'll be doing some testing to see if this will work for me.


default route if route is a BGP route

Yes, matching the tag as well is a good idea, I didnt think of that. Your method is also less config intensive :-)

Example config using IP SLA. Host will be the BGP neighbor

ip sla 1



ip sla schedule 1 life forever start-time now


track 1 rtr 1


ip route Null0 track 1


ip prefix-list DUMMYROUTE seq 5 permit


route-map OSPF-DEFAULT permit 10

match ip address prefix-list DUMMYROUTE


router ospf 1

default-information originate route-map OSPF-DEFAULT

New Member

default route if route is a BGP route

Thanks Will. I had not thought of using the track statement on the route line.


Hall of Fame Super Blue

Re: default route if route is a BGP route


Just a quick addition.

I think the matching on the tag should work fine although Will seems to be suggesting you can't do a conditional advertisement for the default route when the route you are checking for is the default route so as you say it would need testing.

In terms of using match source-protocol i found this document which states that it just does not work for OSPF conditional advertisement so it may just be you were unlucky in choosing that specific option -


This widget could not be displayed.