Stub Areas

OSPF allows certain areas to be configured as stub areas. External networks, such as those redistributed from other protocols into OSPF, are not allowed to be flooded into a stub area. Routing from these areas to the outside world is based on a default route. Configuring a stub area reduces the topological database size inside an area and reduces the memory requirements of routers inside that area.

An area could be qualified a stub when there is a single exit point from that area or if routing to outside of the area does not have to take an optimal path. The latter description is just an indication that a stub area that has multiple exit points, will have one or more area border routers injecting a default into that area. Routing to the outside world could take a sub-optimal path in reaching the destination by going out of the area via an exit point which is farther to the destination than other exit points.

Other stub area restrictions are that a stub area cannot be used as a transit area for virtual links. Also, an ASBR cannot be internal to a stub area. These restrictions are made because a stub area is mainly configured not to carry external routes and any of the above situations cause external links to be injected in that area. The backbone, of course, cannot be configured as stub.

All OSPF routers inside a stub area have to be configured as stub routers. This is because whenever an area is configured as stub, all interfaces that belong to that area will start exchanging Hello packets with a flag that indicates that the interface is stub. Actually this is just a bit in the Hello packet (E bit) that gets set to 0. All routers that have a common segment have to agree on that flag. If they don't, then they will not become neighbors and routing will not take effect.

An extension to stub areas is what is called "totally stubby areas". Cisco indicates this by adding a "no-summary" keyword to the stub area configuration. A totally stubby area is one that blocks external routes and summary routes (inter-area routes) from going into the area. This way, intra-area routes and the default of 0.0.0.0 are the only routes injected into that area.

The command that configures an area as stub is: area <area-id> stub [no-summary]

and the command that configures a default-cost into an area is: area area-id default-cost cost

If the cost is not set using the above command, a cost of 1 will be advertised by the ABR.

Example:

Stub Command Ospf

128.213.

128.213.64-95

Assume that area 2 is to be configured as a stub area. The following example will show the routing table of RTE before and after configuring area 2 as stub.

RTC#

interface Ethernet 0 ip address 203.250.14.1 255.255.255.0

interface Serial1 ip address 203.250.15.1 255.255.255.252

router ospf 10 network 203.250.15.0 0.0.0.255 area 2 network 203.250.14.0 0.0.0.255 area 0

RTE#sh ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default

Gateway of last resort is not set

203.250.15.0 255.255.255.252 is subnetted, 1 subnets C 203.250.15.0 is directly connected, Serial0

O IA 203.250.14.0 [110/74] via 2 03.250.15.1, 00:06:31, Serial0

128.213.0.0 is variably subnetted, 2 subnets, 2 masks O E2 128.213.64.0 255.255.192.0

[110/10] via 203.250.15.1, 00:00:29, Serial0 O IA 128.213.63.0 255.255.255.252

[110/84] via 203.250.15.1, 00:03:57, Serial0 131.108.0.0 255.255.255.240 is subnetted, 1 subnets O 131.108.79.208 [110/74] via 203.250.15.1, 00:00:10, Serial0

RTE has learned the inter-area routes (O IA) 203.250.14.0 and 128.213.63.0 and it has learned the intra-area route (O) 131.108.79.208 and the external route (O E2) 128.213.64.0.

If we configure area 2 as stub, we need to do the following:

RTC#

interface Ethernet 0 ip address 203.250.14.1 255.255.255.0

interface Serial1 ip address 203.250.15.1 255.255.255.252

router ospf 10 network 203.250.15.0 0.0.0.255 area 2 network 203.250.14.0 0.0.0.255 area 0 area 2 stub

RTE#

interface Ethernet0 ip address 203.250.14.2 255.255.255.0

interface Ethernet1 ip address 131.108.79.209 255.255.255.240

interface Serial1

ip address 203.250.15.1 255.255.255.252 router ospf 10 network 203.250.15.0 0.0.0.255 area 2 network 203.250.14.0 0.0.0.255 area 0 network 131.108.0.0 0.0.255.255 area 2 area 2 stub

Note that the stub command is configured on RTE also, otherwise RTE will never become a neighbor to RTC. The default cost was not set, so RTC will advertise 0.0.0.0 to RTE with a metric of 1.

RTE#sh ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default

Gateway of last resort is 203.250.15.1 to network 0.0.0.0

203.250.15.0 255.255.255.252 is subnetted, 1 subnets C 203.250.15.0 is directly connected, Serial0

O IA 203.250.14.0 [110/74] via 2 03.250.15.1, 00:26:58, Serial0

128.213.0.0 255.255.255.252 is subnetted, 1 subnets O IA 128.213.63.0 [110/84] via 203.250.15.1, 00:26:59, Serial0

131.108.0.0 255.255.255.240 is subnetted, 1 subnets O 131.108.79.208 [110/74] via 203.250.15.1, 00:26:59, Serial0

O*IA 0.0.0.0 0.0.0.0 [110/65] via 203.250.15.1, 00:26:59, Serial0

Note that all the routes show up except the external routes which were replaced by a default route of 0.0.0.0. The cost of the route happened to be 65 (64 for a T1 line + 1 advertised by RTC).

We will now configure area 2 to be totally stubby, and change the default cost of 0.0.0.0 to 10.

RTC#

interface Ethernet 0 ip address 203.250.14.1 255.255.255.0

interface Serial1 ip address 203.250.15.1 255.255.255.252

router ospf 10 network 203.250.15.0 0.0.0.255 area 2 network 203.250.14.0 0.0.0.255 area 0 area 2 stub no-summary

RTE#sh ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default

Gateway of last resort is not set

203.250.15.0 255.255.255.252 is subnetted, 1 subnets C 203.250.15.0 is directly connected, Serial0

131.108.0.0 255.255.255.240 is subnetted, 1 subnets O 131.108.79.208 [110/74] via 203.250.15.1, 00:31:27, Serial0

O*IA 0.0.0.0 0.0.0.0 [110/74] via 203.250.15.1, 00:00:00, Serial0

Note that the only routes that show up are the intra-area routes (O) and the default-route 0.0.0.0. The external and inter-area routes have been blocked. The cost of the default route is now 74 (64 for a T1 line + 10 advertised by RTC). No configuration is needed on RTE in this case. The area is already stub, and the no-summary command does not affect the Hello packet at all as the stub command does.

Continue reading here: Redistributing routes into OSPF

Was this article helpful?

0 -2