LESSON PURPOSE
Build a practical understanding of how OSPFv2 scales by dividing an autonomous system into multiple areas, how Area 0 connects those areas, how ABRs exchange inter-area reachability, and how to configure, verify, and troubleshoot a working multi-area OSPFv2 topology.

Lesson Overview

OSPFv2 is a link-state IPv4 routing protocol. In a small network, all routers can operate in one OSPF area. As the routed domain grows, multi-area OSPF reduces the size of the link-state database and limits SPF calculations by creating area boundaries. Area 0 is the backbone; non-backbone areas must connect to Area 0 through Area Border Routers (ABRs).


Learning Objectives

  • Describe the purpose of OSPF areas and explain why Area 0 is the backbone.
  • Differentiate internal routers, backbone routers, ABRs, and ASBRs.
  • Explain OSPFv2 neighbor formation, LSDB scope, SPF calculation, and inter-area route propagation.
  • Interpret common OSPF LSA types used in multi-area designs, especially Type 1, Type 2, Type 3, and Type 5.
  • Configure a four-router multi-area OSPFv2 topology using network statements and wildcard masks.
  • Configure OSPFv2 using the interface-level ip ospf command as an alternative method.
  • Use passive interfaces without suppressing route advertisement.
  • Verify neighbors, interfaces, LSDB contents, ABR behavior, and OSPF routing-table entries.
  • Explain O, O IA, O E1, and O E2 routing-table codes at a practical level.
  • Troubleshoot common multi-area OSPF failures including area mismatch, subnet mismatch, passive transit interfaces, MTU mismatch, and router-ID issues.
  • Apply OSPF cost and reference-bandwidth concepts consistently across routers.
  • Perform a guided end-to-end lab and validate inter-area reachability.

CCNA / OPERATIONS FOCUS
For CCNA, the priority is to understand OSPFv2 operation, neighbor formation, single-area configuration and verification, route selection, and troubleshooting. Multi-area OSPF extends those same fundamentals with Area 0, ABRs, inter-area routes, and LSA scope. This lesson intentionally goes deeper so the behavior seen in enterprise networks is easier to interpret.


1. Why Multi-Area OSPF?

OSPF maintains a link-state database (LSDB) and runs the Shortest Path First (SPF) algorithm to calculate routes. If every router in a large network participates in one giant area, every router must maintain that area’s detailed topology and react to topology changes within that area.

  • Areas create logical boundaries for link-state information.
  • Type 1 and Type 2 topology LSAs stay within their area.
  • ABRs advertise reachability between areas instead of flooding all topology detail end to end.
  • A topology change in one area normally does not force routers in another area to rerun SPF for that area’s internal topology.
  • Area 0 provides the backbone path between non-backbone areas.


2. OSPF Fundamentals and Important Key Points

OSPF — Open Shortest Path First is a link-state Interior Gateway Protocol (IGP) used to exchange routing information inside an autonomous system or enterprise network.

OSPF does not advertise complete routing tables to neighbors. Instead, routers exchange information about their links and build a Link-State Database (LSDB). Routers within the same OSPF area should develop a consistent view of that area's topology and then independently run the Shortest Path First (SPF) algorithm to calculate the best paths.


Topic

Key point

Protocol

Link-state IGP; IP protocol number 89.

IPv4 version

OSPFv2 carries IPv4 routes.

Metric

Cost; lower total path cost is preferred.

Administrative distance

110 by default on Cisco IOS/IOS XE for OSPF routes.

Router ID

32-bit dotted-decimal identifier; should be unique and is best configured explicitly.

Backbone

Area 0 is the OSPF backbone. Normal multi-area design connects every non-backbone area to Area 0.

ABR

Router with interfaces in more than one OSPF area; keeps an LSDB per area and originates inter-area information.

ASBR

Router that injects external routes into OSPF through redistribution or default-information originate.

Multicast

224.0.0.5 = All SPF Routers; 224.0.0.6 = All DR Routers.

Process ID

Locally significant only; neighboring routers do not have to use the same process ID.

DR/BDR

Used on broadcast/NBMA multiaccess networks; not needed on point-to-point links.

Passive interface

Advertises a connected prefix without sending Hellos or forming neighbors on that interface.

Equal-cost paths

