Example

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:

Router 1

Router1(rw-config)->router ospf 1
Router1(rw-config-ospf-1)->area 1 stub

Router 2

Router2(rw-config)->router ospf 1
Router2(rw-config-ospf-1)->area 1 stub

Router 3

Router3(rw-config)->router ospf 1
Router3(rw-config-ospf-1)->area 1 stub
Router3(rw-config-ospf-1)->area 1 default-cost 15

Router 5

Router5(rw-config)->router ospf 1
Router5(rw-config-ospf-1)->area 2 stub
Router3(rw-config-ospf-1)->area 2 default-cost 15

Router 6

Router6(rw-config)->router ospf 1
Router6(rw-config-ospf-1)->area 2 stub
Router6(rw-config-ospf-1)->area 2 default-cost 20

Router 7

Router7(rw-config)->router ospf 1
Router7(rw-config-ospf-1)->area 2 stub

Router 8

Router8(rw-config)->router ospf 1
Router8(rw-config-ospf-1)->area 2 stub