DEV Community

zNetLaB
zNetLaB

Posted on Originally published at Medium

Troubleshooting OSPF neighbour problems: a checklist with commands

An OSPF neighbour that will not come up is one of the most common faults in routed networks, and one of the easiest to diagnose if you follow the same order every time. This checklist walks from the cable to the adjacency state machine. The commands are IOS and IOS XE style; other platforms have close equivalents.

First, read the state

R1# show ip ospf neighbor
Neighbor ID  Pri  State        Dead Time  Address     Interface
2.2.2.2      1    FULL/BDR     00:00:34   10.0.12.2   GigabitEthernet0/0
Enter fullscreen mode Exit fullscreen mode

The state tells you where to look. If the neighbour does not appear at all, start at step 1. If it appears but is not FULL, jump to the state table further down.

Step 1: is the link actually up?

R1# show ip interface brief
Interface            IP-Address   OK? Method Status  Protocol
GigabitEthernet0/0   10.0.12.1    YES manual up      up
Enter fullscreen mode Exit fullscreen mode

Both columns must say up. If the status is administratively down, run no shutdown. If it is up/down, you have a Layer 2 problem: the other side is shut, the cable is wrong, or the encapsulation does not match. Do not touch OSPF until a ping to the neighbour works:

R1# ping 10.0.12.2
Enter fullscreen mode Exit fullscreen mode

If the ping fails, check the addresses and masks. Two routers on the same link must be in the same subnet. A /24 on one side and a /30 on the other is a classic error that still pings sometimes.

Step 2: is OSPF running on the interface?

R1# show ip ospf interface brief
Interface  PID  Area  IP Address/Mask   Cost  State  Nbrs F/C
Gi0/0      1    0     10.0.12.1/30      1     DR     1/1
Enter fullscreen mode Exit fullscreen mode

If the interface is missing from this list, your network statement did not match it, or the interface-level ip ospf 1 area 0 command was never applied. Remember how a network statement works: the address and wildcard mask select interfaces whose configured IP falls inside that range. A common mistake is writing a subnet mask where a wildcard mask belongs.

router ospf 1
 network 10.0.12.0 0.0.0.3 area 0
Enter fullscreen mode Exit fullscreen mode

The wildcard for a /30 is 0.0.0.3, not 255.255.255.252.

Also check for passive-interface. A passive interface advertises its network but sends no hellos, so no neighbour will ever form on it.

R1# show ip protocols
Enter fullscreen mode Exit fullscreen mode

Under "Passive Interface(s)" make sure your link is not listed.

Step 3: do the hello parameters match?

Two routers form an adjacency only if these match on the shared link:

  • Area ID
  • Hello and dead timers
  • Authentication type and key
  • Subnet and mask (on broadcast networks)
  • Area type flags such as stub or NSSA
  • MTU (matters at the database exchange stage)

Look at both ends:

R1# show ip ospf interface g0/0
  Process ID 1, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 1
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
Enter fullscreen mode Exit fullscreen mode

Compare the hello and dead values with the other router. If one side has 10/40 and the other 30/120, there will be no adjacency. A quick way to see mismatches as they happen is a debug, used carefully on a lab or a quiet device:

R1# debug ip ospf hello
OSPF-1 HELLO Gi0/0: Mismatched hello parameters from 10.0.12.2
Enter fullscreen mode Exit fullscreen mode

Turn it off afterwards with undebug all. On production devices prefer logs and show commands first, since debugs can load a busy CPU.

You can set timers explicitly to fix a mismatch:

interface g0/0
 ip ospf hello-interval 10
 ip ospf dead-interval 40
Enter fullscreen mode Exit fullscreen mode

Step 4: area, authentication and stub flags

Areas must match. A link cannot be in area 0 on one router and area 1 on the other.

R1# show ip ospf interface g0/0 | include Area
Enter fullscreen mode Exit fullscreen mode

Authentication has to agree as well. A configured key on one side only produces a mismatch message in the debug output such as an authentication type mismatch, and the neighbour never appears.

R1# show ip ospf interface g0/0 | include authentication
Enter fullscreen mode Exit fullscreen mode

For stub and NSSA areas, every router in the area must agree that it is a stub or NSSA, otherwise the hello's option bits differ and the packets are rejected.

Step 5: the neighbour state table

State you see What it usually means Where to look
Nothing No hellos exchanged Steps 1 to 4: link, passive, area, timers, auth
DOWN No hello received recently Link failure, ACL blocking protocol 89, wrong network type
INIT You hear them, they do not hear you One-way traffic, ACL, multicast filtering, a different-subnet address
2WAY Normal on a broadcast segment between two non-DR routers Check priorities if you expect FULL
EXSTART / EXCHANGE Stuck exchanging database descriptions MTU mismatch, duplicate router ID, unicast reachability
LOADING Stuck requesting LSAs Corrupt or filtered LSAs, MTU, resource problems
FULL Healthy Done