OSPF can install multiple equal-cost routes when the platform and maximum-paths allow it.

Inter-area route code

O IA means the route came from another OSPF area through an ABR.

 

2.1 OSPF Core Values and Defaults parameters

Item

OSPFv2 value / behavior

Why it matters

Administrative distance

110 (Cisco default)

Used by the RIB when the same prefix is learned from different route sources. Lower AD wins.

Metric

Cost; lower cumulative cost wins

OSPF selects the lowest-cost path among OSPF candidates.

IP protocol

89

OSPF runs directly over IP; it does not use TCP or UDP ports.

All SPF Routers multicast

224.0.0.5

Used by OSPF routers for Hello and other OSPF communication.

All DR Routers multicast

224.0.0.6

Used on multiaccess networks when sending to the DR/BDR.

Default reference bandwidth

100 Mbps on classic Cisco defaults

Without adjustment, many links at 100 Mbps and faster may all calculate cost 1.

Hello / Dead - broadcast & point-to-point

10 / 40 seconds (common Cisco defaults)

Neighbors must use compatible timers.

Hello / Dead - NBMA

30 / 120 seconds (common Cisco defaults)

Different default timers can prevent adjacency if network types do not match.

Interface OSPF priority

1 by default; 0 = ineligible for DR/BDR

Priority is checked before Router ID during DR/BDR election.

Backbone area

Area 0

Normal inter-area traffic crosses the backbone.

Router ID

32-bit dotted-decimal identifier

Must be unique; explicit configuration is recommended.


2.2 High-Value OSPF Operational and Exam Points

  • OSPF is a link-state IGP and uses IP protocol number 89, not TCP/UDP ports.
  • OSPFv2 carries IPv4 routes. OSPFv3 is the OSPF version associated with IPv6 operation.
  • Neighbor parameters must be compatible: area, timers, authentication (if used), subnet, network type, and MTU behavior all matter.
  • Router IDs must be unique. Configure router-id explicitly for predictable behavior.
  • DR/BDR elections occur on broadcast/NBMA multiaccess networks, not on point-to-point links. Higher interface priority wins; Router ID is the tie-breaker; priority 0 is ineligible.
  • DR/BDR election is non-preemptive. A later router with a higher priority does not automatically replace the current DR while the current roles remain valid.
  • Passive-interface advertises the connected network into OSPF but suppresses Hellos and neighbor formation on that interface.
  • O means intra-area. O IA means inter-area. O E1/O E2 are external routes. O N1/O N2 are NSSA external routes.
  • Type 1 and Type 2 LSAs remain inside an area. Type 3 LSAs are central to inter-area prefix advertisement by ABRs.
  • FULL adjacency is necessary where expected, but a FULL neighbor alone does not prove correct routing. Verify LSDB entries, route codes, AD/metric, next hop, and end-to-end forwarding.

High-value verification commands

show ip ospf

show ip ospf interface brief

show ip ospf interface <interface>

show ip ospf neighbor

show ip ospf neighbor detail

show ip ospf database

show ip route ospf

show ip route <prefix>

show ip protocols

show ip cef <prefix>


3. OSPF Packet Types and Neighbor Formation

Pasted content image

Packet type

Purpose

Hello

Discovers neighbors, maintains adjacency, carries area/timer/network parameters and DR/BDR information.

DBD

Database Description; summarizes LSDB contents during synchronization.

LSR

Link-State Request; asks for specific missing or newer LSAs.

LSU

Link-State Update; carries one or more LSAs.

LSAck

Acknowledges received LSAs.

Neighbor states

Down - no valid Hello received.

Init - Hello received, but bidirectional communication is not yet confirmed.

2-Way - each router sees its own RID in the neighbor Hello.

ExStart - master/slave and DBD sequence negotiation.

Exchange - DBD packets describe LSDB contents.

Loading - missing LSAs are requested and received.

FULL - required LSDB synchronization is complete.

Broadcast reminder: DROTHER-to-DROTHER neighbors can remain in 2-Way state normally. FULL is expected toward the DR and BDR.


4. Adjacency Requirements and Fast Troubleshooting Checks

Check

What should match / be valid

IP connectivity

Interfaces up/up and addresses in the same subnet.

Area ID

Both ends of the OSPF link must be in the same area.

