Sub topic 15
Verifying Neighbors, Interfaces, Database, and Routes
This chapter assumes you know IPv4 addressing, basic router interface configuration, longest-prefix match, and the OSPF concepts from earlier chapters: Hello packets, the neighbor state machine, the link-state database (LSDB), LSA types, and cost. The commands use Cisco IOS syntax. FRRouting offers close equivalents, such as show ip ospf neighbor and show ip ospf database.
A Verification Order That Follows the Protocol
OSPF builds routes in a fixed sequence. Interfaces send Hellos, Hellos create neighbors, neighbors become adjacent, adjacencies exchange LSAs, the LSDB feeds SPF, and SPF installs routes. If you check the same things in the same order, a failure shows up at the first layer that is wrong, and the layers after it are only symptoms.
The commands are:
show ip ospf neighbor
show ip ospf interface brief
show ip ospf database
show ip route ospfStep 1: Interfaces
Start with show ip ospf interface brief. It confirms that OSPF is enabled on each interface you intended.
R1# show ip ospf interface brief
Interface PID Area IP Address/Mask Cost State Nbrs F/C
Gi0/2 1 0 192.168.1.1/24 10 DR 0/0
Gi0/1 1 0 10.0.13.1/30 20 P2P 1/1
Gi0/0 1 0 10.0.12.1/30 10 P2P 1/1Check each column:
- Interface: A missing interface means no
ip ospfcommand ornetworkstatement matched it. The interface is not in OSPF. - Area: Both ends of a link must agree on the area. A mismatch prevents a neighbor from forming.
- Cost: Compare the value with what you planned. Gi0/1 shows 20 because of a manual
ip ospf cost 20. Gi0/0 shows 10 because the reference bandwidth is 10 Gbps and the link runs at 1 Gbps. - State:
P2Pmeans point-to-point.DR,BDR, andDROTHERappear on broadcast segments.WAITmeans the router is still waiting to learn whether a DR already exists. ADOWNstate means the interface itself is down. - Nbrs F/C: The first number is the neighbors in Full state. The second is the neighbors discovered.
1/1is healthy.0/1means a neighbor was seen but no adjacency formed.
Gi0/2 is the passive LAN. It shows 0/0 neighbors, which is correct, because a passive interface sends no Hellos. It still advertises its prefix.
For more detail on one interface, use show ip ospf interface GigabitEthernet0/0. It lists the Hello and Dead timers, the network type, the DR and BDR, and whether authentication is enabled.
Step 2: Neighbors
show ip ospf neighbor shows each neighbor's state.
R1# show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
2.2.2.2 0 FULL/ - 00:00:36 10.0.12.2 GigabitEthernet0/0
3.3.3.3 0 FULL/ - 00:00:33 10.0.13.2 GigabitEthernet0/1The Neighbor ID is the neighbor's router ID, not an interface address. The Address column is the neighbor's interface address on the shared link. The dash after FULL/ appears on point-to-point links, where no DR is elected.
Interpret the state column as follows:
| State shown | Meaning | Normal? |
|---|---|---|
| FULL | LSDBs are synchronized | Yes |
| 2WAY on a broadcast segment | Two DROTHER routers see each other but stay at 2-Way | Yes, between two non-DR routers |
| 2WAY on a point-to-point link | Hellos work but the adjacency did not progress | Investigate |
| INIT | Hellos are received but the neighbor does not list this router | Investigate: one-way traffic, ACL, or authentication |
| EXSTART or EXCHANGE | Database exchange cannot proceed | Investigate: often an MTU mismatch |
| LOADING | Requested LSAs have not arrived | Investigate if it persists |
The Dead Time counts down from the dead interval and resets each time a Hello arrives. If you see it constantly near zero, Hellos are being lost.
Step 3: The Link-State Database
Neighbors can be Full and still leave you without routes if an LSA is missing. Use show ip ospf database to check.
R1# show ip ospf database
OSPF Router with ID (1.1.1.1) (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 412 0x80000005 0x00A1B2 4
2.2.2.2 2.2.2.2 398 0x80000004 0x00C3D4 3
3.3.3.3 3.3.3.3 405 0x80000004 0x00E5F6 3Look for these things:
- One Type 1 (Router) LSA per router in the area. A router absent from the list is not flooding into this area.
- Type 2 (Network) LSAs for each broadcast segment that has a DR.
- Type 3, 4, and 5 LSAs in multi-area or redistributed designs. The headings are Summary Net Link States, Summary ASB Link States, and Type-5 AS External Link States.
- Age. LSAs refresh every 30 minutes, so ages normally stay below 1800 seconds. An age that climbs toward 3600 means the originator is no longer refreshing it.
- Sequence numbers. A number that climbs rapidly points to a flapping link or two routers sharing a router ID.
Every router in an area should show the same set of LSAs for that area. If R1 and R3 disagree, flooding is broken somewhere between them.
Step 4: Routes
show ip route ospf shows what SPF installed.
R1# show ip route ospf
10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks
O 10.0.23.0/30 [110/20] via 10.0.12.2, 00:10:14, GigabitEthernet0/0
O IA 10.1.0.0/16 [110/30] via 10.0.12.2, 00:05:02, GigabitEthernet0/0
O E2 172.16.0.0/16 [110/20] via 10.0.13.2, 00:03:41, GigabitEthernet0/1The code tells you the route type: O is intra-area, O IA is inter-area, O E1 and O E2 are external, and O N1 and O N2 are NSSA external. The bracket shows [administrative distance/metric]. OSPF uses administrative distance 110. For an E2 route the metric stays the same along the whole path, so it does not reflect the internal cost to the ASBR.
A prefix can be missing from the route table even when its LSA is in the LSDB. Common causes are the next hop being unreachable, a lower administrative distance from another protocol (such as a static route), or a Type 5 LSA whose ASBR cannot be reached.
Worked Example: Tracing a Missing LAN
Suppose R1 cannot reach 192.168.3.0/24 behind R3. Work down the layers:
- On R3,
show ip ospf interface briefshows the LAN interface is absent. OSPF is not enabled there. - After you add
ip ospf 1 area 0to that interface,show ip ospf databaseon R1 shows R3's Type 1 LSA with an increased sequence number. show ip route ospfon R1 now listsO 192.168.3.0/24.
Starting at the routing table would only have shown the route missing. Working from the interface layer found the cause directly.
Exercise
On a point-to-point link, show ip ospf neighbor shows the neighbor stuck in EXSTART, while Hellos are clearly being exchanged. Which layer of the verification order is the problem at, and what is a likely cause?
Show answer
The problem is at the neighbor layer, in the database exchange phase. Hello processing works, because the neighbor was discovered and moved past Init and 2-Way. The usual cause is an MTU mismatch between the two interfaces, which makes the Database Description packets fail. Compare the MTU on both ends with show interface and correct it, or use ip ospf mtu-ignore as a stopgap.
Exercise
R1's route table lacks a prefix, but show ip ospf database on R1 shows the Type 1 LSA of the router that owns it. Name two things to check next.
Show answer
Check whether the next hop toward the originating router is reachable, since SPF cannot install a route through an unreachable path. Also check whether another source with a lower administrative distance, such as a static route, already provides that prefix. A prefix filter or summary route covering the prefix is a third possibility.