OSPF Default Route Alternatives


Assume R3 is a breakout for your network, and lets assume for a second you want to advertise a default route into the OSPF domain, but on the condition that you have reachability to the Gateway (GW)

The usual and a really easy way to do this is by originating a default-route based on a route-map with a condition that a specific route is in the routing table.

interface Gi0/0
ip address
ip prefix-list GW seq 5 permit
route-map DEF-GW permit 10
match ip address prefix-list GW
router ospf 1
default-information originate route-map DEF-GW

This will work, but there is a design flaw to this particular setup. This setup is based on the prefix being in the routing table, but since Gi0/0 is a connected interface, that prefix will always be in the routing table, whether or not the GW router is up or down. Remember this is a not a serial link, where the link state could determine point-to-point reachability. The only time that prefix will not be in the routing table and as a result, not originate the default-route, is when the physical local connection to the switch dies. Inevitably this will create a black-hole, which is no good.

So now what. You need to have some form of tracking the IP address on the remote-end, not just the interface state.
We could do this by using a IP Sla Monitor, track the remote-end IP, conditionally create a default route in the routing table, and then when we have reachability, originate the default route into OSPF .

First we would create the Ip Sla Monitor:
ip sla monitor 1
type echo protocol ipIcmpEcho source-interface GigabitEthernet0/0
frequency 10
ip sla monitor schedule 1 life forever start-time now

Next, setup the Track that your conditional static route would reference before creating the default route:
track 1 rtr 1
ip route Null0 track 1

Then the easy part, originate and advertise a default route into the OSPF domain if is available in the routing table:
router ospf 1
default-information originate

Now if the GW router goes, or the local Gi0/0 interface dies, the default route would be removed from the routing table, and as a result R3 would stop originating a default route, until connectivity is restored.


3 thoughts on “OSPF Default Route Alternatives

  1. Nice, Going through OSPF as part of my CCIE lab revision, this is really helping. Bought your R&S notes also, they’re really great.

    Thanks a bunch

  2. But R3 is going to drop traffic to 0/0 because it’s pointing to Null0?
    I am probably missing something here.

Please leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.