OSPF MASTERCLASS · CHAPTER 5

Redistribution, LSA types 4 and 5 and stub areas in the lab

A router that brings in EIGRP routes, an ABR that says “the ASBR is behind me”, and an area that goes from receiving everything to living on a single default route.

13 min readVideos: Day 1, part 9 and Day 2, part 1Level: intermediate

From point A to point B

Point A: you already know each LSA type and what each stub area filters, but you saw it in a table. Point B: by the end of this chapter you will read a real database with type 1 to 5 LSAs, know why a router becomes an ASBR or an ABR, and turn an area into a stub and a totally stubby area without losing connectivity.

What you will see
  1. Type 3 LSAs turned into O IA routes
  2. EIGRP redistributed into OSPF and the O E2 routes
  3. Type 4 and 5 LSAs on the ABR and on an internal router
  4. A stub area and a totally stubby area configured live
  5. The start of Day 2: stub areas as LSA filters and the new topology

From the ABR to the table: type 3 LSAs and O IA

We pick up the lab from the previous chapter. R1 and R2 form area 0 over a point-to-point serial link, 40.40.40.0/24. R2 and R3 form area 10, 50.50.50.0/24. R2 is the ABR.

In R3's routing table, the area 0 networks show up as O IA. They are the same ones the database lists as Summary Net Link States: the topology database comes first, and then the router decides what goes into the table. A type 3 LSA shows up as O IA.

R3# show ip route | include O IA
! O IA 1.1.1.1, 2.2.2.2 and 40.40.40.0: the area 0 networks, via the ABR
R1# show ip ospf database
! Router Link States (Area 0): 0.0.0.1 and 0.0.0.2
! no Net Link States: point-to-point link, no DR
! Summary Net Link States (Area 0): ADV Router 0.0.0.2 (the ABR)

R1 has two type 1 LSAs, its own and R2's, and no type 2. R1 only has a point-to-point link, and a point-to-point link has no DR. No DR, no type 2.

It does have type 3 LSAs, with Advertising Router 0.0.0.2. When you see a router ID as the ADV Router of a Summary Net Link, you are looking at the ABR: R2 advertises the 3.3.3.3 loopback and the 50.50.50.0 segment into area 0.

R3 becomes an ASBR

Now it's time to inject external routes. Jesús takes R3's loopback 0 out of OSPF with no ip ospf 1 area 0: that network is no longer advertised as internal.

The first try, redistribute connected subnets, doesn't show the route live. Jesús changes plans: he brings up EIGRP 100 between R3 and R4 on 70.70.70.0/24 and redistributes EIGRP into OSPF.

! take the loopback out of OSPF
R3(config)# interface loopback 0
R3(config-if)# no ip ospf 1 area 0
R3(config-if)# exit
! first try: redistribute the connected networks
R3(config)# router ospf 1
R3(config-router)# redistribute connected subnets
R3(config-router)# no redistribute connected subnets
! second try: an EIGRP 100 domain towards R4
R3(config)# interface serial 0/0
R3(config-if)# ip address 70.70.70.3 255.255.255.0
R3(config-if)# no shutdown
R3(config-if)# router eigrp 100
R3(config-router)# network 3.3.3.0
R3(config-router)# network 70.70.70.0 0.0.0.255
R3(config-router)# router ospf 1
R3(config-router)# redistribute eigrp 100 subnets
R3(config-router)# do wr

R4(config)# interface serial 0/1
R4(config-if)# ip address 70.70.70.4 255.255.255.0
R4(config-if)# no shutdown
! R4 also runs EIGRP 100: the EIGRP adjacency comes up
According to Cisco. redistribute connected subnets is enough to advertise connected networks as external. Without subnets, only networks that are not subnetted are redistributed. If you don't set a metric, they come in as External Type 2 (E2) with a metric of 20.

With EIGRP up, R2 shows O E2 routes: they are type 5 LSAs. R3 doesn't see them as OSPF routes, because 3.3.3.3 and 70.70.70.0 are connected to it; show ip protocols confirms it runs OSPF and EIGRP at the same time. By redistributing, R3 becomes an ASBR (Autonomous System Boundary Router): the router that brings routes from outside the OSPF domain.

