OSPF MASTERCLASS · CHAPTER 7

Virtual link, stub areas and NSSA in the lab

An isolated area that sees the domain again, a routing table that shrinks and external routes that change their name as they cross the ABR.

15 min readVideos: Day 2, parts 4 and 5Level: intermediate

From point A to point B

Point A: you know the theory of LSAs and stub areas, but you haven't seen it work in a network with several areas. Point B: by the end of this chapter you'll reconnect an isolated area with a virtual link, shrink a routing table with two commands and follow an external route from the ASBR to the last router in the domain.

Area 40 lives in isolation

The Day 2 topology has four areas. Area 0 joins R1 and R2. Area 32 joins R1, R7 and R8. Behind R8 sits area 40: R9, R10 and R11 on a switch, 10.10.10.0/24. Behind R2 sits R3, in the area the diagram calls 50 and the configuration calls area 10. R3 is the ASBR toward EIGRP.

Day 2 lab: area 40 hangs off area 32, not area 0 From left to right: R8, the ABR between area 32 and area 40; R7, in area 32; R1, the ABR between area 32 and area 0; R2, the ABR between area 0 and the area called 50 in the diagram and configured as area 10; R3, the ASBR in that area; and R4, in EIGRP 100. Links: R8 to R7 20.20.20.0/24 and R7 to R1 30.30.30.0/24 in area 32; R1 to R2 40.40.40.0/24 in area 0; R2 to R3 50.50.50.0/24, Frame Relay, in area 10, later an NSSA; R3 to R4 70.70.70.0/24 in EIGRP. R4 has loopbacks 150.150.150.150/24, 160.160.160.160/24 and 170.170.170.170/24. Below R8, area 40 connects R9, R10 and R11 through switch SW1 on 10.10.10.0/24; it becomes stub and then totally stubby. Area 40 does not touch area 0, so a virtual link between R8 and R1, router IDs 0.0.0.8 and 0.0.0.1, crosses transit area 32. AREA 32 AREA 0 AREA 10 · NSSA EIGRP (“area 50” in the diagram) R8 · ABR RID 0.0.0.8 R7 area 32 R1 · ABR RID 0.0.0.1 R2 · ABR RID 0.0.0.2 R3 · ASBR RID 0.0.0.3 R4 EIGRP 100 20.20.20.0/24 30.30.30.0/24 40.40.40.0/24 50.50.50.0/24 70.70.70.0/24 virtual link · transit area 32 area 32 virtual-link 0.0.0.1 ↔ 0.0.0.8 SW1 10.10.10.0/24 R9 area 40 R10 area 40 R11 area 40 AREA 40 · STUB → TOTALLY STUBBY R8 Gi0/1 · all four routers need: area 40 stub R4 LOOPBACKS 150.150.150.150/24 160.160.160.160/24 · 170.170.170.170/24

Area 40 hangs off area 32, not area 0: it needs a virtual link between R8 and R1. Diagram: The House of Routing.

R8 has the full LSDB of area 32 and the type 3 LSAs from the other areas. But on R11, show ip route only shows its loopback and show ip ospf database only shows area 40. R9 and R10 see the same: every router in an area shares the LSDB. The problem is the design: every area must touch area 0, and area 40 only touches area 32.

External routes: LSA 5 and LSA 4

Before filtering, you need external routes. On R3, Jesús brings up the interface toward R4 and EIGRP comes back: 150.150.150.0/24, 160.160.160.0/24 and 170.170.170.0/24 show up as D routes. R3 was already redistributing them into OSPF; to see them as normal external routes, he removes area 10 nssa on R3 and R2. Now show ip route | include O E2 shows them on R2 and R8. The rule:

  • The type 5 LSA comes from the ASBR. It carries the external prefix and travels through the whole domain, except stub areas.
  • The type 4 LSA comes from the ABR. It tells its area how to reach the ASBR, because the ASBR's type 1 LSA never leaves its own area.

In R8's LSDB, the type 5 LSAs say the ASBR is R3, and the Summary ASBR, type 4, explains how to get there: it's a helper for type 5. R9, in area 40, now sees O E2 routes.

