1.10 Troubleshoot OSPFv2 and OSPFv3

ENARSI 300-410 v1.1 · 1.0 Layer 3 Technologies

OSPF is the link-state protocol most enterprise networks run. ENARSI goes past CCNA and ENCOR: OSPFv3 for IPv6 (and IPv4) with address families, authentication, every network type and area type, virtual links, and the exact order in which OSPF chooses a path.

What you must know

OSPFv2 and OSPFv3 address families

OSPFv2OSPFv3
CarriesIPv4IPv6, and IPv4 with address families
Enablenetwork or ip ospf 1 area 0ospfv3 1 ipv6 area 0 (or the old ipv6 ospf 1 area 0) per interface
Neighbours overThe interface's subnetLink-local addresses; subnets need not match
Router IDFrom an IPv4 addressMust be set if the router has no IPv4 address
AuthenticationIn the OSPF header (plain, MD5, SHA)IPsec (AH/ESP) or the RFC 7166 trailer
New LSAs–Type 8 (link) and 9 (intra-area prefix); type 3 is "inter-area prefix"
ipv6 unicast-routing
router ospfv3 1
 router-id 1.1.1.1
 address-family ipv6 unicast
 exit-address-family
 address-family ipv4 unicast
 exit-address-family
!
interface GigabitEthernet0/0
 ipv6 address 2001:db8:12::1/64
 ospfv3 1 ipv6 area 0
 ospfv3 1 ipv4 area 0

R1# show ospfv3 neighbor
          OSPFv3 1 address-family ipv6 (router-id 1.1.1.1)
Neighbor ID     Pri   State           Dead Time   Interface ID    Interface
2.2.2.2           1   FULL/DR         00:00:36    3               Gi0/0

Neighbours and authentication

  1. Same area and same subnet and mask (OSPFv2 on multi-access links).
  2. Same hello and dead timers.
  3. Compatible network types (see the next section).
  4. Same stub/NSSA flag for the area.
  5. Same MTU, or the neighbours stick in EXSTART/EXCHANGE.
  6. Unique router IDs.
  7. Matching authentication type and key (per interface or per area).
interface GigabitEthernet0/0
 ip ospf authentication message-digest
 ip ospf message-digest-key 1 md5 Cisco123
! or SHA with a key chain (IOS 15.4+):
key chain OSPF-SHA
 key 1
  key-string Cisco123
  cryptographic-algorithm hmac-sha-256
interface GigabitEthernet0/0
 ip ospf authentication key-chain OSPF-SHA

R1# debug ip ospf adj
OSPF-1 ADJ   Gi0/0: Rcv pkt from 10.0.12.2 : Mismatched Authentication Key - Message Digest Key 1

Network types, area types, roles and virtual links

Network typeDR/BDRHello/deadNeighbours
broadcast (Ethernet)Yes10/40Automatic
point-to-pointNo10/40Automatic
non-broadcastYes30/120neighbor statements
point-to-multipointNo30/120Automatic; /32 host routes
point-to-multipoint non-broadcastNo30/120neighbor statements

Broadcast on one side and point-to-point on the other does form FULL (the timers match) but the routes fail: one side expects a DR and a network LSA, the other does not. Fix the type, don't just look at the neighbour state.

Area typeBlocksGets insteadASBR inside?
StubType 5Default (type 3)No
Totally stubbyTypes 3 (except the default), 4, 5Default onlyNo
NSSAType 5Type 7 from its own ASBR, turned into type 5 by the ABRYes
Totally NSSATypes 3, 4, 5Default + its own type 7Yes
ABR1(config-router)# area 1 virtual-link 2.2.2.2
ABR2(config-router)# area 1 virtual-link 1.1.1.1

ABR2# show ip ospf virtual-links
Virtual Link OSPF_VL0 to router 1.1.1.1 is up
  Run as demand circuit
  Transit area 1, via interface GigabitEthernet0/0

Routes from area 2 cross into the backbone through the virtual link (1). Router roles: an internal router has all interfaces in one area, a backbone router has one in area 0, an ABR joins area 0 to another area, and an ASBR redistributes external routes.

Which path wins

  1. Intra-area (O) beats inter-area (O IA), whatever the cost.
  2. Inter-area beats external.
  3. E1 (and N1) beats E2 (and N2).
  4. Within one type, the lowest total cost wins (for E2 at equal cost: the lowest forward metric to the ASBR).
  5. Equal costs load-share (4 paths by default).

Cost = reference bandwidth / interface bandwidth, with a default reference of 100 Mbit/s, so Fast Ethernet, Gigabit and 10 Gigabit all cost 1. Set auto-cost reference-bandwidth 100000 on every router, or set ip ospf cost per interface.

Commands

show ip ospf neighbor / show ospfv3 neighborAdjacency state and role per neighbour.
show ip ospf interface [brief]Area, cost, network type, timers, authentication.
show ip ospf database [type]The LSDB; check LSA types per area.
show ip ospf virtual-linksVirtual link state and transit area.
debug ip ospf adjWhy an adjacency fails (authentication, MTU, mismatches).
show ip ospf border-routersABRs and ASBRs this router knows.

Exam traps

Check yourself

Neighbours stuck in EXSTART. Most likely cause?
An MTU mismatch.
What does an NSSA ABR do with a type 7 LSA?
It translates it into a type 5 LSA for the rest of the domain.
Area 3 connects only to area 1. What joins it to the backbone?
A virtual link across area 1 between the two ABRs.
An O IA route costs 5, an O route costs 50 for the same prefix. Which wins?
The O (intra-area) route.
Which LSA types does a totally stubby area block?
Types 3 (except the default), 4 and 5.

Labs

Try it live: OSPF troubleshooting: hello timers, MD5, MTU and network types

More topics in 1.0 Layer 3 Technologies