Default Routes Open Shortest Path First

Practice this topic in the router emulator While your network may need to know specifics on how to efficiently reach your own subnets, typically traffic destined for outside networks needs only minimal routing information. This is because there may only be one or a few routes out, and once out you will no longer concern yourself over how traffic reaches it's destination or have any control. To implement this, OSPF provides a facility to inject a default route into its domain so that all traffic not destined for your own network can be routed out.

Injecting a default route into OSPF

Using the command default-information originate from routing configuration mode, it is possible to tell OSPF to automatically inject any default route that already exists on that router into the OSPF routing domain. Notice that emphasis is put on the already exists part of that sentence. If no default route exists on the router, then no default route is injected into the OSPF domain.

Router(config-router)#default-information originate

Using the above command tells the router to advertise its default route (if one exists) throughout the OSPF domain, and all traffic destined for outside will be sent via it. In the event a default route does not already exists on the router, then we will need to create one to be advertised. How do we do that I hear you cry? With the ip route command of course.

Router(config)#ip route <nextHop>

With the above command set, OSPF will now tell the rest of the network to send outside traffic to it, for onward forwarding.

Always generating a default route

It is possible to force OSPF to advertise a default route throughout its area despite not having a default configured itself. This is achieved using the same command, but adding the work always onto the end.

Router(config-router)#default-information originate always

Further Reading