Another OSPF default Route question

Hello guys,
I have a question about default routes in ospf. I have 3 routers running ospf. I configured the “default-information originate always” command on R1. When i go to the other routers they show a gateway of last resort is x.x.x.x to network 0.0.0.0 which is correct.
When i go back to R1 and do a show ip route it says “gateway of last resort is not set” Why is that?
If i do “sh ip ospf database” the default route show up as:
Type-5 AS External Link States
Link ID ADV Router Age Seq# Checksum Tag
0.0.0.0 1.1.1.1 1194 0x80000001 0x001D91 1

which is correct, but not in the “sh ip route” or “sh ip route ospf” command. Why?

Thanks,
Cecil

Hello Cecil

There are two ways to advertise a default route in OSPF. The first is to advertise 0.0.0.0 into the OSPF domain using the command default-information originate on the router that actually has this default route. In your scenario this is R1. A prerequisite for this situation is that a statically defined default route has been configured on this router in the form of ip route 0.0.0.0 0.0.0.0 1.2.3.4. If this default route is not configured, no default route will be advertised to any other routers.

The second way is to do it as you have done using the default-information originate always command. This command forces the router to advertise to all neighbouring routers that it has a default route available and that all OSFP routers in the area should install a default route in their routing tables pointing to it. Now, the always keyword here makes he router advertise this regardless of whether the advertising router actually has a default route.

So what you have done is the second scenario where R1 is telling all other routers that it has a default route and that all default route traffic should be directed towards it, however, R1 itself does not actually have a default route! So, in order to rectify this situation, you must give that information to R1, tell it what its default route is. Now this can be done with a statically defined default route or by learning the default route from another OSPF area or another routing protocol, but it must learn this route from somewhere.

Otherwise default route traffic will be sent from neighbouring routers to R1 and R1 will not know what to do with it, and it will be dropped.

I hope this has been helpful!

Laz

Good morning Lazaros,
Thanks for your response. That clears up everything for me.