Type 4 and 5 LSAs in the database

On the ABR, show ip ospf database now shows every LSA type in the lab:

  • Area 0: type 1, type 3 and type 4 (Summary ASB Link States).
  • Area 10: type 1 from R2 and R3, type 2 from R3, the DR, and type 3.
  • Type 5 (AS External): advertised by 0.0.0.3, the ASBR, with the 3.3.3.x and 70.70.70.0 networks.
R2# show ip route
! O E2 3.3.3.x and 70.70.70.0: type 5 LSAs from the ASBR
R2# show ip ospf database
! Summary ASB Link States (Area 0): type 4, created by R2
! Type-5 AS External Link States: ADV Router 0.0.0.3
R3# show ip protocols
! R3 runs OSPF 1 and EIGRP 100: the 70.70.70.0 network is connected
R1# show ip route ospf
R1# ping 3.3.3.3

Don't mix up type 4 and type 2. The ABR creates the type 4 to say: “I, R2, know how to reach the router that redistributes.” The type 5 says which external networks exist; the type 4 says where the ASBR that advertised them is. It's needed because the ASBR announces itself as such in its type 1 LSA, and that LSA never leaves area 10.

Redistribution lab: who creates each LSA and how far it travels Five routers from left to right. R4 runs EIGRP 100 with R3 on 70.70.70.0/24. R3, router ID 0.0.0.3, redistributes EIGRP into OSPF with redistribute eigrp 100 subnets, so it becomes the ASBR. R3 and R2 share area 10 on 50.50.50.0/24. R2, router ID 0.0.0.2, is the ABR between area 10 and area 0. R2 and R1 share area 0 on the point-to-point link 40.40.40.0/24. R1, router ID 0.0.0.1, becomes an ABR when its GigabitEthernet1/0 joins area 20, 30.30.30.0/24, where R7, router ID 0.0.0.7, lives. Type 1 and type 2 LSAs stay inside each area. The type 5 LSA created by R3 floods areas 10, 0 and 20 and shows up as O E2 routes. R2 creates a type 4 LSA in area 0 and R1 creates another one in area 20: both say how to reach the ASBR. R2 and R1 also create type 3 LSAs, seen as O IA routes. When area 20 becomes a stub area, R1 blocks types 4 and 5 and injects a default route as a type 3 LSA. EIGRP 10070.70.70.0/24 AREA 1050.50.50.0/24 AREA 040.40.40.0/24 · P2P AREA 2030.30.30.0/24 · Ethernet R4 EIGRP 100 S0/1 .4 R3 · ASBR RID 0.0.0.3 redistributes EIGRP R2 · ABR RID 0.0.0.2 areas 10 + 0 R1 · ABR RID 0.0.0.1 areas 0 + 20 R7 RID 0.0.0.7 Lo 7.7.7.7/32 TYPE 5 · created by R3 (ASBR) · floods areas 10, 0 and 20 · O E2 routes TYPE 4 · R2 → area 0: the ASBR is behind me TYPE 4 · R1 → area 20 TYPE 3 · R2 → area 0 · O IA TYPE 3 · R1 → area 20 TYPES 1 and 2 · every router and every DR · they never leave their own area Point-to-point link R1–R2: no DR, so no type 2 LSA in area 0. Area 20 stub: R1 blocks types 4 and 5 and sends 0.0.0.0/0 to R7 as a type 3 (O*IA).

R3 creates the type 5; each ABR creates types 3 and 4 into its other area; types 1 and 2 stay in their area. Diagram: The House of Routing.

R1, an internal router in area 0, doesn't see the details of area 10. It sees the type 1 LSAs, the type 3 LSAs (its O IA routes), the type 4, which says “to reach the ASBR, go through 0.0.0.2”, and the type 5, which floods the whole domain. A ping 3.3.3.3 from R1 succeeds. That network could come from the Internet: for OSPF, it's external.

R7 arrives: R1 becomes an ABR

To close Day 1, Jesús connects R7 to R1's GigabitEthernet1/0, on 30.30.30.0/24, in a new area, area 20. It's Ethernet: a broadcast environment, with a DR.

