Overview
OSPF is the primary CCNA dynamic routing protocol — link-state operation, neighbor adjacencies, DR/BDR on multi-access segments, and single-area configuration. OSPFv3 extends the same logic to IPv6.
OSPF at a glance
Open Shortest Path First (OSPF) is a link-state IGP. Each router describes its links in link-state advertisements (LSAs), floods them within an area, and every router builds the same link-state database (LSDB). Each router then runs Shortest Path First (SPF / Dijkstra) to compute best paths.
- Layer 3 protocol — rides directly on IP, protocol 89 (not TCP/UDP)
- Metric: cost (lower is better); default reference bandwidth 100 Mbps
- Administrative distance: 110
- Multicast: All OSPF routers 224.0.0.5; DR/BDR 224.0.0.6
Link = router interface. State = description of that interface and its relationship to neighbors (IP, mask, network type, attached routers). All link states form the LSDB.
OSPF packet types
| Type | Name | Purpose |
|---|---|---|
| 1 | Hello | Discover/maintain neighbors; carry timer/area/auth/stub flags |
| 2 | DBD (Database Description) | Summary of LSAs in LSDB |
| 3 | LSR (Link State Request) | Request full LSA details |
| 4 | LSU (Link State Update) | Carries LSAs (often response to LSR) |
| 5 | LSAck | Acknowledges LSU |
Hello timers (defaults):
| Network type | Hello | Dead |
|---|---|---|
| Broadcast / Point-to-Point | 10 sec | 40 sec |
| NBMA / Point-to-Multipoint | 30 sec | 120 sec |
Dead interval = 4 × hello (IOS adjusts dead automatically when hello changes).
Neighbor adjacency requirements
Hello parameters must match for adjacency:
- Hello and dead intervals
- Area ID
- Authentication (if configured)
- Stub area flag
- Subnet on the link (same network)
Bi-directional communication is confirmed when a router sees its own Router ID in a neighbor's Hello.

Neighbor state machine — Down through Full.
From study charts · jdepew88 CCNA notes

