CCNA OSPF Neighbours

CCNA OSPF Neighbours

Quiz Page

Test your understanding of key concepts with a short quiz. A quick way to check what you know before moving on.

Lab Page

Hands-on practice exercises to reinforce what you’ve learned. Work through real scenarios in a guided environment.

Notes

Chapter #1 – Finding Neighbours

Cisco routers can (optionally) run OSPF. This is done by starting the OSPF process. There can be multiple OSPF processes on a router, each identified with an ID number.

Once the process is running, OSPF routers need to find neighbouring (or adjacent) routers that also run OSPF. The first part to this is enabling OSPF on interfaces. This is usually done with the network command.

The network command enables OSPF on any interface covered by the given network and wildcard mask, and adds it to the given area. Only area 0 is used in CCNA.

The wildcard mask tells the router which parts of the network address that we’re interested in, and which parts we aren’t. This is similar to a subnet mask, but in reverse.

Once OSPF is enabled on an interface it starts sending hello messages. It will also process any hello messages that it receives. These hello messages enable it to discover adjacent neighbours, and share routing information.

You can see OSPF neighbours with show ip ospf neighbor.

Several criteria must match for two routers to become neighbours:

  • Area number
  • Authentication details (or no authentication)
  • The network and subnet details of adjacent interfaces
  • The timers (hello and dead timers)
  • The MTU of the adjacent interfaces

Each OSPF router has a unique router ID. This must be unique across the entire OSPF topology. The router ID is just a number, but it’s formatted to look like an IP address.

The router ID can be set in three ways:

  1. Manually set in config
  2. If not manually set, use the highest IP on a loopback interface
  3. If there’s no loopback interface, use the highest IP on an active interface

You can find the router ID with show ip ospf. If you change the Router ID, you will need to restart the OSPF process, which is disruptive.

Chapter #2 – Losing Neighbours

Neighbours don’t last forever. They need to be maintained, or they will ‘drop’.

Neighbours regularly send hello messages to each other, which keeps these relationships alive. Sometimes though, these are disrupted, and the neighbour needs to be taken down.

There are three ways this could happen:

  • A disruption of the OSPF process; for example, shutting it down, rebooting the router, or a software fault
  • The router’s interface going down; the router immediately knows there’s a problem and removes the adjacency
  • Hello messages going missing; this means that the neighbour is indirectly inaccessible (e.g. behind a switch)

When neighbour adjacencies fail, the routers in the network will rebuild their ‘map’ of the network to find alternate paths. This is like a detour on your GPS.

To notice when routers go ‘missing’ there are two important timers:

  • Hello timer — how frequently the hello messages are sent
  • Dead timer — how long to wait before declaring a neighbour as dead

The defaults for these depend on the network type. The hello interval could be 10 or 30 seconds by default.

The dead timer is 4x the hello interval by default.

If no hello messages are received within the dead timer period, the neighbour is declared down.

These timers can be tuned to have a more responsive OSPF network.

Command Summary

CommandModeDescription
router ospf <id>Global ConfigStart a new OSPF process
shutdownRouter ConfigShutdown the OSPF process
network <network> <mask> area <id>Router ConfigEnable OSPF on an interface and advertise it
show ip ospfPrivileged ExecShow general OSPF information
show ip ospf interfacePrivileged ExecShow information about OSPF-enabled interfaces
show ip ospf neighborPrivileged ExecShow OSPF neighbours
router-id <id>Router ConfigSet the OSPF router ID
ip ospf hello-interval <seconds>Interface ConfigChange the frequency of hello messages
ip ospf dead-interval <seconds>Interface ConfigChange the dead interval

Additional References

Troubleshoot OSPF Neighbor Problems

OSPF Support for Fast Hello Packets — IOS XE 16

Why Does show ip ospf neighbor Reveal Neighbors Stuck in Two-Way State?