Hello / Dead timers

Must be compatible on the link.

Network type

Should be compatible; mismatches create confusing neighbor behavior.

Authentication

If configured, parameters/keys must match.

MTU

Mismatch is a classic cause of ExStart/Exchange problems.

Router ID

Must be unique within the OSPF domain.

Passive interface

Transit interface must not be passive.

ACL / control plane

OSPF protocol 89 and multicast/control traffic must not be blocked.

show ip interface brief

show ip ospf interface brief

show ip ospf interface GigabitEthernet0/0

show ip ospf neighbor

show ip protocols

ping <direct-neighbor-ip>


5. Router ID and Network Types

5.1 Router ID Selection

  • Explicit router-id under the OSPF process is preferred.
  • If no explicit RID exists, IOS normally selects the highest loopback IPv4 address, then the highest active interface IPv4 address.
  • A changed Router ID usually requires restarting the OSPF process or reloading before it takes effect.

router ospf 1

router-id 2.2.2.2

!

clear ip ospf process


5.2 Network Types

Type

DR/BDR?

Typical use

Broadcast

Yes

Ethernet multiaccess segment.

Point-to-point

No

Exactly two OSPF routers on the link.

Non-broadcast

Yes

Legacy NBMA designs; manual neighbors often required.

Point-to-multipoint

No

Hub-and-spoke style logical multiaccess behavior.


6. OSPF Cost, SPF Algorithm, and Route Selection

6.1 OSPF Cost - Formula, Reference Bandwidth, and Examples

OSPF interface cost is conceptually calculated as reference bandwidth divided by interface bandwidth. The total path metric is the sum of the outgoing-interface costs along the path.

With the classic 100-Mbps reference bandwidth, FastEthernet 100 Mbps has cost 1, and 1-Gbps/10-Gbps/100-Gbps interfaces can also round to the minimum cost of 1. This can hide real speed differences.

Use auto-cost reference-bandwidth consistently on every OSPF router so faster links receive meaningful lower costs. The value is specified in Mbps.

Manual interface cost with ip ospf cost overrides the automatically calculated interface cost and is useful for deterministic path engineering in labs and operations.

Reference bandwidth example

Interface bandwidth

Calculated OSPF cost

100 Mbps (classic default)

100 Mbps

1

100 Mbps (classic default)

1 Gbps

1 (minimum integer cost)

100000 Mbps (100 Gbps)

1 Gbps

100

100000 Mbps (100 Gbps)

10 Gbps

10

100000 Mbps (100 Gbps)

100 Gbps

1

Cost configuration and verification

router ospf 1

 auto-cost reference-bandwidth 100000

!

interface GigabitEthernet0/0

 ip ospf cost 10

!

show ip ospf interface GigabitEthernet0/0

show ip route <prefix>

Important: Reference bandwidth changes only the OSPF metric calculation. It does not change the physical interface speed. Use the same reference-bandwidth setting throughout the OSPF domain.


6.2 SPF (Dijkstra) Algorithm - Step by Step

Neighbor discovery: OSPF Hellos discover and maintain neighbors. Compatible routers form adjacencies where required.

LSA exchange and flooding: routers describe links and reachability using LSAs. Newer LSAs are flooded according to their scope.

LSDB synchronization: routers in the same area build an identical link-state database for that area when the network is stable.

SPF root: each router runs the Shortest Path First (Dijkstra) algorithm with itself as the root of the calculation.

Shortest-path tree: SPF calculates the lowest cumulative OSPF cost to each reachable node/prefix based on the area LSDB.

Route installation: the best OSPF results are offered to the routing table (RIB). The RIB may still compare OSPF AD 110 against other route sources for the same prefix.

Forwarding: installed best routes are programmed into CEF/FIB. Packet forwarding then uses the installed FIB and longest-prefix match; SPF is not run for every packet.

SPF trigger concept: A meaningful topology/LSDB change can cause SPF to run again for the affected area. Multi-area OSPF limits detailed LSA flooding and SPF scope, which is one reason areas improve scalability.