Key fields in show ip ospf neighbor output.
From study charts · jdepew88 CCNA notes
OSPF 24-byte common header.
From study charts · jdepew88 CCNA notes
Router ID and process ID
Router ID (RID): 32-bit dotted decimal identifying the router in OSPF.
- Manually configured
router-id - Highest loopback IP (if any)
- Highest active physical interface IP when OSPF starts
Best practice: set a loopback or manual RID so an interface flap does not change identity.
Process ID: 1–65535, locally significant — does not need to match neighbors. Allows multiple OSPF processes on one router (uncommon at CCNA).
router ospf 1 router-id 1.1.1.1 network 10.0.0.0 0.255.255.255 area 0
Modern alternative — enable OSPF per interface:
interface GigabitEthernet0/0
ip ospf 1 area 0
ip ospf cost 10
OSPF network uses a wildcard mask, not a subnet mask. network 192.168.1.0 0.0.0.255 area 0 enables OSPF on interfaces in 192.168.1.0/24.
Single-area design (CCNA focus)
Area 0 is the OSPF backbone. CCNA labs typically place all routers in Area 0 only — still know that multi-area designs require every non-backbone area to connect through Area 0.
Cisco recommends ≤ ~50 routers per area for scalability. Multi-area designs use ABRs (Area Border Routers) for summarization and reduced LSA flooding.
DR/BDR on multi-access segments
On broadcast (Ethernet) and NBMA networks, OSPF elects a Designated Router (DR) and Backup DR (BDR) to reduce LSA flooding.
- DROTHER routers form FULL adjacency only with DR and BDR — not with each other (2-WAY state between DROTHERs)
- Point-to-point links (serial HDLC/PPP): no DR/BDR election
- Election per segment, not per router globally
Election criteria:
- Highest priority (1–255; default 1; 0 = ineligible for DR/BDR)
- Highest Router ID if priority ties
Non-preemptive by default: Changing priority after election does not displace the current DR until OSPF process reset on segment.
Default OSPF cost by interface bandwidth.
From study charts · jdepew88 CCNA notes
Cost formula: cost = reference bandwidth ÷ interface bandwidth (default reference = 10⁸ bps = 100 Mbps).
auto-cost reference-bandwidth 1000
Adjust on all routers when Gigabit+ links make default costs misleading.
interface GigabitEthernet0/0
ip ospf priority 110
ip ospf cost 50
LSA types (awareness)
| Type | Name | Generated by |
|---|---|---|
| 1 | Router LSA | Every router — links in area |
| 2 | Network LSA | DR on multi-access segment |
| 3 | Summary LSA | ABR — routes between areas |
| 4 | ASBR Summary | ABR — path to ASBR |
| 5 | External LSA | ASBR — routes from outside OSPF |
CCNA single-area labs focus on Type 1 and Type 2.
OSPFv3 (IPv6)
OSPFv3 supports IPv6 prefixes and 128-bit addresses. OSPFv2 and OSPFv3 are independent — they can run simultaneously but do not speak to each other.
| Feature | OSPFv2 | OSPFv3 |
|---|---|---|
| Address family | IPv4 | IPv6 |
| Configuration | router ospf + network | Interface-level ipv6 ospf |
| Neighbor addresses | IPv4 interface IP | IPv6 link-local |
| All-router multicast | 224.0.0.5 | FF02::5 |
| DR/BDR multicast | 224.0.0.6 | FF02::6 |
| Protocol number | 89 | 89 |
| Router ID | 32-bit (IPv4 format) | Same 32-bit RID (manual on IPv6-only) |
ipv6 unicast-routing ! interface GigabitEthernet0/0 ipv6 address 2001:db8:1::1/64 ipv6 ospf 1 area 0 ! router ospfv3 1 router-id 1.1.1.1
Pure IPv6 networks have no IPv4 from which to derive a Router ID — configure router-id explicitly under router ospfv3.
Verification commands
For a lab submission workflow with grouped show commands and an x-remote YAML playbook (multi-router capture), see OSPF CLI Verification.
show ip ospf neighbor show ip ospf interface brief show ip ospf database show ip ospf lsdb show ip route ospf show ip protocols show ip ospf
Neighbor states to know:
| State | Meaning |
|---|---|
| DOWN | No Hello heard |
| INIT | Hello seen, not bidirectional |
| 2-WAY | Bidirectional; DROTHERs stop here on MA |
| EXSTART/EXCHANGE | Master/slave DBD exchange |
| LOADING | LSR/LSU for missing LSAs |
| FULL | LSDB synchronized — adjacency complete |
Troubleshooting
| Issue | First checks |
|---|---|
| No neighbor | Same subnet? Area match? Hello/dead timers? ACL blocking proto 89? |
| Stuck EXSTART | MTU mismatch on link |
| Stuck 2-WAY | Normal for DROTHERs; problem if DR should be FULL |
| No OSPF routes | network/ip ospf covers interface? Passive interface? |
| Suboptimal path | Manual cost, reference bandwidth, or missing link in topology |
show ip ospf neighbor is always the first command — no FULL, no synchronized LSDB.
Exam checklist
Even in "single-area" OSPF, that area is Area 0. Multi-area designs require inter-area traffic to transit the backbone.
DR/BDR election happens on multi-access segments only. A router can be DR on one Ethernet segment and DROTHER on another.
passive-interface stops Hellos on an interface — no neighbors form, but the interface network is still advertised if covered by network or not excluded.
Quick review
- OSPF is link-state: LSAs → LSDB → SPF → routing table
- Neighbors use multicast 224.0.0.5; DR/BDR use 224.0.0.6
- DR/BDR reduce LSA floods on Ethernet; P2P links skip election
- Cost = reference BW ÷ link BW; AD = 110
- OSPFv3 uses IPv6 link-locals, FF02::5/FF02::6, and interface-level config
- Verify with
show ip ospf neighbor— target state FULL