Routelearn.net
Course menu

Course 9: OSPFLesson 2.2 (4 of 4 in this course)65 of 91 in the CCNA series

Verifying and troubleshooting OSPF

show ip ospf neighbor, interface and database, and the mismatches that stop adjacencies forming.

Intermediate · 12 min read

OSPF troubleshooting is the process of finding why OSPF routes are missing or wrong by checking each layer in order: interface state and addressing, OSPF-enabled interfaces, neighbour state, the link-state database and finally the routing table. Common causes include area, timer and MTU mismatches, passive interfaces and duplicate router IDs.

In simple terms: When routes go missing, you check things from the bottom up: are the links working, are the routers talking, and did they share their maps? The first step that fails is where the fault is.

A real-life situation

After a night of maintenance, users on LAN 3 call in: they can reach their own server but nothing at head office on LAN 1. R3 can ping R2's interface 10.0.23.1, so the cable is fine. Yet show ip route on R3 shows no OSPF routes at all. One small change made during the night broke the adjacency. This lesson shows how to find it quickly, in a fixed order, using the lab from Configuring single-area OSPFv2.

Gi0/2Gi0/1 .1.2 Gi0/010.0.12.0/30Gi0/1 .1.2 Gi0/010.0.23.0/30Gi0/0Gi0/2Gi0/1ISP203.0.113.1R1RID 1.1.1.1R2RID 2.2.2.2R3RID 3.3.3.3LAN 1192.168.1.0/24LAN 2192.168.2.0/24LAN 3192.168.3.0/24
  1. 1. Layer 3 works. R3 can ping 10.0.23.1, so the link and addressing are fine.
  2. 2. But OSPF does not. R2 receives R3's hellos and throws them away because a setting doesn't match.
  3. 3. So R3 has no route to LAN 1. Without a neighbour, R3 learns nothing, and users on LAN 3 can't leave their own network.

What you are checking

OSPF builds routes in layers, and each layer depends on the one below it. So you troubleshoot in the same order, from the bottom up:

1. Interfaces up and addressed?
show ip interface brief: up/up, correct IP and mask, ping the neighbour.
2. Interfaces running OSPF?
show ip ospf interface brief: listed, right area, not passive where a neighbour should be.
3. Neighbours Full?
show ip ospf neighbor: every expected neighbour present and FULL (or 2WAY between DROthers).
4. LSAs in the database?
show ip ospf database: every router's LSA is there.
5. Routes in the table?
show ip route ospf: the O routes are present and use the expected path and cost.
A fixed order for OSPF problems. Stop at the first step that fails: that is where the fault is.

Why it works this way

Without a neighbour, no LSAs are exchanged. Without LSAs, SPF has nothing to calculate. And even with a correct database, a route only appears if it wins against other sources in the routing table. So a missing route can be caused at any layer, but the layer where things first look wrong tells you what kind of fault it is. Jumping straight to the routing table hides that information.

The key show commands, and what each one answers:

CommandAnswers
show ip protocolsRouter ID, network statements, passive interfaces, which routers it learns from
show ip ospf interface briefWhich interfaces run OSPF, area, cost, state, neighbour count
show ip ospf interface <if>Timers, network type, priority, DR/BDR, passive status for one interface
show ip ospf neighborNeighbours and their state
show ip ospf databaseThe LSAs this router holds (its copy of the map)
show ip route ospfWhich OSPF routes won and were installed
show ip ospfProcess details: router ID, reference bandwidth, areas, SPF runs

How to verify a healthy network

Know what "good" looks like, so a broken output stands out. On R2 in the working lab:

Example output · based on Cisco documentation; exact format varies by platform and software version
R2#show ip ospf neighbor
Neighbor ID     Pri   State           Dead Time   Address         Interface
3.3.3.3           0   FULL/  -        00:00:34    10.0.23.2       GigabitEthernet0/1
1.1.1.1           0   FULL/  -        00:00:39    10.0.12.1       GigabitEthernet0/0
Both expected neighbours, both FULL, on point-to-point links (hence - instead of DR or BDR).
Example output · based on Cisco documentation; exact format varies by platform and software version
R2#show ip ospf database
            OSPF Router with ID (2.2.2.2) (Process ID 1)

                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
1.1.1.1         1.1.1.1         612         0x80000004 0x00A1B2 3
2.2.2.2         2.2.2.2         598         0x80000005 0x003C4D 5
3.3.3.3         3.3.3.3         601         0x80000003 0x00E5F6 3

                Type-5 AS External Link States

