7.4 The 0.0.0.0 Default Route
7.4.6 The default-information originate command
The capability to generate and redistribute default routes is of extreme importance within any large network.

An ASBR can be forced to generate a default route into an OSPF Network. As discussed earlier, a router becomes an ASBR whenever routes are redistributed into an OSPF network or is attached to another autonomous system. However, an ASBR does not, by default, generate a default route into an OSPF network.

There are several ways to generate a default route within an OSPF network.

The first is to advertise 0.0.0.0 inside the domain, but only if the ASBR itself already has a default route.

The second is to advertise 0.0.0.0 regardless of whether the ASBR has a default route. This can be set by adding the keyword always. Be very careful when using the always keyword. If your router advertises a default (0.0.0.0) inside the domain and does not have a default route itself or a path to reach the destinations, routing will be broken.

The third is to be in an OSPF stub area that needs a default exit, hence the default route is used.

To have OSPF generate a default route, use the following configuration command:
default-information originate [always] [metric metric-value] [metric-type type-value] [route-map map-name]

IP route 0.0.0.0 0.0.0.0 next-hop-address
Router ospf process-id
Default-information originate

The metric and metric-type are the cost and route type (E1 or E2) assigned to the default route. The route-map specifies the set of conditions that need to be satisfied in order for the default to be generated. Figure shows a sample network that demonstrates how a default route will be determined.

Referring to  Figure and assuming that Router E is injecting a default route of 0.0.0.0 into the RIP network and Router C will have a gateway of last resort of 203.250.15.2, the following is true of Routers A, C, and E:

  • Router A only knows what Router C tells it about the default route.
  • Router C sees the default route, but will not share the information with other routers until told to by the default-information originate command.
  • Router E knows a default route of 0.0.0.0.

The following router output shows that Router C knows about the default route, but it will not tell anyone else until told to do so with the default-information originate command.

Sample running-configuration after adding in the default-information originate command:

interface Ethernet0
ip address 203.250.15.67 255.255.255.192

interface Serial1
ip address 203.250.15.1 255.255.255.192

router ospf 10
edistribute rip metric 10 subnets
network 203.250.15.0 0.0.0.255 area 0
default-information originate metric 10

router rip
redistribute ospf 10 metric 2
passive-interface Ethernet0
network 203.250.15.0

Now that Router C has been configured to tell Router A about the default route, you can check Router A's routing table. You will quickly see that the default route is known by the router:

Notice that Router A has learned about 0.0.0.0 as an external route with metric of 10. The gateway of last resort is set to 203.250.15.67 as expected. Thus, its default route is the E0 interface of Router C that has a default route in Router E.

Lab Activity
  In this lab, you will learn how to inject a static default route into the entire OSPF routing domain.