In today’s post, we will discuss the different ways in which OSPF generates the default oute.
Long story short, it depends on the type of area where we want to generate or advertise the default route.
Let’s get started by describing how to generate and advertise the default route per area and the rules that must be followed if any. Maybe it would be a good idea to check out the post OSPF Areas and Area Types for better understanding.
Normal Areas:
The default route is not advertised by default in normal areas, even if one exists in the routing table. The way to generate the default route in normal areas is by using the default-information originate {always} {metric [value]} {metric-type [type-value]} {route-map [map-name]} command in the OSPF process definition.
As a rule, the default-information originate command will advertise the default route only if it exists in the routing table. If we don’t have a default route configured, then the keyword always can be added to override this rule.
Another way to override this rule is by creating a default route pointing to the null0 interface. Thus, the default route will be installed in the routing table.
With the keywords metric and metric-type, it’s possible specifying the metric and the metric-type of the default route. The default metric is 1 and the default metric type is 2.
The keyword route-map is used to extend the capabilities of default routing by the use conditions or adding reliability mechanisms into it.
In this type of areas, the LSA generated for the default route is Type-5.
Stub and Totally Stub Areas:
In this type of areas, the ABR automatically generates a summary LSA (type-3) with the default route. In this area types, is not necessary to use the default-information originate command.
NSSA Areas:
In NSSA, the default route is not advertised by default. The way to generate the default route in NSSA is by adding the default-information originate {metric [value]} {metric-type [type-value]} {nssa-only} command at the end of the NSSA definition in the OSPF process definition.
In NSSA, the default-information originate command will advertise the default route to the NSSA area regardless if the route exists or not in the routing table only if is configured in the ABR connecting to the NSSA. This is not the case for internal NSSA routers (non-ABR/ASBR) which requires the default route present.
If OSPF default routing is enabled in an internal NSSA router, it will generate a Type-7 LSA corresponding to the default route, and then the Type-7 LSA will be translated into a Type-5 LSA by the ABR or the elected Type-7/5 translator and then flooded to the rest of the OSPF domain. To suppress the propagation of the default route beyond the ABR, the keyword nssa-only must be used.
With the keywords metric and metric-type, it’s possible specifying the metric and the metric-type of the default route. The default metric is 1 and the default metric type is 2.
In this type of areas, the LSA generated for the default route is Type-7.
Totally NSSA:
In this type of areas, as in stub and totally stubby areas, the ABR automatically generates a summary LSA (type-3) with the default route. In this area types, is not necessary to use the default-information originate command.
One last thing I should mention is that generating the default route in Normal or Not-So-Stubby Areas, will turn the router into an ASBR.
Let’s use the following topology for the examples:
Here you can download the diagram and configuration files: OSPF-Default Routing
Example #1:
Configure OSPF default routing in such way that R4 and R5 receive the default route from R1 with a metric of 20.
The configuration in R1 doesn’t have any default route configured at this moment; therefore, it can be done in two ways:
The first one is adding the keyword always when generating the default route.
In R1:
!
router ospf 1
default-information originate always metric 20
exit
!
Let’s take a look to the routing table of R4 and to the LSDB:
As can be seen in the above output, the route was generated by R1 as External Type-2 with a Metric of 20. External Type-2 routes are the ones where the cost is equal to the cost from the ABR (R1 ABR/ASBR in this case) to the prefix destination. External Type-1 routes are the ones where the cost is additive. In other words, it’s the cost to reach the ABR from the source, plus the cost from the ABR/ASBR to the prefix destination.
The second way to do this is by creating a default route pointing to null and then generate the default route.
First, let’s remove the previous command.
In R1:
!
router ospf 1
no default-information originate
exit
!
Now let’s configure a default route and advertise it into OSPF. (To demonstrate the change, I will not alter the metric.)
In R1:
!
ip route 0.0.0.0 0.0.0.0 null0
!
router ospf 1
default-information originate
exit
!
Let’s check again the routing table of R4 and the LSDB:
As can be seen in the above output, the default route was generated by R1 as External Type-2 with a Metric of 1, which is the cost from R1 (ABR/ASBR) to its Null0 interface.
Example #2:
Configure OSPF default routing in R2 and advertise the default route to the entire OSPF domain.
Ok, first let’s clear the previous configuration.
In R1:
!
no ip route 0.0.0.0 0.0.0.0 null0
!
router ospf 1
no default-information originate
exit
!
Let’s apply the configuration:
In R2:
!
ip route 0.0.0.0 0.0.0.0 null0
!
router ospf 1
area 123 nssa default-information-originate
exit
!
Let’s take a look to the routing table of R1 and to the LSDB:
As can be seen in the above output, the default route was advertised by R2. Also, note R2 generated a Type-7 LSA for the advertised default route; the ABR (R1) then generated a Type-5 LSA and flooded to the rest of the OSPF domain. Therefore, the default route will be also present in R4 and R5.
To confirm this, let’s take a look at the routing table in R5:
Ok, it worked, but what if the requirement includes that the default route should be advertised only within the NSSA area?
In this case, just add the keyword nssa-only to the previous configuration.
In R2:
!
router ospf 1
area 123 nssa default-information-originate nssa-only
exit
!
Let’s take a look again at the routing table in R5:
What happened here was that when R2 generate the Type-7 LSA was without the P-bit set. Therefore, the translation did not take place in R1 (ABR), as can be seen in the next output:
It is time to close this post. In the next one, we will discuss OSPF Conditional Default Routing.
Thank you for visiting.