Course contents

Module 6: Advanced OSPFLesson 6.4 (4 of 8 in this module)25 of 29 in the OSPF course

Beyond CCNA (optional). This topic is not on the CCNA 200-301 exam. It is useful at work and in later study; skip it if you are preparing for the exam. (Stub and NSSA areas are not in the single-area OSPFv2 objective (3.4).)

OSPF area types: stub, totally stubby and NSSA

If every outside destination uses the same branch exit, which routes does the branch really need? Let's compare a default route with detailed routes, then handle a branch that imports its own external network.

Advanced · 12 min read

A branch with one exit and many routes

Area 1 is a branch: R1 and its LANs, with one link to the ABR. R1 holds every inter-area route in the company and external routes from the partner. In this single-exit design, those destinations all use R2. Reducing unnecessary detail can lower the branch's routing state. A special area type controls which external and inter-area information enters, with a default route covering the destinations it no longer lists.

A normal area and a stub area
A normal area and a stub areaA branch with one exit does not need every external route. A stub area replaces them with one default.Normal areaAll routes and allexternal LSAsLarge table at the branchStub areaInternal and inter-arearoutes plus one defaultSmall tablevs

On small screens, swipe sideways or focus the diagram and use the arrow keys.

Smaller tables mean less memory and fewer updates at the branch.

An area groups OSPF interfaces sharing detailed topology. R2 is an area border router (ABR): it connects area 1 to backbone area 0. R4 connects area 2 to area 0. R5 imports partner routes learned through EIGRP, so it is an autonomous system boundary router (ASBR). The partner prefix is 10.50.0.0/16.

A default route, 0.0.0.0/0, matches when no more specific route matches the destination. It says where to send those packets; it does not prove that the border router has working Internet or partner access.

Which LSAs each area type lets in

A link-state advertisement (LSA) is a stored record used in route calculation. Types 1 and 2 describe routers and shared segments inside an area. Type 3 describes inter-area network reachability, including a stub default. Type 4 describes inter-area reachability to an ASBR. Type 5 describes external reachability in normal areas.

What each area type accepts
What each area type acceptsEach area type blocks a different set of LSAs.NormalLSA types 1, 2, 3, 4 and 5StubTypes 1, 2, 3 plus a default from the ABR; no 4 or 5Totally stubbyTypes 1 and 2 plus a default; no inter-area routesNSSATypes 1, 2, 3 and 7; the ABR converts 7 to 5

On small screens, swipe sideways or focus the diagram and use the arrow keys.

Type 4 and 5 are external. Type 7 exists only in an NSSA.

An NSSA (not-so-stubby area) adds type 7 records so a local ASBR can introduce external prefixes without admitting type 5 records from outside. Types 5 and 7 have related purposes but different scope and translation rules. The table covers these basic OSPFv2 route-record types, not every OSPF extension.

Area typeType 1, 2Type 3Type 4, 5Type 7Default route
NormalYesYesYesNoOnly if originated
StubYesYesBlockedNoType 3 from the ABR, automatic
Totally stubbyYesBlocked (except default)BlockedNoType 3 from the ABR, automatic
NSSAYesYesBlockedYes (local ASBR)Not automatic: configure it (type 7)
Totally NSSAYesBlocked (except default)BlockedYesType 3 from the ABR, automatic

Rules that apply to all of them:

  • Area 0 must remain normal, not stub or NSSA.
  • Neighbours must agree on normal, stub or NSSA capability. The ABR-only no-summary option does not need to appear on every router.
  • Stub and totally stubby areas can't contain an ASBR. NSSAs exist to allow one.
  • A virtual link cannot use a stub or NSSA area as its transit area.
area 1area 0area 0area 2LAN 1Subnet 172.16.1.0/24R1RID 1.1.1.1R2 (ABR)RID 2.2.2.2R3RID 3.3.3.3R4 (ABR)RID 4.4.4.4R5 (ASBR)RID 5.5.5.5Partner (EIGRP)Subnet 10.50.0.0/16

Device key: LAN 1 (network / site) · R1, R2 (ABR), R3, R4 (ABR), R5 (ASBR) (router) · Partner (EIGRP) (network / service)

Lines show the example’s network connections. Thick links: uplinks/WAN, as labelled. Read the numbered steps for traffic direction and changes.

Reading the addresses

IP labels identify interfaces or destinations. Subnet labels identify networks; /n is the prefix length. A router ID (RID) identifies a routing process and need not be a reachable interface.

An IP address alone is not a URL. A web URL includes a scheme such as https://; an address on a router or printer does not imply a website.

  • LAN 1: Subnet 172.16.1.0/24
  • R1: RID 1.1.1.1
  • R2 (ABR): RID 2.2.2.2
  • R3: RID 3.3.3.3
  • R4 (ABR): RID 4.4.4.4
  • R5 (ASBR): RID 5.5.5.5
  • Partner (EIGRP): Subnet 10.50.0.0/16
  1. 1. Stub area 1: R2 stops type 4 and 5 LSAs at the border and sends R1 a type 3 default. Totally stubby also suppresses non-default type 3 records.
  2. 2. NSSA area 2: R5 redistributes the partner's routes as type 7 LSAs, which only exist inside the NSSA.
  3. 3. R4 translates: R4 is this NSSA's translator. It creates type 5 records for eligible propagated type 7 routes, advertised by R4 into normal areas. The type 7 itself stays in area 2.