Link ID         ADV Router      Age         Seq#       Checksum Tag
0.0.0.0         1.1.1.1         640         0x80000001 0x00D7E8 1
One router LSA (type 1) per router in the area, identified by its router ID. Every router in area 0 should show exactly the same list. The Link count grows with the number of links: each point-to-point neighbour counts twice (the link and its subnet), each LAN once. The type 5 entry is the default route R1 injects. There are no type 2 LSAs because no link elects a DR. (Checksums here are illustrative.)

Fault 1: area mismatch

The night's change: someone re-enabled OSPF on R3's Gi0/0 with ip ospf 1 area 1. R2's side is still in area 0.

Step 1 of 2 · Hello (area 0.0.0.1)
R2
Gi0/1 10.0.23.1 · area 0
R3
Gi0/0 10.0.23.2 · area 1
Result
Neighbour:
never forms
R3 routes:
connected only
R2 rejects every hello from R3 because the area ID in the OSPF header doesn't match.
Example output · based on Cisco documentation; exact format varies by platform and software version
%OSPF-4-ERRRCV: Received invalid packet: mismatched area ID from backbone area
must be virtual-link but not found from 10.0.23.2, GigabitEthernet0/1
The router tells you directly: wrong area, from 10.0.23.2. (The exact text varies by version.) Confirm on R3 with show ip ospf interface brief: the Area column shows 1.
interface GigabitEthernet0/0 ip ospf 1 area 0

On R3. Both ends of a link must be in the same area. Re-entering the command with the right area replaces the old one.

Fault 2: hello or dead timer mismatch

One router has ip ospf hello-interval 5 and the other uses the default 10. Symptoms: no neighbour, no log message by default. Compare both ends:

show ip ospf interface GigabitEthernet0/1 | include Timer

Shows the line: Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5. Run it on both routers and compare.

debug ip ospf hello will also report "Mismatched hello parameters", as shown in OSPF neighbours and adjacencies. Fix by making the values equal, or remove both with no ip ospf hello-interval and no ip ospf dead-interval.

Fault 3: passive interface on a router link

A tidy-up added passive-interface default to R2 but forgot the no passive-interface lines. Both neighbours disappear, and the interfaces still look perfect in show ip ospf interface brief except for the neighbour count of 0/0.

Example output · based on Cisco documentation; exact format varies by platform and software version
R2#show ip protocols | begin Passive
  Passive Interface(s):
    GigabitEthernet0/0
    GigabitEthernet0/1
    GigabitEthernet0/2
  Routing Information Sources:
    Gateway         Distance      Last Update
    1.1.1.1              110      00:12:30
    3.3.3.3              110      00:12:30
The router links are listed as passive. The Routing Information Sources list still shows old entries for a while; trust the neighbour table, not this list.
router ospf 1 no passive-interface GigabitEthernet0/0 no passive-interface GigabitEthernet0/1

On R2. LAN 2 (Gi0/2) stays passive, which is what you want.

Fault 4: stuck in EXSTART or EXCHANGE (MTU mismatch)

Example output · based on Cisco documentation; exact format varies by platform and software version
R2#show ip ospf neighbor
Neighbor ID     Pri   State           Dead Time   Address         Interface
3.3.3.3           0   EXSTART/  -     00:00:36    10.0.23.2       GigabitEthernet0/1
1.1.1.1           0   FULL/  -        00:00:39    10.0.12.1       GigabitEthernet0/0
Hellos work (the routers got past 2-Way), but the database exchange never completes. The state may sit in EXSTART or EXCHANGE, and can drop back and retry. A router may log that it gave up retransmitting database descriptions.

Each DBD packet carries the sender's IP MTU (the largest IP packet the interface can send). If R3's Gi0/0 has ip mtu 1400 and R2's Gi0/1 has the default 1500, R2 rejects R3's DBDs. Check show interfaces (MTU) and show ip interface (IP MTU, written as "MTU is ... bytes") on both ends.

interface GigabitEthernet0/0 no ip mtu

On R3: return to the default so both ends use 1500. The workaround ip ospf mtu-ignore makes OSPF skip the check, but it hides the real problem and large packets can still be dropped.

Fault 5: duplicate router ID

R3 was replaced overnight, and the new router was configured from a copy of R2's saved configuration, including router-id 2.2.2.2. Router IDs name routers in every LSA, so two routers with the same ID corrupt everyone's map.

Example output · based on Cisco documentation; exact format varies by platform and software version
%OSPF-4-DUP_RTRID_NBR: OSPF detected duplicate router-id 2.2.2.2 from 10.0.23.2 on interface GigabitEthernet0/1
The log names the duplicate ID and where it came from. Check show ip ospf | include ID on the suspect routers.
router ospf 1 router-id 3.3.3.3 end clear ip ospf process

On the new R3. The new router ID only takes effect after the OSPF process restarts (IOS asks you to confirm).

