OSPF - Default route advertisement next hop IP

OSPF advertises a default route to its neighbors using the IP address of the interface from which the advertisement is sent as the next hop IP address. This is the case whenever the default-information originate command is used (either with or without the always keyword).

For example, refer to the following topology:

ospf-default-route-advertisement.png

If R1 is configured to advertise a default route using OSPF, it will do so to both R2 and R3. When R2 receives that advertised default route, the next hop IP that will be used is 10.10.10.1, while R3 will receive a next hop IP of 10.10.20.1.

When a downstream router like R4 is added, the next hop IP for the default routes received from R2 and R3 will follow OSPF path selection rules. The shortest path will take precedence. If the shortest path is via R2, the next hop IP will be 192.18.1.1; if via R3, it will be 192.168.2.1.

If the cost to both R2 and R3 is the same, Equal Cost Multipath (ECMP) routing will occur, and both paths will be placed in the routing table. If ECMP is disabled or not supported, the highest router ID between R2 and R3 will be chosen as the best path.

Links:

https://forum.networklessons.com/t/how-to-configure-ospf-default-route/934/41?u=lagapidis

https://networklessons.com/ospf/how-to-configure-ospf-default-route/

https://networklessons.com/ospf/how-to-read-the-ospf-database