Pcornel
Networking · Routing

OSPF (Open Shortest Path First)

Cheat sheet · https://pcornel.dk/topic.php?topic=626

Back to the Topic

Answer

OSPF is a link-state routing protocol: routers form adjacencies, exchange a description of every link in their area, and each computes the shortest paths itself. Large networks are split into areas joined through area 0.

Remember

Neighbours must agree on area, subnet, hello and dead timers, authentication, area type, network type and MTU. FULL is the normal end state (2WAY between two non-DR routers on a LAN). Every area must touch area 0.

First checks

  • show ip ospf neighbor — neighbours with state and DR/BDR role.
  • show ip ospf interface brief — OSPF interfaces, area, cost, state.
  • show ip ospf interface <interface> — timers, network type, priority, authentication.
  • show ip ospf database — the LSAs per area.
  • show ip route ospf — the routes OSPF installed.
  • show ip protocols — router ID, areas, passive interfaces.

Commands

show ip ospf interface <interface>
Inspect area, network type, interface cost, DR/BDR role, timers and participation.
show ip ospf neighbor
Read peer Router ID, state, dead timer and interface. Interpret state against network type and DR/BDR roles.
show ip ospf neighbor detail
Inspect adjacency transitions and per-neighbor detail before changing or resetting a process.
show ip ospf database
Locate the relevant LSA and area; database presence is separate from route installation.
show ip ospf database router
Inspect Type 1 router LSAs within their area.
show ip ospf database network
Inspect Type 2 network LSAs originated by a DR on a transit multiaccess network.
show ip ospf database summary
Inspect Type 3 inter-area network information originated by an ABR.
show ip route <destination>
Find the longest matching installed prefix, its source, next hop and interface. Use the matching VRF/address-family syn…
show ip cef <prefix> detail
Compare local forwarding with the selected route and resolved next hop. This does not prove hardware forwarding or deli…
show ip protocols
Inspect active IPv4 routing processes and their advertised networks, filters and routing sources.
default-information originate [always]
Originate a default route into OSPF according to configured conditions.
show ip ospf
Is the OSPF process running and which Router ID/areas exist?
show ip ospf interface
Is the interface participating with the expected area/type/timers/cost?
show ip route ospf
Did the route reach the RIB?
show ip route
Did the route reach the RIB?
show ip ospf statistics

Verify in this order

interface in OSPF and not passive → hellos match → 2WAY → DR/BDR elected on broadcast links → database exchange → FULL → LSAs in the database → SPF → routes installed

Where it usually breaks

underlay/interface reachability → protocol adjacency/session → received/originated state → policy → best path/RIB → FIB/adjacency → traffic path

OSPF neighbor states

StateMeaningHigh-value next check
DOWN / no neighborNo usable neighbor relationshipInterface/IP, area, Hello visibility, passive state, authentication
INITHello received, but two-way visibility is missingOne-way path / peer Hello content
2-WAYBidirectional Hello relationshipNormal on some multiaccess DROTHER relationships; check whether FULL is actually expected
EXSTARTDatabase-description negotiation has not completedMTU, Router ID/negotiation, interface stability
EXCHANGEDatabase descriptions are being exchangedMTU/DBD stability and duplicate Router ID evidence
LOADINGMissing LSAs are being requested/receivedLS requests/updates and adjacency stability
FULLExpected database synchronization completedContinue to LSDB → RIB → CEF for reachability questions

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=626

Confirmation

Confirm action

Continue?