R1(config)# interface GigabitEthernet1/0
R1(config-if)# ip address 30.30.30.1 255.255.255.0
R1(config-if)# ip ospf 1 area 20
R1(config-if)# no shutdown

R7(config)# router ospf 1
R7(config-router)# router-id 0.0.0.7
R7(config-router)# interface loopback 0
R7(config-if)# ip address 7.7.7.7 255.255.255.255
R7(config-if)# ip ospf 1 area 20
R7(config-if)# interface GigabitEthernet0/0
R7(config-if)# ip address 30.30.30.7 255.255.255.0
R7(config-if)# ip ospf 1 area 20
R7(config-if)# no shutdown
R7(config-if)# do show ip ospf neighbor
R7(config-if)# do show ip ospf database

The neighbor reaches Full. Look at R1: it used to be a backbone router, with all its interfaces in area 0. Now it has one interface in area 0 and another in area 20: it's an ABR. Nobody named it an ABR; it is one by design.

R7's database shows it:

  • Type 1: R1's and R7's.
  • Type 2: from the segment's DR, at that point R1.
  • Type 3: from R1, the new ABR, with the area 0 and area 10 prefixes, such as 1.1.1.1, 2.2.2.2, 40.40.40.0 and 50.50.50.0.
  • Type 4: also from R1, which now acts as the gateway to the ASBR.
  • Type 5: R3's, which reaches area 20 with no trouble.

R7's table has O IA and O E2 routes, and no intra-area O routes: in its own area it only has connected networks.

Stub area 20: types 4 and 5 are out

R7 receives even the external routes, but it has a single exit: R1. As Jesús insists, if you don't understand the LSA, you don't understand SPF, and you won't be able to implement it.

The first command goes on R1: area 20 stub. The neighbor relationship with R7 drops, because the stub flag, the E-bit in the Hello, changed on one end only. On broadcast, the dead interval is 40 seconds, so the drop comes fast. The fix is the same line on R7:

! Stub: the same command on both routers of area 20
R1(config)# router ospf 1
R1(config-router)# area 20 stub
R7(config)# router ospf 1
R7(config-router)# area 20 stub
R7(config-router)# do show ip ospf database
R7(config-router)# do show ip route
! O*IA 0.0.0.0/0 via 30.30.30.1: the default route from R1

R7's database shrinks: types 1, 2 and 3 remain. R1 filtered types 4 and 5. In the table, the O E2 routes disappear and O*IA 0.0.0.0/0 shows up: the default route R1 injects as a type 3 LSA. According to Cisco, the ABR of a stub area generates that summary with Link State ID 0.0.0.0 even if it has no default route itself, with a cost of 1 unless you change area default-cost.

Totally stubby: no-summary only on the ABR

One “master command” is left: totally stubby, configured only on the ABR. On R1, area 20 stub no-summary.

Live, the first try went in as area 1 stub, and nothing changed on R7. A show run | section router gave it away; Jesús removed the line with no area 1 stub and applied the command to area 20. A good habit: if a change doesn't give the expected result, check the configuration before you blame the protocol.

! Totally stubby: no-summary only on the ABR
R1(config)# router ospf 1
R1(config-router)# area 20 stub no-summary
R1(config-router)# do show run | section router
R1(config-router)# do clear ip ospf process
Reset ALL OSPF processes? [no]: yes

R7# show ip route
R7# show ip ospf database
R7# ping 3.3.3.3

R7 ends up with a minimal database: the type 1 LSAs of its link with R1, the type 2 from the DR (after the reset, R7) and a single Summary Net Link, R1's default route. Types 3, 4 and 5 were filtered, except that one.