Area 40 becomes a stub

Do R9, R10 and R11 need all those routes if their only exit is R8? A default route is enough: that's a stub area, an area with a single exit. Jesús configures area 40 stub on R8 and the adjacency drops: the stub flag in the Hello no longer matches. You have to repeat the command on every router in the area.

! Stub: the same command on every router in area 40
R8(config)# router ospf 1
R8(config-router)# area 40 stub
R9(config-router)# area 40 stub
R10(config-router)# area 40 stub
R11(config-router)# area 40 stub
R11# show ip route
! O*IA 0.0.0.0/0 via 10.10.10.8, no more O E1 / O E2

! Totally stubby: add no-summary only on the ABR
R8(config-router)# area 40 stub no-summary
R11# show ip route
R11# ping 150.150.150.150

The result on R11:

  • The O E1 and O E2 routes are gone: the ABR filters type 4, 5 and 7 LSAs.
  • Type 1 and 2 LSAs from other areas still arrive, translated into type 3, as O IA.
  • An O*IA default route via 10.10.10.8 appears, injected by R8 as type 3. The ping to 150.150.150.150 works.

What if the core has 10,000 or 20,000 O IA routes? You can filter them too: that's totally stubby. Only the ABR changes, with area 40 stub no-summary. R11's table becomes tiny: its own area and the default route. The ping still works and the router answers faster. A lot of LSA theory to end up with two commands, says Jesús, but that theory tells you when to use them.

The E-bit and the N-bit in Wireshark

Where is that stub flag? In the Options field of the Hello.

The Options field of the Hello: E-bit and N/P-bit The OSPF Options field has eight bit positions: unused, O, DC, EA, N/P, MC, E and unused. The E-bit says whether the area accepts AS external routes, Type 5 LSAs. The N/P position is read as the N-bit in a Hello packet and as the P-bit in the header of a Type 7 LSA. In a regular area the Hello carries E equal to 1 and N equal to 0. In a stub or totally stubby area, E is 0 and N is 0. In an NSSA or totally NSSA, E is 0 and N is 1. Neighbors must agree on both bits or the Hello is dropped and there is no adjacency. In a Type 7 LSA, P equal to 1 asks the NSSA ABR to translate it into a Type 5 LSA. OSPF OPTIONS FIELD (HELLO · LSA HEADER) * O DC EA N/P MC E * N-bit in Hello External capable Regular area N = 0 E = 1 Stub · totally stubby N = 0 E = 0 NSSA · totally NSSA N = 1 E = 0 Type 7 LSA header P = 1 → ABR translates to Type 5 Neighbors must agree on E and N: a mismatch drops the Hello and the adjacency never forms. Same bit position, two names: N in the Hello, P in the Type 7 LSA (RFC 3101).

The E and N bits in the Hello must match between neighbors; in a type 7 LSA, the same position is called the P-bit. Diagram: The House of Routing.

  • Regular area: E-bit set to 1. That's the capture from R7, in area 32: it accepts external routes.
  • Stub and totally stubby: E-bit set to 0. That's the capture from R11: no external routes and no ASBR.
  • NSSA: E-bit set to 0, because it's still a stub area, and N-bit set to 1.

Jesús warned that Wireshark may label that bit N or P depending on the version. RFC 3101 clears it up: it's a single position, N/P. In the Hello it's the N-bit and marks an NSSA router. In the header of a type 7 LSA it's the P-bit and asks the ABR to translate the LSA into type 5.

NSSA: more than one exit, no static routes

What if the area needs more than one exit? That's what the not-so-stubby area is for: it's still a stub, but it accepts an ASBR. Jesús sees this often in the field: OSPF networks full of static or floating routes, route-maps and IP SLA, because nobody dared to use NSSA. If OSPF solves it natively, why add other tools?

In an NSSA, whatever the ASBR redistributes travels as type 7: N1 or N2 routes. N1 adds the internal cost up to the ASBR; N2 doesn't. An NSSA allows LSAs 1, 2, 3 and 7, filters 4 and 5 and doesn't inject a default route on its own. That's its strength: in an area of 300 routers, you decide where the default exits.