Area 1 can use R2's default for outside destinations. Area 2 uses local type 7 records for partner reachability; R4 translates eligible records for normal areas.

What you gain, and what detail you lose

A router in a branch with one exit makes the same forwarding decision for every outside destination, so the detailed routes may not change its next-hop choice. A stub area removes external detail; a totally stubby area also removes non-default inter-area detail. Changes to retained information and to the default can still reach the branch. NSSA was added later for branches that do have something external of their own, such as a local internet link or a partner, which a plain stub area would forbid.

The trade of a stub area
The trade of a stub areaSmaller tables and fewer updates cost the router the detail of what lies beyond the area.GainSmaller LSDBFewer updatesFaster SPFLoseExact external routesPer-prefix exit choiceASBRs inside the areaand

On small screens, swipe sideways or focus the diagram and use the arrow keys.

A default route reaches everything, but it cannot choose the best exit per prefix.

Turning area 1 into a stub and area 2 into an NSSA

These are Cisco IOS/IOS XE style examples, starting in global configuration mode. The five-router network must already work, with area 0 normal and outgoing costs 1. Treat stub versus NSSA as the policy for the named area, not commands to stack on the same area. A one-sided area-type change can interrupt neighbours, so use an isolated lab for this exercise.

Where each command goes
Where each command goesarea stub goes on every router in the area. no-summary goes only on the ABR.Every routerarea 1 stubABR onlyarea 1 stub no-summary(totally stubby)NSSA areaarea 2 nssaon every routerCheckshow ip ospf

On small screens, swipe sideways or focus the diagram and use the arrow keys.

The area type must match on both ends of every link in the area.

Stub

! R1 and R2 router ospf 1 area 1 stub

On every router in area 1, including the ABR. R2 then sends a default route into area 1 and stops type 4 and 5 LSAs.

Totally stubby

! R2 (ABR) only router ospf 1 area 1 stub no-summary

no-summary is only needed on the ABR; R1 keeps area 1 stub. Type 3 LSAs are now blocked too, except the default.

NSSA and totally NSSA

! R4 and R5 router ospf 1 area 2 nssa

On every router in area 2. R5 can keep redistributing the partner's routes; they become type 7 LSAs, and R4 translates them to type 5.

! R4 (ABR) router ospf 1 area 2 nssa default-information-originate

On this NSSA ABR, originate a type 7 default towards R4. A plain NSSA does not get this automatically; without another usable route, R5 cannot reach outside external destinations. Check the command's origination conditions for your platform and role.

! R4 (ABR) router ospf 1 area 2 nssa no-summary

Totally NSSA: type 3 LSAs are blocked as well, and R4 sends a type 3 default automatically.

router ospf 1 area 1 default-cost 10

R2, separate optional change: sets the type 3 stub default's advertised cost to 10. R1 adds its own link cost 1, so its route metric becomes 11. The output below retains the unchanged advertised default cost 1.

The no-summary forms shown are Cisco-style extensions. A normal NSSA default configured with default-information-originate is a type 7 external default; the automatic default with nssa no-summary is type 3. Check the route code and LSA, not just the presence of 0.0.0.0.

Spotting O*IA and N2 routes in the table

Example output · based on Cisco documentation; exact format varies by platform and software version
R1#show ip route ospf
Gateway of last resort is 10.1.12.2 to network 0.0.0.0

O*IA  0.0.0.0/0 [110/2] via 10.1.12.2, 00:02:10, GigabitEthernet0/1
      10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks
O IA     10.0.23.0/30 [110/2] via 10.1.12.2, 00:02:10, GigabitEthernet0/1
O IA     10.0.34.0/30 [110/3] via 10.1.12.2, 00:02:10, GigabitEthernet0/1
O IA     10.2.45.0/30 [110/4] via 10.1.12.2, 00:02:10, GigabitEthernet0/1
Area 1 as a stub: inter-area routes remain, the partner's O E2 10.50.0.0/16 is gone, and O*IA 0.0.0.0/0 replaces it (default cost 1 from R2 plus R1's link cost 1). As totally stubby, only the default remains for destinations outside area 1. Intra-area and directly connected routes remain as applicable.
Example output · based on Cisco documentation; exact format varies by platform and software version
R4#show ip route ospf | include 10.50
O N2     10.50.0.0/16 [110/20] via 10.2.45.2, 00:04:41, GigabitEthernet0/1
Inside the NSSA the partner route is N2 (NSSA external type 2, from a type 7 LSA). On R3 and R2 it appears as a normal O E2 route, from the type 5 that R4 created.
Example output · based on Cisco documentation; exact format varies by platform and software version
R4#show ip ospf | include BACKBONE|Area 2|NSSA area|translation
    Area BACKBONE(0)
    Area 2
        It is a NSSA area
        Perform type-7/type-5 LSA translation
