From point A to point B
Point A: you configure OSPF, type show ip ospf neighbor and the list comes back empty. You don't know where to start, so you try commands at random. Point B: by the end of this chapter you will recognize each neighbor failure by its symptom and know what to check first.
In the class, Jesús breaks the neighbor relationship on purpose, case by case, on a single link. Each failure leaves a different footprint at the console. Once you recognize it, troubleshooting stops being guesswork.
- The lab and the list of neighbor failures
- Layers 1 and 2: HDLC versus PPP encapsulation
- Duplicate router ID, mask and area
- OSPF not enabled and passive-interface
- An ACL that leaves the neighbor stuck in INIT
- Timers, stub flag and authentication
The lab and the list of failures
The whole chapter happens in the first lab of the class: R1 and R2 joined by a point-to-point serial link, network 40.40.40.0/24, in area 0. Each router has a fixed router ID (0.0.0.1 and 0.0.0.2), and OSPF is enabled directly on the interface with ip ospf 1 area 0.
The lab for this chapter: two routers, one serial link and ten failures caused on purpose. Diagram: The House of Routing.
R1(config)# router ospf 1
R1(config-router)# router-id 0.0.0.1
R1(config-router)# exit
R1(config)# interface serial 0/0
R1(config-if)# ip address 40.40.40.1 255.255.255.0
R1(config-if)# ip ospf 1 area 0
R1(config-if)# end
R1# show ip ospf neighbor
The class slides sum up the most common causes:
- Interface down at layer 1 or layer 2.
- OSPF not enabled on the interface.
- Passive-interface.
- An ACL that blocks OSPF traffic.
- A different subnet mask on a broadcast network.
- Duplicate router ID.
- Mismatches in authentication, hello or dead interval, stub area type, area ID or MTU.
You will see MTU in chapter 4, with the ExStart state. Everything else gets broken and fixed in this chapter.
The link first: layers 1 and 2
OSPF works with messages. If they don't cross the link, there is no neighbor. The first question is always: is the interface up?
On Cisco serial interfaces, the default layer 2 encapsulation is HDLC. In the class, Jesús changes only one end to PPP. It is a mistake that happens in the field: a new service arrives with a modem or CSU/DSU, someone configures PPP or Frame Relay on one side and forgets the other.
R1(config)# interface serial 0/0
R1(config-if)# encapsulation ppp
R1(config-if)# end
R1# show interfaces serial 0/0
! Serial0/0 is up, line protocol is down -> layer 1 up, layer 2 down
! the fix: the same encapsulation on the other end
R2(config)# interface serial 0/1
R2(config-if)# encapsulation ppp
The result is clear: layer 1 stays up and layer 2 goes down (line protocol is down). Without layer 2 the Hellos don't get through and the neighbor disappears. Once the encapsulation matches, the neighbor comes back on its own, all the way to FULL.
Router ID, mask and area
Duplicate router ID
The first case in the class: R1 gets the router ID of R2, 0.0.0.2. IOS warns that the change won't apply until the process restarts: the router ID is not preemptive.
! the mistake: R1 takes the router ID of R2
R1(config)# router ospf 1
R1(config-router)# router-id 0.0.0.2
R1(config-router)# end
R1# clear ip ospf process
! the log warns of a duplicate router ID from 40.40.40.2
! the fix: a unique router ID, then clear the process again
R1(config)# router ospf 1
R1(config-router)# router-id 0.0.0.1
R1(config-router)# end
R1# clear ip ospf process
When the process is cleared, the log reports a duplicate router ID coming from 40.40.40.2 and the neighbor doesn't come up. There is only one fix: a unique router ID per router. Set it by hand with a simple pattern: router 1, 0.0.0.1; router 2, 0.0.0.2.
Different mask: it depends on the network type
People often say the mask must match. That's true, but not always. In the class, R1 moves to 40.40.40.1 255.0.0.0 while R2 keeps /24, and the neighbor stays in FULL.
RFC 2328 explains why: the Hello carries the mask and it must match on the network, except on point-to-point links and virtual links, where it is ignored. On broadcast networks such as Ethernet, a different mask does prevent the neighbor relationship. Even so, don't do this in production.
A different area on each end
OSPF is a link-state protocol: the neighbor relationship forms with the directly connected router, and both ends must be in the same area. If you move one end to area 10, that router goes from FULL to DOWN right away.
! one end of the link in another area: FULL to DOWN
R2(config)# interface serial 0/1
R2(config-if)# ip ospf 1 area 10
! the fix: the same area on both ends
R2(config-if)# ip ospf 1 area 0
The interesting detail is on the other router: it stays in FULL a few more seconds. It waits for the dead interval, 40 seconds on point-to-point, before declaring the neighbor dead. When you know you configured OSPF and still see no neighbor, check the router ID and the area first.
OSPF enabled and passive-interface
OSPF not enabled on the interface
It's the most human mistake on the list. No network command covers the interface and there is no ip ospf 1 area 0 on it. The dead timer counts down and the neighbor dies.
R1# show running-config interface serial 0/0
R1# show running-config | section ospf
! no network command and no ip ospf on the interface: no Hellos
R1(config)# interface serial 0/0
R1(config-if)# ip ospf 1 area 0
The two things OSPF does on an interface
When OSPF is enabled on an interface, two things happen. First, it takes that interface's network and advertises it in its LSAs. Second, it starts sending Hellos on it to look for neighbors.
With passive-interface you cancel only the second one: the interface stops sending Hellos, but its network is still advertised. Use it on links toward your provider, on an ASBR that also speaks EIGRP or BGP, or on LANs without routers. Sending Hellos where there are no neighbors is a security hole.
! the mistake: the serial link toward R1 goes passive
R2(config)# router ospf 1
R2(config-router)# passive-interface serial 0/1
! the fix: talk again on the link and silence the loopback
R2(config-router)# no passive-interface serial 0/1
R2(config-router)# passive-interface loopback 0
R2(config-router)# end
R2# show ip protocols
In the class, the mistake is putting it on serial 0/1 of R2, the one facing R1. R2 stops saying hello and the neighbor drops on both sides. debug ip ospf hello confirms it: no Hello goes out every 10 seconds. The interface is up and OSPF is enabled; the clue shows up in show ip protocols, which lists the passive interfaces.
The fix is to bring the serial back with no passive-interface and make the loopback passive, since it will never have neighbors. Network 2.2.2.2/32 is still advertised in R2's type 1 LSA.
An ACL that leaves the neighbor in INIT
An ACL meant to filter other traffic can end up blocking OSPF. OSPF doesn't use TCP or UDP: it rides directly on IP as protocol 89. In the class, R1 gets an inbound extended ACL that only lets ICMP through.
! an ACL that only lets ICMP in (equivalent to the one in the class)
R1(config)# ip access-list extended ACL_NO_OSPF
R1(config-ext-nacl)# deny ospf any any
R1(config-ext-nacl)# permit icmp any any
R1(config-ext-nacl)# exit
R1(config)# interface serial 0/0
R1(config-if)# ip access-group ACL_NO_OSPF in
R1(config-if)# end
R1# show ip access-lists
R2# show ip ospf neighbor
! the fix: remove the ACL (or permit OSPF, IP protocol 89)
R1(config)# interface serial 0/0
R1(config-if)# no ip access-group ACL_NO_OSPF in
R1 keeps sending Hellos; the ACL only filters what comes in. But it no longer receives R2's Hellos, so its dead timer runs down to zero and it removes the neighbor. On the other side, R2 still receives R1's Hellos, but its own router ID no longer appears in them. R2 is stuck in INIT.
With the inbound ACL on R1, each router sees a different failure. Diagram: The House of Routing.
On point-to-point and broadcast networks, you send a Hello and wait for the neighbor's Hello with your router ID in its list. If you see yourself, you move to 2-WAY; if not, you stay in INIT. On NBMA networks with manually configured neighbors there is also the ATTEMPT state, which you will see in chapters 3 and 4.
The fix is to remove the ACL or to permit OSPF explicitly. When you see INIT, think: I'm not receiving Hellos, or I receive them and don't see myself in them.
What the Hello requires to match
The Hello carries the parameters both neighbors must share. If one of them doesn't match, the Hello is dropped.
The fields a neighbor checks in every Hello. Diagram: The House of Routing.
Hello interval and dead interval
On point-to-point and broadcast networks, the hello interval is 10 seconds and the dead interval is 40, four times the hello. In the class, Jesús changes the hello to 5 on R1, and the dead interval moves to 20 on its own.
R1# show ip ospf interface serial 0/0
R1(config)# interface serial 0/0
R1(config-if)# ip ospf hello-interval 5
R1(config-if)# end
R1# debug ip ospf adj
! OSPF: Mismatched hello parameters from 40.40.40.2
! Dead R 40 C 20, Hello R 10 C 5 (R = received, C = configured)
! the fix: the same timers on the other end
R2(config)# interface serial 0/1
R2(config-if)# ip ospf hello-interval 5
The debug says it all: R means received and C means configured. R1 receives 10 and 40, but it has 5 and 20. Once the hello matches on R2, the neighbor comes back.
Also look at the dead timer in show ip ospf neighbor. With hello 5 and dead 20, it never drops below 15: every Hello that arrives resets it. That is the window OSPF has to declare the neighbor down.
Stub flag: the E-bit
The Hello carries an options field. One of its bits is the E-bit, External Routing Capability, which says whether the area accepts type 5 LSAs, the external routes injected by an ASBR. In a normal area the bit is 1; in a stub area, 0. If it doesn't match between neighbors, the Hello is dropped.
! area 0 cannot be stub, so the link moves to area 1
R1(config)# interface serial 0/0
R1(config-if)# ip ospf 1 area 1
R2(config)# interface serial 0/1
R2(config-if)# ip ospf 1 area 1
! only R2 declares the area stub: the E-bit no longer matches
R2(config)# router ospf 1
R2(config-router)# area 1 stub
! the fix: the same area type on every router of the area
R2(config-router)# no area 1 stub
To test it, the class moves the link to area 1, because area 0, the backbone, can't be stub and IOS rejects it. With both ends in area 1, R2 receives R1's loopback, which is still in area 0, as an O IA, inter-area, route. When only R2 declares area 1 stub, the neighbor drops.
The rule: if one router says stub, so does the other; if it's NSSA, both are NSSA. Also, OSPF works in a single area even if it isn't area 0, but with several areas all of them must touch area 0 through an ABR or a virtual link. You will study stub areas in depth in chapter 4.
Authentication
OSPF has three authentication types: null (type 0, the default), plain text (type 1) and cryptographic (type 2, with MD5 or, per RFC 5709, HMAC-SHA). You can enable it on the interface or in the process for the whole area, but the key is always configured on the interface.
R1(config)# interface serial 0/0
R1(config-if)# ip ospf authentication
! debug: mismatched authentication type (received type 0, we use type 1)
R1(config-if)# ip ospf authentication-key thor123
R2(config)# interface serial 0/1
R2(config-if)# ip ospf authentication
R2(config-if)# ip ospf authentication-key thor123
! same type and same key: the neighbor comes back
There are two ways to break the neighbor: a different type on each end, or the same type with different keys. The debug tells them apart: first a mismatched authentication type and, if you change the key, a mismatched clear-text key.
debug and show still tell the truth.Your troubleshooting method
With every case on the table, the method falls into place. Go from the bottom up and check one thing at a time.
| Symptom | Likely cause | What to check |
|---|---|---|
| Interface up, line protocol down | Mismatched encapsulation or layer 2 down | show interfaces |
| No Hellos going out | OSPF not enabled or passive-interface | debug ip ospf hello, show ip protocols |
| One side in INIT | Inbound ACL or Hellos not arriving | show ip access-lists |
| Mismatched hello parameters | Hello, dead or mask on broadcast | show ip ospf interface |
| Neighbor never shows up | Duplicate router ID, area, stub flag or authentication | debug ip ospf adj, show running-config | section ospf |
R1# show ip ospf neighbor
R1# show interfaces serial 0/0
R1# show ip ospf interface serial 0/0
R1# show running-config | section router
R1# show ip protocols
R1# show ip access-lists
R1# debug ip ospf hello
R1# debug ip ospf adj
R1# undebug all
Jesús closes with an idea for the whole marathon: configure OSPF deterministically. Before you type a command, you already know the result you expect. That is the foundation of the CCIE: solving problems where many technologies meet.
And a study tip: OSPF is huge, so break it into parts; you eat an elephant one bite at a time. Break the router in your lab, make mistakes and take notes. Every mistake is a learning moment.
Class videos
These are parts 3 and 4 of the first OSPF marathon, recorded live with Cisco IOSv routers in GNS3, debug and Wireshark. The audio is in Spanish, with subtitles in Spanish, English, French and Portuguese.
- Day 1 · Part 3OSPF neighbor troubleshooting: router ID, area, PPP, ACL and passive-interfaceWatch video
- Day 1 · Part 4OSPF neighbors: hello and dead, stub flag and mismatched authenticationWatch video
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
Test what you learned
1. R1 and R2 are joined by a point-to-point serial link with /8 and /24 masks. Do they become neighbors?
Answer. Yes. On point-to-point links the mask in the Hello is ignored. On a broadcast network such as Ethernet, the difference would prevent the neighbor relationship.
2. A router is stuck in INIT with its neighbor. What does it mean?
Answer. It receives the neighbor's Hellos, but its own router ID doesn't appear in them. The neighbor isn't receiving its Hellos, for example because of an inbound ACL that blocks protocol 89.
3. You apply passive-interface to an OSPF interface. What does it stop doing, and what does it keep doing?
Answer. It stops sending Hellos, so it forms no neighbors there. Its network is still advertised in the LSAs. That's why it's used on loopbacks, LANs without routers and links toward other domains.
4. You change the hello interval to 5 seconds on R1 only. What dead interval will R1 have, and what happens to the neighbor?
Answer. The dead interval becomes 20, four times the hello. Since R2 still has 10 and 40, the debug shows “Mismatched hello parameters” and there is no neighbor until the timers match.
5. Why can't you configure area 0 stub?
Answer. Area 0 is the backbone, and RFC 2328 states that it can't be configured as a stub area. IOS rejects the command. To test the stub flag, the link was moved to area 1.
Key takeaways
- Check from the bottom up: layer 1, layer 2, OSPF enabled, passive-interface, ACL and Hello parameters.
- The router ID must be unique and the change is not preemptive: apply it with
clear ip ospf process. - Area, hello, dead, authentication and stub flag must match; the mask only on broadcast networks.
- passive-interface silences the Hellos, but the network is still advertised.
- OSPF travels as IP protocol 89; an ACL that blocks it leaves the neighbor stuck in INIT.
- Area 0 can't be stub, and every area must touch the backbone through an ABR or a virtual link.
- Configure deterministically: before the command, you already know the result you expect.
Official resources
- Troubleshoot Common Problems with OSPFcisco.com
- Understand OSPF Neighbor Statescisco.com
- Why Does the show ip ospf neighbor Command Reveal Neighbors in the Init State?cisco.com
- Configure Authentication in Open Shortest Path Firstcisco.com
- IP Routing: OSPF Command Reference (A through ip ospf demand-circuit)cisco.com
- IP Routing: OSPF Command Reference (ip ospf fast-reroute per-prefix through R)cisco.com
- RFC 2328: OSPF Version 2rfc-editor.org
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. The technical data and configuration were checked against official Cisco documentation and IETF RFCs.