! NSSA: the same command on every router in the area
! (area 50 in the diagram, area 10 in the configuration)
R2(config)# router ospf 1
R2(config-router)# area 10 nssa
R3(config)# router ospf 1
R3(config-router)# area 10 nssa

! Totally NSSA: add no-summary only on the ABR
R2(config-router)# area 10 nssa no-summary
R3# show ip route
! back to a plain NSSA: the default route disappears
R2(config-router)# no area 10 nssa no-summary
R2(config-router)# do show run | section router

With no-summary on the ABR, R2, the area becomes totally NSSA. One detail: R3 had a static default route, administrative distance 1, which beats any OSPF route. Once it's removed, the default injected by R2 appears on R3. According to Cisco and RFC 3101, with no-summary the ABR injects it as a type 3 LSA: you'll see it as O*IA.

When no-summary is removed, the default disappears from R3. That's where traffic engineering begins: you choose which ABR or ASBR each flow leaves through.

From LSA 7 to LSA 5

Without redistribution, R8 can't reach 150.150.150.150. R11 has its default route, but the ping fails: the default takes it to R8, and nobody in the domain knows that destination. On R3, the EIGRP networks are in the routing table but not in the LSDB. Jesús checks the process number with show run | section router eigrp and redistributes:

R3# show run | section router eigrp
R3# configure terminal
R3(config)# router ospf 1
R3(config-router)# redistribute eigrp 100 subnets
R3(config-router)# do show ip ospf database
R2# show ip ospf database nssa-external
R2# show ip route | include N2
R1# show ip route
! R2 (inside the NSSA): O N2 · R1 and R7 (outside): O E2
R11# ping 150.150.150.150

Why subnets? According to Cisco, without that keyword OSPF only redistributes major networks that aren't subnetted. With it, every subnet gets in.

An external route from LSA 7 to LSA 5 R3, the ASBR inside the NSSA, redistributes EIGRP 100 with redistribute eigrp 100 subnets and originates Type 7 LSAs with the P-bit set; for R3 they are still EIGRP routes. R2, the NSSA ABR, sees them as O N2 and translates them into Type 5 LSAs for area 0. R1 and R7 and R8 in area 32 see the same prefixes as O E2. R8 filters Types 4, 5 and 7 toward area 40, which is totally stubby, so R11 only has an O*IA default route; it can still ping 150.150.150.150 because R8 knows the E2 route. R3 · ASBR area 10 · NSSA D: EIGRP 100 R2 · ABR area 10 + area 0 O N2 R1 · ABR area 0 + area 32 O E2 R7 · R8 area 32 O E2 R11 area 40 · totally stubby O*IA 0.0.0.0/0 Type 7 · N2 · P-bit = 1 · stays in the NSSA Type 5 · E2 · translated by R2 · area 0 and area 32 Types 4, 5, 7 filtered R3: redistribute eigrp 100 subnets · R2: show ip ospf database nssa-external R11 pings 150.150.150.150 with its default route: R8 already knows the E2 route.

The type 7 LSA never leaves the NSSA: the ABR translates it into type 5 and each router names the route after its area. Diagram: The House of Routing.

Now follow the route through the domain:

  1. R3 originates type 7 LSAs, as N2. In its own table they're still EIGRP routes.
  2. R2, inside the NSSA, sees them as O N2. Its LSDB holds the type 7 LSAs and the type 5 LSAs it originates when it translates.
  3. R1 and R7 see O E2: outside the NSSA, E2 is the right code, not N2.
  4. R11 sees none of those LSAs, but its ping now works: R8 already knows the destination.
Redistribution is easy; good redistribution isn't. One way and with one exit, it's simple. Both ways and at several points, it can create metric feedback and routing loops. To tune it you need offset-lists, distribute-lists, prefix-lists and route-maps.

The default route in the NSSA

Last experiment: have the ASBR, R3, advertise a default route into the NSSA. Jesús tries default-information originate, with and without always, with a static default route on R3; then redistribute connected, redistribute static subnets and area 10 nssa no-summary once more. The default never shows up on R2, and the video ends in the middle of troubleshooting. Along the way, a warning: always advertises the default even if it doesn't exist, a danger unless it's your only exit.

