OSPF Conditional and Reliable Conditional Default Routing

In the previous post, we learned how to configure OSPF default routing and the rules that apply to its configuration.

Today we will discuss the enhancements that can be applied to OSPF Default Routing.

Ok, so far we know that the “default-information originate” command is used to generate a default route into the OSPF domain.    If the default route is not present in the routing table, then it won’t be generated.  However, we can modify this behavior by adding the “always” keyword at the end of the command.

Now, there are situations when is required generating the default route only if a condition matches specific criteria.   There is where OSPF Conditional Default Routing enters to play.

Let’s use the following topology for the examples:

OSPF-CONDITIONAL-DR-01

Here you can download the diagram and configuration files:  OSPF-Default Routing II

OSPF Conditional Default Routing:

OSPF Conditional Default Routing is configured by adding a pre-defined route-map with the desired conditions to the default-information originate command in the OSPF process definition.

By using route map its possible defining matching conditions such as:

  • Match if a specific ip address or prefix is present in the routing table.
  • Match if the source of a specific ip address or prefix is a specific ip address or interface.
  • Match if the source protocol of a specific address or prefix is an IGP or static route or connected.
  • Match if the route type is external (E1/E2), internal (Intra/inter-area), nssa-external or locally originated.
  • Match the metric value of a specific address or prefix with a specified value.

Combinations of the conditions described above are also possible.

Ok, time for the examples.

First, let’s take a look to the routing table in the OSPF domain:

OSPF-CONDITIONAL-DR-02

OSPF-CONDITIONAL-DR-03

OSPF-CONDITIONAL-DR-04

As can be seen in the above outputs, R1 has routes from R2 and R3.  It also has the route 4.4.4.4/32 redistributed from EIGRP.   The routers R2 and R3 are receiving the default route generated by R1.   Both routers also have the external routes redistributed from EIGRP.

Goal 1:

Configure OSPF default routing in such way that R2 and R3 receive the default route from R1 only if the route 4.4.4.4/32 is present in the routing table.

Let’s proceed with the configuration:

In R1:

!
ip prefix-list L0-R4 seq 5 permit 4.4.4.4/32
!
route-map CONDITIONAL-DEFAULT permit 10
match ip address prefix-list L0-R4
!
router ospf 1
default-information originate always route-map CONDITIONAL-DEFAULT
exit
!

The above configuration permits the default route to be originated in OSPF only if the route 4.4.4.4/32 is present in the routing table.

Because the prefix 4.4.4.4/32 currently exists in R1’s routing table, then the default route is generated.

Now, let’s stop the advertising of the Loopback 0 in R4 and check the routing table in R2 to verify if the condition works.

In R4:

!
router eigrp 100
no network 4.4.4.4 0.0.0.0
exit
!

OSPF-CONDITIONAL-DR-05

As can be seen in the above output, now the default route is no longer present in the routing table.

Goal 2:

  1. Configure a static default route in R1 pointing to R4.
  2. Configure OSPF default routing in such way that R2 and R3 receive the default route from R1 only if the link to R4 is up.

First, let’s clear the previous configuration in R1 and create the static default route.

In R1:

!
router ospf 1
no default-information originate
default-information originate
exit
!
no ip prefix-list L0-R4 seq 5 permit 4.4.4.4/32
no route-map CONDITIONAL-DEFAULT permit 10
!
ip route 0.0.0.0 0.0.0.0 192.168.14.2
!

Now, to verify if the interface is in UP/UP status, what can be done is check if the “Connected” route is in the routing table.   If a Layer 2 failure occurs with the connection to R4, then the connected route is removed from the routing table.

OSPF-CONDITIONAL-DR-06

Let’s configure the condition:

In R1:

!
ip access-list standard ETH-01-UP
permit 192.168.14.0 0.0.0.255
exit
!
route-map CONDITIONAL-DEFAULT permit 10
match ip address prefix-list L0-R4
exit
!
router ospf 1
default-information originate route-map CONDITIONAL-DEFAULT
exit
!

The above configuration permits the default route to be originated in OSPF only if the connected route 192.168.14.0/24 is present in the routing table.  If there is a Layer 2 failure, then the default route won’t be generated.

To test the above configuration I’ll disconnect the cable connecting to R2 and then I’ll check the routing tables in R1 and R2 respectively.

OSPF-CONDITIONAL-DR-07

OSPF-CONDITIONAL-DR-08

As can be seen in the output, as soon the interface in R1 was disconnected from R1, “connected” route 192.168.14.0/24 was removed from its routing table.   This means that the condition configured before does not match the requirements anymore.  Thus, the default route is no longer advertised to R2 and R3.

Pretty cool, huh?   The configuration worked as expected in this situation.