Fault 6: neighbours Full, but a route is missing

All neighbours are Full, yet R1 has no route to LAN 3 (192.168.3.0/24). The adjacency is fine, so look higher up:

  • Not advertised. On R3, show ip ospf interface brief does not list Gi0/1. Its network statement is wrong, for example network 192.168.3.0 0.0.0.0 area 0, which only matches an interface whose address is exactly 192.168.3.0. Use network 192.168.3.1 0.0.0.0 area 0 or network 192.168.3.0 0.0.0.255 area 0.
  • A better source wins. R1 still has an old static route ip route 192.168.3.0 255.255.255.0 10.0.12.2. Static routes have an administrative distance of 1, OSPF 110, so the routing table shows S instead of O. OSPF knows the route (it is in the database) but it lost. See Administrative distance and metric.
  • Network type mismatch. One end of a link is point-to-point and the other broadcast. The neighbours can reach Full, but routes through that link are missing. Compare Network Type in show ip ospf interface.
  • Wrong path, not missing. If the route is there but uses an unexpected path, compare interface costs and check that auto-cost reference-bandwidth is the same on all routers (show ip ospf | include Reference).
Example output · based on Cisco documentation; exact format varies by platform and software version
R1#show ip route 192.168.3.0
Routing entry for 192.168.3.0/24
  Known via "static", distance 1, metric 0
  Routing Descriptor Blocks:
  * 10.0.12.2
      Route metric is 0, traffic share count is 1
"Known via static": the leftover static route is beating OSPF. Remove it with no ip route 192.168.3.0 255.255.255.0 10.0.12.2 and the OSPF route (cost 30) is installed.

Common mistakes

  • Starting with the routing table. Check neighbours first: most OSPF faults are adjacency faults.
  • Checking only one side of a link. Mismatches only show when you compare both ends.
  • Assuming 2WAY/DROTHER is a fault on Ethernet segments.
  • Changing the router ID and forgetting clear ip ospf process.
  • Using ip ospf mtu-ignore as a permanent fix instead of correcting the MTU.
  • Forgetting that old static routes override OSPF because of their lower administrative distance.

💡 Exam tip: CCNA questions often show two routers' configurations or show ip ospf interface outputs and ask why they are not neighbours. Compare area, subnet and mask, hello/dead timers, passive interfaces and router IDs; the process ID is the usual distractor. Know that EXSTART/EXCHANGE points to an MTU mismatch, that 2WAY between DROthers is normal, and which command shows what: neighbours, interfaces, database, routes.

Key takeaways

✅ Key takeaways
  • Troubleshoot bottom-up: interface, OSPF enabled, neighbour, database, routing table.
  • No neighbour: area, subnet, timers, authentication, passive interface, or an ACL.
  • Stuck in EXSTART/EXCHANGE: MTU mismatch or duplicate router ID.
  • Full but no route: not advertised, a lower-AD route wins, or a network type mismatch.
  • Log messages and both ends' show ip ospf interface usually reveal the mismatch.

Check yourself

Predict · scenario 1

R2 and R3 can ping each other, but show ip ospf neighbor on R2 is empty. R3's interface shows Area 1 and R2's Area 0. What's the fix?

Predict · scenario 2

A neighbour sits in EXSTART. Hello and dead timers match. What do you check next?

Predict · scenario 3

All neighbours are Full. R1 has no OSPF route to 192.168.3.0/24, and show ip route 192.168.3.0 says Known via "static". Why?

Predict · scenario 4

Which command shows whether a router holds a router LSA from every other router in the area?

Predict · scenario 5

You changed router-id on R3 from 2.2.2.2 to 3.3.3.3, but show ip ospf still shows 2.2.2.2. Why?

FAQ

What does it mean when show ip ospf neighbor shows nothing?
The router has not received a valid hello on any OSPF interface. Check that the interfaces are up, enabled for OSPF and not passive, then compare area, subnet, timers and authentication with the router on the other end.
My neighbours are Full but a route is missing. Where do I look?
Check whether the remote router actually advertises the network (is its interface in OSPF?), then look in the LSDB with show ip ospf database, and finally check whether another route with a lower administrative distance, such as a static route, is winning in the routing table.
Is it safe to use debug ip ospf on a production router?
Hello and adjacency debugs on a small router are usually fine for a short time, but debugs use CPU and can flood the console on a busy router. Prefer show commands and log messages first, debug for as short a time as possible, and turn it off with undebug all.
Why does a neighbour stay in EXSTART or EXCHANGE?
The routers can talk (hellos work) but cannot finish the database description exchange. The classic CCNA cause is an IP MTU mismatch on the link. Duplicate router IDs can also cause it.