A stub area is a non-transit area. In other words, an area that does not originate or propagate external routes. AS-external-LSAs are not flooded into the stub area; routing to AS external networks is based on a single per-area default route. This reduces the link-state-database size and memory requirements for routers within stub areas.
Handy for reducing routing table size, a stub area is a “dead-end” in which there is no other way to enter or exit except through an Area Border Router (ABR). No ASE (Autonomous System External) or NSSA routes are permitted in a stub area. Each router in a stub area must specify that they are members of the stub area. When specifying that the ABR is a member of the stub area, the ABR will inject a default route into the area.
Routing to external designations from stub areas is based on a default route injected by a stub area‘s ABR. A default route is automatically created by the stub area‘s ABR. This default route is injected into the stub area to enable other stub routers within the stub area to reach any external routes that are no longer inserted into the stub area.
A stub area can be configured such that the ABR is prevented from sending type 3 summary LSAs into the stub area using the no-summary option. In this case, all destinations outside of the stub area are represented by means of a default route.
There are a couple of restrictions on the use of stub areas. Virtual-links cannot be configured through stub areas, and AS boundary routers cannot be placed internal to stub areas.
Use the area stub command in OSPF router configuration command mode to configure an area as a stub.
A cost value can be set for the default route that is sent into a stub area by an ABR. Configuration of the stub area default route cost is restricted to the ABR attached to this stub area.
Use the area default-cost command in OSPF router configuration command mode on the ABR attached to this stub area to configure the stub area default route cost.
Every router in Areas 1 and 2 are configured for a stub area (Routers 1, 2, and 3 for Area 1 and Routers 5, 6, 7, and 8 for Area 2). Additionally, ABR routers 3, 5, and 6 are also configured with a default-cost to be assigned to the stub area. Router 5 has a lower metric cost when compared to Router 6, so Router 5 will be the preferred router for packets to access the area, with Router 6 employed as a backup in case Router 5 fails. The following example provides the input required to configure the stub topology as displayed in OSPF Stub Area Topology:
Router1(rw-config)->router ospf 1 Router1(rw-config-ospf-1)->area 1 stub
Router2(rw-config)->router ospf 1 Router2(rw-config-ospf-1)->area 1 stub
Router3(rw-config)->router ospf 1 Router3(rw-config-ospf-1)->area 1 stub Router3(rw-config-ospf-1)->area 1 default-cost 15
Router5(rw-config)->router ospf 1 Router5(rw-config-ospf-1)->area 2 stub Router3(rw-config-ospf-1)->area 2 default-cost 15
Router6(rw-config)->router ospf 1 Router6(rw-config-ospf-1)->area 2 stub Router6(rw-config-ospf-1)->area 2 default-cost 20
Router7(rw-config)->router ospf 1 Router7(rw-config-ospf-1)->area 2 stub
Router8(rw-config)->router ospf 1 Router8(rw-config-ospf-1)->area 2 stub