Now, what if is not a Layer 2 failure?  In other words, let’s say the interface remains up but there is no connectivity to the desired destination through it?

Well, in this type of situations is where Reliable Conditional Default Routing enters to play.

OSPF Reliable Conditional Default Routing:

OSPF Reliable Conditional Default Routing this is achieved through the combination of Conditional Default Routing and Cisco IP SLA with Enhanced Object Tracking (EOT).

Goal 3:

Configure OSPF default routing in such way that R2 and R3 receive the default route from R1 only if there is end-to-end reachability to R4.

Let’s start by removing the previous configuration in R1.

In R1:

!
router ospf 1
no default-information originate
default-information originate
exit
!
no ip access-list standard ETH-01-UP
no route-map CONDITIONAL-DEFAULT permit 10
no ip route 0.0.0.0 0.0.0.0 192.168.14.2
!

Ok, the next step is configuring the IP SLA.

In R1:

!
ip sla 1
icmp-echo 192.168.14.2
threshold 3000
timeout 4000
frequency 5
exit
!
ip sla schedule 1 life forever start-time now
!

The above configuration created the ip sla entry 1, which will send icmp packets every 5 seconds to the ip address 192.168.14.2 (interface Ethernet0/1 of R4) with a threshold of 3 seconds and timeout of 4 seconds.  The scheduling has enabled the ip sla entry 1 with no expiration.

The next step is configuring the Enhanced Object Tracking.

In R1:

!
track 1 ip sla 1 reachability
!

Let’s stop here and take a look to the IP SLA and the Enhanced Object Tracking status.

OSPF-CONDITIONAL-DR-09

OSPF-CONDITIONAL-DR-10

As can be seen in the above outputs, the IP SLA is working and returning success operation.   Also, the Enhanced Object Tracking is returning “UP” reachability status.

Let’s continue.

Now that we have the IP SLA and the Enhanced Object tracking configured, we have to create the condition.

Now, for the condition to work, we will need something to match. Right?

The next step is configuring a placeholder to create a prefix in the routing table and use the enhanced object tracking to validate this route.

In R1:

!
ip route 169.255.0.4 255.255.255.255 Null0 track 1
!

The above configuration created a default route for the ip address 169.255.0.4 (link-local RFC 6890) pointing to the trash can.   The track 1 command forces the route to remain valid while the enhanced object tracking returns reachability UP.

OSPF-CONDITIONAL-DR-11

As can be seen in the above output, the placeholder is working.   The prefix 169.255.0.4/32 is present in the routing table because the enhanced object tracking is returning UP status.

Let’s shut down the interface Ethernet0/1 in R4 and let’s take a look at the routing table again.

In R4:

!
interface Ethernet0/1
shutdown
exit
!

OSPF-CONDITIONAL-DR-12

As can be seen in the above output, the enhanced object tracking changed the status to Down, also, the prefix 169.255.0.0/32 was removed from the routing table.

Let’s enable back the interface in R4.

In R4:

!
interface Ethernet0/1
no shutdown
exit
!

OSPF-CONDITIONAL-DR-13

As can be seen in the above output, the placeholder is working as expected.

Now we have to configure the route-map and attach it to the default-information originate command.

In R1:

!
ip prefix-list PLACEHOLDER seq 5 permit 169.255.0.4/32
!
route-map R-C-DEFAULT permit 10
match ip address prefix-list PLACEHOLDER
!
router ospf 1
default-information originate always route-map R-C-DEFAULT
exit
!

The above configuration permits the default route to be generated if the prefix 169.255.0.4/32 (Placeholder) is present in the routing table.   The always keyword was used because the default route was not present in the routing table.

Finally, let’s shut down again the interface Ethernet 0/1 in R4 and check the routing table in R2:

In R4:

!
interface Ethernet0/1
shutdown
exit
!

OSPF-CONDITIONAL-DR-14

As can be seen in the above output, after the interface was disabled in R4, the default route was removed in R2.    The OSPF Reliable Conditional Default Routing was properly configured.

It is time to close this long post.  In the next one, we will discuss OSPF Stub Router Advertisement.

Thank you for visiting.

OSPF Default Routing

 

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:

OSPF-DEFAULT-ROUTING-01

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:

OSPF-DEFAULT-ROUTING-02

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:

OSPF-DEFAULT-ROUTING-03

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:

OSPF-DEFAULT-ROUTING-04

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:

OSPF-DEFAULT-ROUTING-05

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:

OSPF-DEFAULT-ROUTING-06

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:

OSPF-DEFAULT-ROUTING-07

It is time to close this post.  In the next one, we will discuss OSPF Conditional Default Routing.

Thank you for visiting.