How to advertise a default route into OSPF

Link between IOSV1 and IOSV2 : 192.168.1.0/24

Link between IOSV2 and IOSV3: 192.168.2.0/24

Situation: We are running OSPF in our network. IOSV1 is hypothetically connect to an ISP router.

Our ISP does not form an OSPF neighborship with us. That means that IOSV2 and IOSV3 can only reach the networks inside

the OSPF routing domain. They cannot get to anything out on the internet because they do not have have a route.

 

Let’s check IOSV3’s routing table…

 

All we see is intra-area OSPF routes and directly connected interfaces.

We could just create some static routes that point toward IOSV1 and call it a day, but that does not scale well.

What if we decided acquired a company, are we going to manage all of those static routes? What if we want redundant links?

 

Luckily OSPF provides two simple ways of distributing a default route.

 

Option 1 :

We could use the OSPF provided default-information command to redistribute a default routeĀ into OSPF.

config#

Enable

Configure terminal

Router OSPF 1

default-information originate always

 

That’s all that is required to always redistribute a default route into OSPF. Let’s confirm IOSV3 has that route.

Great that worked.

We could also have used “default-information originate” however if we used that we would need a static route on IOSV1 or else it would never redistribute the route.

 

Option 2:

We could create a static route out to the ISP since there’s only one connection out and redistribute static routes.

Config on R1#

enable

configure terminal

ip route 0.0.0.0 0.0.0.0 <next hop ip>

router ospf 1

redistribute static

The down side to this is you may redistribute static routes you didn’t want to. Of course you could always use route-maps to filter this but the whole point of default-information is so that you don’t need to do this. Let’s check IOSV3’s routing table…

 

Both options redistribute these routes as E2 routes with the same cost and administrative distance.

Both routes also show up as type-5 LSAs which means they came from an external autonomous system (redistribution).