Saturday, January 7, 2012

OSPF Default Route

OSPF generates and advertises default route ( varies upon the OSPF area types that the default route is being advertised into – a standard area, stubby area, totally-stubby area, NSSA, or totally-stubby NSSA.

By default, OSPF routers in standard areas do not generate default routes into OSPF domains. The default-information originate [always] [metric metric] [metric-type metric-type] [route-map map] OSPF router subcommand configures an OSPF router to become an ASBR and generates an External Type-2 (E2) default route with as the Link-State ID and Network Mask, with 1 as the default metric value. It is recommended to advertise OSPF default routes as E2 routes, in which the internal cost or metric towards the ASBR will not be considered when comparing E2 routes. This is important when implementing a primary-backup default routing setup, as the internal cost or metric towards the ASBR will not affect the route selection.
Note: The Cisco IOS Command Reference for the default-information originate command mentions that the default metric value is 10, while testing shows that it is actually 1.

If the ASBR has a default route in its routing table, the default route can be redistributed into the OSPF routing domain with the default-information originate OSPF router subcommand. If the ASBR does not have a default route in its routing table, the always keyword can be added to the default-information originate command to redistribute a default route into the OSPF routing domain regardless of whether the router has a default route in its routing table.

Another benefit of the always keyword is that it can add stability to the OSPF routing domain, in which an OSPF router will always advertise a default route regardless of the stability of the default route that could be learnt through other routing domains.

Whether to use the always keyword is depends upon the design of the network.
Ex: When an OSPF router has a non-OSPF external default route (static or dynamically-learnt) towards the Internet, it should advertise the default route only when it has the default route itself. Otherwise it could attract and blackhole the traffic from other routers.

Note: Configure a static default route with the ip route {gateway} global configuration command and try to redistribute the static route into an OSPF domain with the redistribute static subnets OSPF router command is unable to generate a default route!
Note: The default route selected using the ip default-network global configuration command is not propagated by OSPF.

OSPF Default Route on Standard OSPF Area

Below shows the routing table on RT3:
RT3#sh ip route

Gateway of last resort is to network is subnetted, 1 subnets
O IA [110/128] via, 00:00:01, Serial0/0 is subnetted, 1 subnets
C is directly connected, Serial0/0
O*E2 [110/1] via, 00:00:01, Serial0/0

In stubby and totally stubby areas, the ABR of the stub area generates a Type-3 Network-Summary-LSA with Link-State ID and Network Mask of into the stub area. The ABR does not need to have a default route in its routing table; and it does not require the default-information originate OSPF router subcommand to be configured as well.

The ABR of an NSSA does not generate a default route by default. The area {area-id}nssa default-information-originate [metric metric] [metric-type metric-type] must be configured on the ABR to generate a Type-7 NSSA-External-LSA with Link-State ID and Network Mask of into the NSSA.

Another way to generate a default route into an NSSA is the area {area-idnssa no-summary OSPF router subcommand. As such, the NSSA becomes a totally stubby NSSA. The default route is automatically generated by an NSSA ABR into the totally stubby NSSA as a Type-3 Network-Summary-LSA without the default-information-originate keyword of the area {area-id} nssa OSPF router subcommand.

When a stub area has multiple ABRs (or exit points), it is important to ensure the stub routers select the desired ABR to reach the networks outside the stub area. The default route metrics should be identical on all ABRs when the stub routers are allowed to choose the closest ABR; while the ABRs should have different default route metrics (configured with the area {area-id} default-cost {cost} router subcommand) when implementing a primary-backup ABRs setup.

No comments:

Post a Comment