R4 confirms area 2 is an NSSA and that it is the translator.
show ip ospf database nssa-external

Lists the type 7 LSAs inside the NSSA, created by R5.

In a design with multiple NSSA ABRs, translation is selected according to translator rules; do not assume every ABR translates every type 7. A propagated type 7 normally supplies a non-zero forwarding address that the rest of OSPF must be able to reach internally. Summarisation or filtering must preserve the reachability needed by the translated route.

Route codes in these areas
Route codes in these areasThe code tells you where a route came from.O*IA 0.0.0.0/0Default route injected by the ABR (stub area)O IAInter-area route learned through a type 3 LSAO N2External route from an NSSA (type 7), metric type 2O E2External route from a type 5 LSA

On small screens, swipe sideways or focus the diagram and use the arrow keys.

A default marked O*IA comes from the ABR as an inter-area summary.

Lost neighbours and missing defaults

In practice, the first symptom of a half-finished stub change is a neighbour going down the moment the ABR is changed. Configure the branch router and the ABR in the same maintenance window.

Why a stub area misbehaves
Why a stub area misbehavesStub flags in the hello must match, and the default needs the ABR to be configured for it.Stub area problemsNeighbours lostStub or NSSA flagdiffers between the endsNo defaultABR not injecting itor no-summary missingASBR in a stubNot allowed: use NSSAinstead

On small screens, swipe sideways or focus the diagram and use the arrow keys.

Check the neighbour table before the routing table.
  • Adjacency lost after configuring a stub. Only one router in the area was changed. The stub flag in the hellos no longer matches.
  • Redistribution stopped working after the area became a stub: stub areas can't contain an ASBR. Use an NSSA.
  • The NSSA has no default route. NSSAs don't get one automatically; add default-information-originate to area X nssa on the ABR, or use totally NSSA.
  • Inter-area routes still present in a "totally stubby" area. no-summary was put on an internal router instead of the ABR.

Where stub and NSSA setups usually break

  • Configuring the area type on the ABR only.
  • Putting no-summary on every router; it only has an effect on the ABR.
  • Expecting type 7 LSAs outside the NSSA. The ABR translates them to type 5.
  • Area 0 configured as a stub, which IOS doesn't allow.

Area types at a glance

Rules to remember for special areas
  • Stub: no type 4/5, automatic default. Totally stubby: also no type 3 (Cisco, no-summary on the ABR).
  • NSSA: no outside externals, but a local ASBR uses type 7, translated to type 5 by the ABR.
  • NSSA default route is not automatic; totally NSSA's is.
  • Every router in the area must agree on its type; area 0 can't be special.

Short lab: compare stub and totally stubby

Record R1's routes with normal area 1. Configure area 1 stub on both R1 and R2. After Full returns, R1 should retain inter-area networks, lose the partner's explicit external route and learn O*IA 0.0.0.0/0 through R2.

show ip ospf neighbor show ip ospf database show ip route ospf

R1, privileged EXEC. Compare adjacency health, the LSA sections and installed route codes after each planned change. With unmodified cost 1 on the link and default, the default route metric is 2.

Add area 1 stub no-summary on R2 only. Confirm that non-default O IA routes disappear while the default remains. R1's connected LANs do not disappear. Restore R2 with no area 1 stub no-summary and then area 1 stub, and verify ordinary stub behaviour returns before saving. This lab leaves area 2 unchanged.

Sources: Cisco NSSA configuration; Cisco special areas and virtual links; RFC 3101 NSSA translation. Outputs are illustrative, not captures from a tested router image.

Test yourself on stub and NSSA areas

Predict · scenario 1

Area 1 becomes totally stubby. Which OSPF route information does R1 keep for destinations outside its area?

Predict · scenario 2

R5 must keep redistributing the partner's routes, but area 2 should not receive other external routes. Which area type?

Predict · scenario 3

You configure area 1 stub on R2 only. What happens to the R1–R2 adjacency?

FAQ

Why must every router in a stub area be configured?
The stub setting is carried in every hello (the E-bit in the options field). Routers that disagree on whether an area is a stub don't become neighbours.
Can area 0 be a stub area?
No. Area 0 is the backbone and must remain a normal area. It carries the normal backbone topology and inter-area/external reachability needed by the design. This does not mean every LSA type travels through it: type 7 records stay inside their NSSA and eligible routes are translated at the boundary.
Why doesn't an NSSA get a default route automatically?
An NSSA may have its own exit (the local ASBR), so IOS doesn't assume the ABR is the way out. You add one with area X nssa default-information-originate. Totally NSSA areas do get one automatically, because their inter-area routes are removed and they need a way out.