6.3 Route Selection - AD, OSPF Route Type, Cost, and ECMP

  • If the same prefix is learned from different routing sources, the routing table first considers route-source trust using administrative distance. OSPF has AD 110 by default on Cisco IOS/IOS XE.
  • Within OSPF, lower total OSPF cost is preferred for comparable paths to the same destination. Cost is protocol-specific and should not be directly compared with another protocol's metric.
  • OSPF route type also matters: intra-area routes are preferred over inter-area routes, and internal OSPF routes are preferred over external OSPF routes under normal OSPF route-selection rules.
  • If multiple installed OSPF paths have the same best cost and platform/configuration permits, equal-cost multipath (ECMP) can install multiple next hops.
  • After a route is installed into the FIB, packets do not repeatedly compare AD or OSPF cost. The data plane uses longest-prefix match and the programmed next-hop/adjacency information.


 7. Multi-Area OSPFv2 Architecture

Pasted content image

  • In this design, R1 is an Area 1 internal router. R2 is an ABR between Area 1 and Area 0. R3 is an ABR between Area 0 and Area 2. R4 is an Area 2 internal router. Traffic and reachability information between Area 1 and Area 2 crosses the backbone, Area 0.
  • An internal router has all OSPF-enabled interfaces in the same area.
  • An ABR connects two or more areas and maintains a separate LSDB for each attached area.
  • Area 0 is the transit backbone for normal inter-area routing.
  • ABRs do not flood Type 1 and Type 2 LSAs unchanged into another area; they generate inter-area summary information instead.
  • Breaking the domain into areas limits LSA flooding and SPF recalculation scope.


8. Multi-Area Lab Topology and Addressing

Pasted content image

Device

Interface / LAN

IPv4

OSPF area

Role

R1

Gi0/0

10.12.12.1/30

1

Transit to R2

R1

Gi0/1

192.168.10.1/24

1

Area 1 LAN

R2

Gi0/0

10.12.12.2/30

1

Area 1 side

R2

Gi0/1

10.23.23.1/30

0

Backbone side / ABR

R3

Gi0/0

10.23.23.2/30

0

Backbone side / ABR

R3

Gi0/1

10.34.34.1/30

2

Area 2 side

R4

Gi0/0

10.34.34.2/30

2

Transit to R3

R4

Gi0/1

192.168.40.1/24

2

Area 2 LAN

Expected route behavior: R1 should learn 192.168.40.0/24 as O IA through R2. R4 should learn 192.168.10.0/24 as O IA through R3.


9. Configure Multi-Area OSPFv2 - Full Router Examples

R1 - Area 1 internal router

hostname R1

interface GigabitEthernet0/0

ip address 10.12.12.1 255.255.255.252

ip ospf 1 area 1

no shutdown

interface GigabitEthernet0/1

ip address 192.168.10.1 255.255.255.0

ip ospf 1 area 1

no shutdown

router ospf 1

router-id 1.1.1.1

passive-interface GigabitEthernet0/1


R2 - ABR between Area 1 and Area 0

hostname R2

interface GigabitEthernet0/0

ip address 10.12.12.2 255.255.255.252

ip ospf 1 area 1

no shutdown

interface GigabitEthernet0/1

ip address 10.23.23.1 255.255.255.252

ip ospf 1 area 0

no shutdown

router ospf 1

router-id 2.2.2.2


R3 - ABR between Area 0 and Area 2

hostname R3

interface GigabitEthernet0/0

ip address 10.23.23.2 255.255.255.252

ip ospf 1 area 0

no shutdown

interface GigabitEthernet0/1

ip address 10.34.34.1 255.255.255.252

ip ospf 1 area 2

no shutdown

router ospf 1

router-id 3.3.3.3


R4 - Area 2 internal router

hostname R4

interface GigabitEthernet0/0

ip address 10.34.34.2 255.255.255.252

ip ospf 1 area 2

no shutdown

interface GigabitEthernet0/1

ip address 192.168.40.1 255.255.255.0

ip ospf 1 area 2

no shutdown

router ospf 1

router-id 4.4.4.4

passive-interface GigabitEthernet0/1

 

10. Verify Neighbors, Areas, and ABR Status

show ip ospf neighbor

show ip ospf interface brief

show ip ospf

show ip protocols

show ip route ospf

On R2 and R3, the OSPF process should show more than one attached area. R2 should have an Area 1 adjacency toward R1 and an Area 0 adjacency toward R3. R3 should have an Area 0 adjacency toward R2 and an Area 2 adjacency toward R4.