We won't make up the ending, but Cisco and RFC 3101 point to possible causes:

  • An NSSA uses a different command. default-information originate generates an external default, and an NSSA has no type 5 LSAs. For a type 7 default, Cisco documents area 10 nssa default-information-originate; on an ASBR it requires a default route in the routing table learned from another protocol, such as a static route.
  • no-summary only makes sense on the ABR. On R3 it changes nothing, and RFC 3101 makes it mutually exclusive with type 7 defaults from internal routers.
  • The ABR doesn't always install a type 7 default. According to RFC 3101, R2 ignores it if it arrives with the P-bit clear or if R2 itself suppresses summaries into the NSSA.
! What the class tested on R3, the ASBR inside the NSSA
R3(config)# router ospf 1
R3(config-router)# default-information originate always
R3(config-router)# no default-information originate always
R3(config-router)# default-information originate
R3(config-router)# redistribute connected
R3(config-router)# redistribute static subnets
R2# show ip route
! no default route on R2: the video ends here

! Documented by Cisco for a Type 7 default (not tested in the video)
R3(config-router)# area 10 nssa default-information-originate

Chapter 8 opens by admitting this exercise was left pending. Close it yourself in your lab.

Class videos

These are the two videos from the 2nd OSPF Marathon that this chapter covers. They were recorded live on February 13, 2021, with Cisco IOSv routers in GNS3, debug and Wireshark; the audio is in Spanish, with subtitles in Spanish, English, French and Portuguese.

Recorded live; Spanish audio with Spanish, English, French and Portuguese subtitles. When you play it, the video loads from YouTube. Day 2 playlist on YouTube

Test what you learned

1. Area 40 only touches area 32. What do you need to configure the virtual link on R8?

Answer. The transit area, 32, and the router ID of the other ABR, R1: area 32 virtual-link 0.0.0.1. It's not an IP address. The other end needs the matching command.

2. You configure area 40 stub on the ABR and every neighbor drops. What happened?

Answer. The Hello carries the E-bit, which is 0 in a stub area. The neighbors still send it as 1, so the adjacency doesn't form. Every router in the area needs area 40 stub.

3. R11 has a default route, but the ping to 150.150.150.150 fails. Why?

Answer. The default only takes the packet to R8. If the EIGRP networks aren't redistributed into OSPF, nobody in the domain knows how to reach the destination. Once R3 redistributes them, the ping works.

4. R2 sees a route as O N2 and R1 sees the same route as O E2. Is something wrong?

Answer. No. Type 7 LSAs live only in the NSSA. R2, as the ABR, translates them into type 5 toward area 0, and outside the NSSA the route shows as E2.

5. You add no-summary on the ABR of an NSSA. Which LSA type carries the default route it injects?

Answer. A type 3 LSA, according to Cisco and RFC 3101; that's why you see O*IA. Without no-summary, the NSSA gets no default unless you ask for one with area 10 nssa default-information-originate, which generates a type 7.

What you take away

  • Every area must touch area 0. If it can't, a virtual link through a transit area, never a stub, reconnects it.
  • A virtual link points to the other ABR's router ID, not to an IP. It shows priority 0 and no DR.
  • The ASBR creates the type 5 LSA; the ABR creates the type 4 to say where the ASBR is.
  • Stub goes on every router in the area; totally stubby only adds no-summary on the ABR. The E-bit set to 0 gives it away in the Hello.
  • An NSSA accepts an ASBR: its routes travel as type 7 (N1/N2) and the ABR translates them into type 5 (E1/E2).
  • Use subnets when you redistribute into OSPF, and plan two-way redistribution before you turn it on.
  • In an NSSA, the default route doesn't arrive on its own: decide who generates it and with which command.

Official resources

Source and credits. Chapter written from the OSPF Masterclass that Jesús Espinoza recorded live in 2021. Text drafted with AI assistance and reviewed; original diagrams by The House of Routing. Technical details and configuration were checked against official Cisco documentation and IETF RFCs.

Navigate