What R7 sees: normal area, stub area and totally stubby area Three panels show the LSDB and routing table of R7, the internal router of area 20. As a normal area, R7 has LSA types 1, 2, 3, 4 and 5 and learns O IA and O E2 routes. After area 20 stub on R1 and R7, R1 blocks types 4 and 5, the O E2 routes disappear and a default route 0.0.0.0/0 shows up as O*IA, sent by R1 as a type 3 LSA. After area 20 stub no-summary, configured only on R1, the ABR also blocks the other type 3 LSAs: R7 keeps types 1 and 2, the default route and its connected networks. In every case, a ping from R7 to 3.3.3.3 still works. R7 · SHOW IP OSPF DATABASE · SHOW IP ROUTE NORMAL AREA 20 LSDB: types 1, 2, 3, 4, 5 O IA: areas 0 and 10 O E2: external routes no area command STUB AREA 20 LSDB: types 1, 2, 3 types 4 and 5 blocked O*IA 0.0.0.0/0 from R1 area 20 stub on R1 and R7 TOTALLY STUBBY LSDB: types 1, 2 + default types 3, 4 and 5 blocked O*IA 0.0.0.0/0 + connected no-summary only on R1 Smaller LSDB, smaller table, less SPF work: the default route still reaches everything. ping 3.3.3.3 from R7 works in all three cases.

R7's view in three steps: normal area, stub and totally stubby. Diagram: The House of Routing.

The table went from O IA and O E2, to O IA plus a default route, and finally to the default route and the connected networks. Even so, ping 3.3.3.3 from R7 succeeds. Picture a thousand users behind R7 with a single exit: they don't need every route in the domain, just a default route.

Day 2: OSPF speaks LSA, not IP

A week later, Jesús opens the second marathon. The agenda: DR, BDR and DROTHER with debug; null, plain text and MD5 authentication (and HMAC-SHA in recent IOS releases); the four stub areas; ECMP; redistribution and default-information originate; prefix control; and OSPF over Metro Ethernet and MPLS L3VPN.

The heart of the day is the four stub areas: stub, totally stubby, NSSA and totally NSSA. And here comes the invitation: in the CCNA you learn ip ospf 1 area 1, and it's easy to stay stuck on IP addressing. Double-click: OSPF doesn't speak IP, it speaks LSA. A loopback with OSPF becomes a type 1 LSA that carries the prefix inside. That's why a stub area filters LSAs, not prefixes: it isn't an ACL.

Designing areas is like designing VLSM. An addressing plan that grows without a plan ends up with no summarization and routing problems. Areas are the same: OSPF lets you number them however you like, but without a hierarchical scheme, filtering LSAs later hurts.

  • Default route: 0.0.0.0/0 isn't a real network; it means “if the longest match rule finds no destination, send it here.” default-information originate advertises it in OSPF, and it's key in an NSSA.
  • ECMP: Cisco load balances across 4 equal-cost routes by default; maximum-paths raises that, depending on the platform.
  • Redistributing by mistake: a redistribute connected on an internal area 0 router turns it into an ASBR. It generates type 5 LSAs, each ABR generates a type 4, and those networks show up as O E1 or O E2 (E2 by default), or O N1/N2 in an NSSA.

The day closes with Metro Ethernet, which delivers circuits in three models: E-Line (point-to-point), E-LAN (broadcast) and E-Tree (hub and spoke). You'll see it in chapter 8.

The Day 2 topology

Ethernet is broadcast by default for OSPF: a DR and a BDR are elected, and the rest are DROTHERs. The DR generates the type 2 LSA. Routers use 224.0.0.5 (all OSPF routers) and 224.0.0.6 (the address the DR and the BDR listen on). Jesús insists on deciding the roles before you connect the router, with the priority, from 0 to 255: with 0 a router never takes part; among the rest, the highest value wins. The election in detail comes in chapter 6.

