OSPF - default-information originate always command
When implementing OSPF, it is possible to advertise a default route using the default-information originate
command under the OSPF configuration mode. However, whether or not a default route will be advertised depends upon whether or not a default route exists within the Routing Table of the local OSPF router.
When you use the default-information originate
command alone, without the always
keyword, OSPF will advertise a default gateway only if a default gateway exists in the routing table itself. If the always
keyword is used, then a router will advertise itself as the default gateway regardless of whether or not a default gateway exists in the routing table.
Take a look at this network topology:
Let’s say you want to advertise a default route from R2 to R1. Now R2 has no default gateway configured in its routing table. Let’s say you issue the following command on R2 within the OSPF configuration mode:
default-information originate
R2 will not advertise a default route to R1.
If you use the following command:
default-information originate always
R2 will advertise a default route to R1. In other words, it will say to R1 “install in your routing table my next hop IP address (192.168.12.2) as the default gateway”. Thus, the default gateway that R1 will put in its routing table via OSPF is 192.168.12.2, even though R2 has no default gateway entry in its routing table.
Links
https://networklessons.com/ospf/troubleshooting-ospf-route-advertisement#OSPF_Default_Route