When the redistribute or default-information command is executed, the OSPF-enabled device
automatically turns into the ASBR. The ASBR cannot generate the default route automatically or
advertise it to all the devices in the OSPF routing domain. The ASBR can generate the default route
with the default-information originate command in routing process configuration mode.
If the always parameter is used, the OSPF routing process advertises an external default route to
neighbors, no matter the default route exists or not. However, the local device does not display the
default route. To make sure whether the default route is generated, use the show ip ospf database
command to display the OSPF link state database. The external link identified with 0.0.0.0 indicates
the default route. You can use the show ip route command on the OSPF neighbor to display the
default route.
The metric of the external default route can be defined only with the default-information originate
command.
There are two types of OSPF external routes: type 1 external routes have changeable routing
metrics, while type 2 external routes have constant routing metrics. For two parallel routes with the
same route metric to the same destination network, the type 1 route takes precedence over the type 2
route. As a result, the show ip route command displays only the type 1 route.
This command generates a default route of Type-5 LSA, which will not be flooded to the NSSA area.
To generate a default route in the NSSA area, use the area nssa default-information-originate
command.
The routers in the stub area cannot generate external default routes.
The range of set metric is 0 to 16777214 for the associated route map. If the value exceeds the
range, introducing a route fails.
The following example configures that OSPF generates an external default route and injects it to the
OSPF routing domain. The default route is of type 1 and the metric 50.
Ruijie(config)#routerospf 1
Ruijie(config-router)#network172.16.24.0 0.0.0.255 area 0
Ruijie(config-router)#default-information originate
alwaysmetric50metric-type1