Day 2 topology, simplified Seven blocks from left to right. Area 40 is an Ethernet LAN, 10.10.10.0/24, with switch SW1 and routers R9, R10 and R11; it will be a stub and then a totally stubby area. R8 is the ABR between area 40 and area 32. R7 sits in area 32. R1 is the ABR between area 32 and area 0. R2 is the ABR between area 0 and the area drawn as area 50, configured as area 10, which is an NSSA and later a totally NSSA. R3 is the ASBR between that area and EIGRP. R4 runs EIGRP with loopbacks 150.150.150.150, 160.160.160.160 and 170.170.170.170. Area 40 does not touch area 0, so a virtual link joins R8 and R1 across transit area 32. Ethernet segments are broadcast networks: they elect a DR and a BDR by priority, from 0 to 255, where 0 never becomes DR. AREA 40stub · totally stubby AREA 3220.20.20.0 · 30.30.30.0 AREA 040.40.40.0/24 AREA 50NSSA (area 10) EIGRP70.70.70.0/24 LAN SW1 R9 · R10 · R11 R8 · ABR areas 40 + 32 R7 area 32 R1 · ABR areas 32 + 0 R2 · ABR areas 0 + 50 R3 · ASBR OSPF + EIGRP R4 Lo 150 · 160 Lo 170 virtual link R8 ↔ R1 across transit area 32 BROADCAST (ETHERNET) DR + BDR elected by priority 0–255 0 = never DR · highest priority wins 224.0.0.5 all OSPF · 224.0.0.6 DR/BDR WHY A VIRTUAL LINK every area must touch area 0 area 40 sits behind area 32 a stub area can never be the transit

The Day 2 topology, simplified: area 40 sits behind area 32 and needs a virtual link. Diagram: The House of Routing.

Every area must touch area 0 through an ABR. Area 40 hangs off R8, behind area 32: it works internally, but it doesn't receive the information from the rest of the domain. The fix is a virtual link between R8 and R1 across transit area 32. Jesús describes it as a mini VPN; Cisco defines it as a logical link to the backbone that crosses the transit area, which can never be a stub area.

R3 is still the ASBR between EIGRP and OSPF, with R4's D routes 150, 160 and 170. In the drawing, the R2–R3 segment appears as area 50, although in the configuration it's still the Day 1 area 10.

R3# show ip route
R3# show ip eigrp neighbor
! D routes 150, 160 and 170: R3 is the ASBR between EIGRP and OSPF
R2# show ip route | include O E2
R2# show ip route | include N2
! the area between R2 and R3 is an NSSA: the external routes show up as O N2

On R2, | include O E2 returns nothing, but | include N2 does: that area is already not-so-stubby, and the external routes arrive as type 7 LSAs, O N2. The network comes preassembled; chapter 7 builds it step by step.

Class videos

These are the two videos this chapter is based on: the end of Day 1, recorded live on February 7, 2021, and the start of Day 2, recorded on February 13, 2021. Both use Cisco IOSv routers in GNS3. The audio is in Spanish, with Spanish, English, French and Portuguese subtitles.

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

Test what you learned

1. R1 only has a point-to-point link. Why is there no type 2 LSA in its database?

Answer. No DR is elected on a point-to-point link, and only the DR of a broadcast or NBMA segment generates a type 2.

2. R3 redistributes EIGRP into OSPF. Which LSA does R3 create, and which one does R2, the ABR, create?

Answer. R3, the ASBR, creates the type 5 (O E2). R2 creates a type 4 in area 0, which tells R1 how to reach the ASBR.

3. You configure area 20 stub on the ABR and the neighbor drops. Why?

Answer. The stub flag (E-bit) in the Hello changed on one end only. Configure area 20 stub on the internal router too.

4. Where does no-summary go, and what does the internal router of a totally stubby area keep?

Answer. Only on the ABR. The internal router keeps O*IA 0.0.0.0/0 and its connected networks, and it still reaches 3.3.3.3.

5. An area sits behind another one and doesn't touch area 0. What do you need?

Answer. A virtual link between its ABR and an area 0 ABR, across the area in between, which can't be a stub area.

Key takeaways

  • The ABR's type 3 LSAs show up as O IA; the ADV Router of a Summary Net Link is the ABR.
  • Redistributing turns a router into an ASBR: it creates type 5 LSAs, shown as O E2 with a metric of 20 unless you say otherwise. Use subnets.
  • Each ABR creates a type 4 LSA to say where the ASBR is. The type 5 says which external networks exist.
  • A router becomes an ABR when it has interfaces in two areas, with no special command.
  • Stub area: the same command on every router in the area; types 4 and 5 are filtered and an O*IA default route arrives.
  • Totally stubby: no-summary only on the ABR; the internal router lives on the default route and its connected networks.
  • OSPF speaks LSA, not IP: design your areas with the same hierarchical discipline as a VLSM scheme.

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 data and configuration were checked against official Cisco documentation and IETF RFCs.

Navigate