INIT: one-way hellos

INIT means R1 has received a hello from R2, but R2's hello does not list R1 yet. The cause is usually something that blocks traffic in one direction. Check for an access list on an interface or a firewall in the path that permits OSPF in only one direction. OSPF uses IP protocol 89 and multicast addresses 224.0.0.5 and 224.0.0.6, so a permit for TCP or UDP will not help.

R1# show ip access-lists
R1# show ip interface g0/0 | include access list
Enter fullscreen mode Exit fullscreen mode

2WAY: not always a problem

On Ethernet segments with a DR and BDR, routers that are neither only reach 2WAY with each other. That is normal; they reach FULL with the DR and BDR only. The state looks like this:

Neighbor ID  Pri  State         Dead Time  Address     Interface
3.3.3.3      1    2WAY/DROTHER  00:00:37   10.0.0.3    GigabitEthernet0/0
Enter fullscreen mode Exit fullscreen mode

If you expected FULL and every router has priority 0, nobody can be DR. Check:

R1# show ip ospf interface g0/0 | include Priority
Enter fullscreen mode Exit fullscreen mode

At least one router on the segment needs a priority above 0.

EXSTART or EXCHANGE: stuck on the database exchange

This is nearly always an MTU mismatch. Two routers agree they are neighbours, start swapping database description packets, and one side drops packets it considers too large. Compare:

R1# show interfaces g0/0 | include MTU
R2# show interfaces g0/0 | include MTU
Enter fullscreen mode Exit fullscreen mode

Fix the MTU so both ends agree. The workaround ip ospf mtu-ignore exists, but fixing the MTU is the better answer because a mismatch can also cause real traffic to be dropped.

Another cause is duplicate router IDs. Two routers cannot form a clean adjacency if they claim the same ID.

R1# show ip ospf | include Router ID
Enter fullscreen mode Exit fullscreen mode

Set each ID explicitly and restart the process:

router ospf 1
 router-id 1.1.1.1
R1# clear ip ospf process
Enter fullscreen mode Exit fullscreen mode

FULL but routes missing

An adjacency can be healthy while the routing table is wrong. Check what was learned:

R1# show ip route ospf
R1# show ip ospf database
Enter fullscreen mode Exit fullscreen mode

If a network is missing, verify that the interface behind it is included in OSPF. A passive interface with a network statement still advertises the prefix, which is the correct way to publish a user LAN.

Step 6: network type surprises

OSPF assumes a network type per interface: broadcast on Ethernet, point-to-point on serial or tunnels, non-broadcast on frame-relay-style setups. Both ends must agree on timers and election behaviour. If one end is point-to-point and the other is broadcast, the hello and dead defaults can differ and no DR logic matches.

R1# show ip ospf interface g0/0 | include Network Type
Enter fullscreen mode Exit fullscreen mode

On a point-to-point Ethernet link between two routers, setting both ends to the same type removes the DR election and speeds convergence:

interface g0/0
 ip ospf network point-to-point
Enter fullscreen mode Exit fullscreen mode

A compact order of operations

  1. show ip ospf neighbor: what state, or nothing?
  2. show ip interface brief and ping: Layer 1 to 3 okay?
  3. show ip ospf interface brief: is OSPF on the interface? Passive?
  4. show ip ospf interface: area, timers, network type, priority.
  5. show ip protocols: router ID, networks, passive list.
  6. Compare both ends: MTU, authentication, area type.
  7. Access lists and firewalls: is protocol 89 permitted both ways?
  8. Last resort: debug ip ospf adj and debug ip ospf hello in short bursts, then undebug all.

A practice scenario

The fastest way to remember this checklist is to meet the faults, not read about them. A good drill is a lab where two routers show a timer mismatch: you see the neighbour missing, read the interface timers on both sides, and fix one. There is a ready-made free example in the zNetLaB guided labs, OSPF timer mismatch troubleshooting, which runs in the browser. The same break-and-fix drill also works in Packet Tracer, GNS3 or any other simulator: build two routers, change one hello interval, and watch the neighbour disappear.

Summary

OSPF problems follow a pattern: no neighbour means hello problems (link, passive, area, timers, authentication), INIT means one-way traffic, 2WAY means check roles, EXSTART means MTU or duplicate IDs. Work from the bottom of the stack to the top, compare both ends, and change one thing at a time. After a while this checklist becomes automatic.

Disclosure: written by the zNetLaB team.

Top comments (0)