R2# show ip ospf interface brief

Interface PID Area IP Address/Mask State

Gi0/0 1 1 10.12.12.2/30 P2P

Gi0/1 1 0 10.23.23.1/30 P2P

ABR test: If a router has active OSPF interfaces in Area 0 and another area, it functions as an ABR and maintains separate LSDBs for those areas.


11. How Inter-Area Routes Are Learned

Pasted content image

 

R1# show ip route 192.168.40.0

Routing entry for 192.168.40.0/24

Known via "ospf 1", distance 110, metric 4, type inter area

Last update from 10.12.12.2 on GigabitEthernet0/0

 

R1# show ip route ospf

O IA 192.168.40.0/24 [110/4] via 10.12.12.2, GigabitEthernet0/0

The important distinction is route scope. O indicates an intra-area route learned inside the local area. O IA indicates an inter-area route advertised by an ABR.


12. What Is an LSA?

LSA means Link-State Advertisement. An LSA is an OSPF data structure describing a piece of topology or reachability information. LSAs are carried inside Link-State Update packets and stored in the LSDB. SPF uses relevant LSAs to build the shortest-path tree and derive routes.

LSAs have sequence numbers, ages, checksums, advertising-router information, and type-specific fields.

Different LSA types have different originators and flooding scopes.

Routers do not send the entire routing table as periodic distance-vector updates; they synchronize link-state information and flood changed/newer LSAs.

ABRs and ASBRs create special LSAs that allow reachability information to cross area or autonomous-system boundaries.


12.1. LSA Types - Practical Detail

LSA

Practical meaning

Where you will see it

Type 1 - Router

Every router describes its OSPF links in that area.

One Type 1 per router per area; never crosses an ABR.

Type 2 - Network

A DR describes routers attached to a transit multiaccess network.

Broadcast/NBMA segments with a DR; remains inside the area.

Type 3 - Summary / Inter-Area Prefix

ABR advertises prefixes from one area into another.

Core multi-area LSA; O IA routes come from this behavior.

Type 4 - ASBR Summary

ABR advertises reachability to an ASBR.

Needed so other areas can reach the router that originated Type 5 external LSAs.

Type 5 - AS External

ASBR advertises redistributed/external prefixes.

Produces O E1 or O E2 routes; not flooded into stub areas.

Type 7 - NSSA External

ASBR inside an NSSA advertises external prefixes.

Produces O N1/O N2; ABR can translate Type 7 to Type 5.

Types 9/10/11 - Opaque

Extension mechanism with link-, area-, or AS-scoped flooding.

Advanced features; not the normal focus for CCNA troubleshooting.

Rare types: Type 6 (Group Membership) and historical Type 8 usage are not part of ordinary enterprise OSPFv2 routing workflows. Focus first on Types 1, 2, 3, 4, 5, and 7.


14. Verify LSA Types and the LSDB

show ip ospf database

show ip ospf database router

show ip ospf database network

show ip ospf database summary

show ip ospf database asbr-summary

show ip ospf database external

show ip ospf database nssa-external

  • Use show ip ospf database router to inspect Type 1 Router LSAs.
  • Use show ip ospf database network to inspect Type 2 Network LSAs created by DRs.
  • Use show ip ospf database summary to inspect Type 3 inter-area LSAs.
  • Use show ip ospf database asbr-summary for Type 4.
  • Use show ip ospf database external for Type 5 and nssa-external for Type 7 when present.

R1# show ip ospf database summary

OSPF Router with ID (1.1.1.1) (Process ID 1)

 

Summary Net Link States (Area 1)

 

Link ID ADV Router Age Seq# Checksum

192.168.40.0 2.2.2.2 420 0x80000004 0x....


15. LSA Flooding Scope in Multi-Area OSPF

Scope

Examples

Meaning

Area-local

Type 1, Type 2

Detailed internal topology remains in its own area.

Inter-area

Type 3, Type 4

ABRs create summary reachability information for other areas.

AS-wide

Type 5

External prefixes flood through normal areas but are suppressed by some special area types.

NSSA-local then translated

Type 7

Used to carry external routes inside NSSA before ABR translation.

