By default OSPF does not propagate a default route, and so you need to manually tell OSPF to distribute one from your Autonomous System Border Router (ASBR).
Depending on the type of Area you have employed in your network the way you propagate a default to all your routers will differ slightly.
In Normal Areas (OSPF areas all connected to Area 0) you can do the following:
1) On your ASBR apply a default route:
R1(config)#ip route 0.0.0.0 0.0.0.0 10.1.1.1
2) Inject the default route in to OSPF:
R1(config)#router ospf 1
R1(config-router)#default-information originate [always]
- The [always] option allows you to advertise a default route from the ASBR even when one doesn't actually exist. This can potentially result in better stability for your network. For example, if a default route is learned from a different routing protocol such as RIP and this route for what ever reason starts to flap then every time the route changes type 5 LSA's will be sent into the OSPF domain from the ASBR.
- The [always] option helps prevent actions outside of the OSPF domain from affecting the routers/routes within the OSPF domain.
For Stub and Totally Stub areas the situation is different.
On an ABR you configure an area to be a stub. This in turn prevents type 5 LSA's (external route information) from being sent in to the stub area and in return a default summary route is propagated.
In a Totally Stubby area, this goes a step further. By configuring an area as a Totally Stubby area on the ABR you prevent Type 5 LSA's (for external routes) plus Type 4 and Type 3 LSA's (for inter-area summary routes) from being propogated. A default summary route replaces these types of routes.
In both cases, as a default route is automatically generated at the ABR, you do not require the default-information originate command.
Finally you have Not-So-Stubby-Area's (NSSA)
There are 2 ways to advertise a default route. NSSA ABR can generate a default route with or without a default route in its own routing table.
1) On the ABR connecting Area 0 to the NSSA area you force the ABR to generate a default route:
R3(config)#router ospf 1
R3(config-router)#area 8 nssa default-information originate
-With this example the ABR generates Type 7 LSA's with a link state ID of 0.0.0.0 this is then advertised within the NSSA area
- NOTE - NSSA ASBR can generate a default only when it has a default route in its routing table
- The default route via the ASBR must be known through non-OSPF protocol
2) You can also use the 'no-summary' option when defining your NSSA area and create 'NSSA Totally Stub area':
R3(config)#router ospf 1
R3(config-router)#area 8 nssa no-summary
-In this example you are replacing the Type 3,4,(inter-area summary routes) and Type 5 LSA's(external summary routes) with a default summary route.This is just as you do for a Totally Stubby area.