Layer 3 Technologies · Topic 6 of 8

Troubleshooting OSPFv2 and OSPFv3

Troubleshoot OSPF neighbours, authentication, network types, area types, router types, virtual links and path preference for OSPFv2 and OSPFv3 on IOS XE.

  • 5 min
  • Includes a diagram
In a nutshell
  • Neighbours need matching area, timers, authentication, subnet and MTU.
  • A neighbour stuck in ExStart or Exchange often points to an MTU mismatch.
  • Broadcast and point to point default to 10 and 40. Nonbroadcast and point to multipoint use 30 and 120.

What it is

OSPF is a link state protocol that floods link information within areas and runs the SPF algorithm to build a loop free tree.

OSPFv2 carries IPv4. OSPFv3 was built for IPv6, and on IOS XE it can also carry IPv4 through address families. Both use areas, a backbone area 0, and the same neighbour states.

Troubleshooting starts with the neighbour, then the database, then the routing table.

Downno helloshello seenInitone waytwo way hello2 WayDR electiondatabase exchangeFulladjacent

How it works

Most OSPF faults come from a neighbour that never reaches Full, or from the wrong area or network type design.

Neighbour requirements

Two routers form an adjacency only if these settings agree.

  • Area ID, and the same area type flags such as stub.
  • Subnet and mask on broadcast and nonbroadcast segments.
  • Hello and dead timers.
  • Authentication type and key.
  • MTU on the interfaces, otherwise the neighbour sticks in ExStart or Exchange.
  • A unique router ID on each router.
  • Compatible network types, as the timers depend on the type.

OSPF uses multicast 224.0.0.5 for all routers and 224.0.0.6 for DR routers. OSPFv3 uses FF02::5 and FF02::6.

R1# show ip ospf neighbor
R1# show ip ospf interface GigabitEthernet0/0
R1# debug ip ospf adj

A neighbour stuck in 2-Way on a broadcast link is normal when neither router is the DR or BDR. A neighbour stuck in Init often means a one way problem such as an ACL.

Authentication

OSPFv2 supports plain text and MD5, and newer IOS XE releases add key chain based SHA. OSPFv3 relies on IPsec or an authentication trailer rather than a key in the OSPF header.

R1(config)# interface GigabitEthernet0/0
R1(config-if)# ip ospf authentication message-digest
R1(config-if)# ip ospf message-digest-key 1 md5 MYKEY

The key ID and the key must match on both ends. A difference shows up as authentication failure messages in the logs.

Network types

The network type decides whether a DR is elected and which default timers apply.

Network typeDR electionDefault hello and dead
BroadcastYes10 and 40
Point to pointNo10 and 40
NonbroadcastYes, with manual neighbours30 and 120
Point to multipointNo30 and 120
R1(config-if)# ip ospf network point-to-point

Both ends must use compatible types. Broadcast and point to point share the same default timers, so an adjacency can still form, but one side expects a DR and the other does not, so routing can be wrong.

Area types and router types

Area 2 is detached from area 0. A virtual link between ABR R2 and the ABR with router ID 3.3.3.3 crosses transit area 1, which must not be a stub, to connect area 2 to the backbone.

Area typeBlocksNotes
NormalNothingAccepts internal and external routes
StubType 5 external routesABR injects a default route
Totally stubbyTypes 3, 4 and 5Cisco feature, no-summary on the ABR
NSSAType 5, allows type 7ABR converts type 7 to type 5
Totally NSSATypes 3, 4 and 5nssa no-summary on the ABR
R2(config-router)# area 1 stub no-summary
R2(config-router)# area 1 nssa

Router types describe roles.

  • An internal router has all interfaces in one area.
  • A backbone router has at least one interface in area 0.
  • An ABR connects area 0 to another area.
  • An ASBR redistributes external routes.

Every area must connect to area 0. A virtual link is a tunnel through a transit area that connects a detached area to the backbone. The transit area cannot be a stub.

R2(config-router)# area 1 virtual-link 3.3.3.3

The command names the router ID of the far end and is entered on both ABRs.

Area 2detachedvirtual linkArea 1transit areaconnects toArea 0backbone

Path preference and OSPFv3

OSPF prefers routes by type first, and then by cost. The order is intra area, inter area, external type 1, and external type 2. The cost depends on the interface bandwidth and the reference bandwidth, which defaults to 100 Mbps.

R1(config-router)# auto-cost reference-bandwidth 10000

Set the same reference bandwidth on every router. Otherwise costs are not comparable.

OSPFv3 is enabled on the interface rather than with a network statement.

R1(config)# ipv6 router ospf 1
R1(config-rtr)# router-id 1.1.1.1
R1(config)# interface GigabitEthernet0/0
R1(config-if)# ipv6 ospf 1 area 0
R1# show ipv6 ospf neighbor

OSPFv3 still needs a 32 bit router ID. It forms neighbours using link local addresses.

Exam tip

When an adjacency fails, compare area, timers, authentication, MTU and network type on both sides, in that order.

What to remember for the exam

Eight facts cover most questions on this topic.

  • Neighbours need matching area, timers, authentication, subnet and MTU.
  • A neighbour stuck in ExStart or Exchange often points to an MTU mismatch.
  • Broadcast and point to point default to 10 and 40. Nonbroadcast and point to multipoint use 30 and 120.
  • Broadcast and nonbroadcast networks elect a DR.
  • Stub blocks external routes. Totally stubby also blocks inter area routes.
  • NSSA allows external routes as type 7, converted to type 5 at the ABR.
  • Virtual links cross a non stub transit area.
  • Path preference is intra area, inter area, E1, then E2.
Watch out

A duplicate router ID prevents routes from being exchanged correctly. Set the router ID by hand.

Common mistakes

These five mistakes appear often.

Different network types. Timers and DR behaviour then differ between the two ends.

Ignoring MTU. The adjacency stops before Full.

Making a transit area a stub. The virtual link does not work.

Using different reference bandwidths. Routers calculate different costs for the same link.

Forgetting no-summary on the ABR. The area is only a stub, not totally stubby.

Check yourself

Work through these three questions.

  • A neighbour is stuck in ExStart. What do you check first?

    Check for an MTU mismatch between the two interfaces.

  • Which area type allows external routes but blocks type 5 flooding?

    An NSSA, because it carries external routes as type 7 and the ABR converts them to type 5.

  • What order does OSPF use to prefer routes?

    Intra area, then inter area, then external type 1, then external type 2.

Topic 6 of 8 in Layer 3 Technologies

Test yourself on Layer 3 Technologies

The full Cisco CCNP 300-410 ENARSI question bank has 857 questions, with timed practice exams and an explanation for every answer.

This study guide is independent and is not affiliated with, endorsed by, or sponsored by Cisco. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.