Why areas scale: When a topology change occurs in Area 1, routers in Area 2 generally do not need the complete Area 1 topology. They need the reachability summaries advertised across the backbone.

 

16. OSPF Route Codes in show ip route

Code

Meaning

Selection note

O

Intra-area OSPF route

Calculated from LSAs inside the local area.

O IA

Inter-area OSPF route

Learned from another area through an ABR.

O E1

External Type 1

External metric plus internal OSPF cost to the ASBR/forwarding address.

O E2

External Type 2

External metric dominates; default external type on many OSPF redistributions.

O N1

NSSA External Type 1

Type 7 external with internal cost considered.

O N2

NSSA External Type 2

Type 7 external with Type 2 behavior.

show ip route ospf

show ip route 192.168.40.0

show ip route 0.0.0.0


17. Stub, Totally Stubby, and NSSA Areas - Brief Overview

These area types are useful scaling and policy tools. They are more advanced than the core CCNA single-area objective, but they help explain why Type 5 and Type 7 LSAs behave differently.

Area type

External Type 5 LSAs?

Typical behavior

Normal area

Yes

Receives normal inter-area and external information.

Stub

No

ABR injects a default route; Type 3 inter-area routes may still be present.

Totally stubby (Cisco extension)

No

ABR typically suppresses most inter-area specifics and supplies a default route.

NSSA

Type 5 not injected into area; Type 7 allowed

Permits an ASBR inside a stub-like area; Type 7 can be translated to Type 5 by an ABR.

Totally NSSA (Cisco behavior/extension)

Restricted

Combines NSSA external injection with stronger summary suppression/default behavior.

Design caution: Both ends of an adjacency must agree on compatible area options. A stub/NSSA mismatch can prevent neighbor formation.

 

18. ABR Summarization and Default Route Origination

Inter-area summarization on an ABR

router ospf 1

area 1 range 192.168.0.0 255.255.0.0

The area range command can summarize Type 3 advertisements generated by an ABR for prefixes originating from the specified area. Summarization reduces routing-table and LSDB detail in other areas but must be designed carefully to avoid black holes.


Default route origination from an ASBR

ip route 0.0.0.0 0.0.0.0 203.0.113.1

router ospf 1

default-information originate

When the router has a usable default route, default-information originate can advertise it into OSPF. In a normal area, this is typically represented as an external OSPF route.


19. Multi-Area Verification Workflow

 

Pasted content image

show ip interface brief

show ip ospf neighbor

show ip ospf interface brief

show ip ospf interface <interface>

show ip ospf

show ip ospf database

show ip ospf database summary

show ip route ospf

show ip route <destination>

ping <remote-host>

traceroute <remote-host>


20. Troubleshooting Multi-Area OSPFv2

Symptom

Likely causes

Best checks

No neighbor

Area mismatch, timers, passive interface, auth, subnet, protocol 89 blocked

show ip ospf interface; show ip protocols; ping neighbor

Stuck ExStart/Exchange

MTU mismatch, duplicate RID, unstable link

show interface; show ip ospf neighbor detail; show ip ospf interface

Area neighbors up but remote area route missing

Broken Area 0 path, ABR problem, summarization/filtering, missing originating LAN

show ip ospf; show ip ospf database summary; show ip route ospf

O IA not present

Type 3 LSA not received/installed

show ip ospf database summary; show ip route <prefix>

Unexpected external route code

Redistribution/default origination or NSSA behavior

show ip ospf database external; show run | section router ospf

Wrong best OSPF path

Cost/reference bandwidth mismatch

show ip ospf interface; show ip route <prefix>

DR/BDR unexpected

Priority/RID/startup order; non-preemptive election

show ip ospf interface; show ip ospf neighbor

Sequence matters: Always prove Layer 1/2 and IP reachability first, then OSPF neighbor state, then LSDB information, then RIB installation, and finally end-to-end forwarding.

Quick knowledge check

1. What is the purpose of Area 0 in a multi-area OSPF design?

Answer: Area 0 is the backbone that connects non-backbone areas for normal inter-area routing.

2. Which router role connects Area 0 to another OSPF area?

Answer: Area Border Router (ABR).

3. What routing-table code identifies an OSPF inter-area route?

Answer: O IA.

4. Which LSA type normally carries network reachability from one area into another?

Answer: Type 3 Summary LSA.