OSPF - manual neighbor configuration

OSPF has certain network types that do not automatically create neighbor adjacencies. These network types are Non-Broadcast Multi-Access (NBMA) and Point to Multipoint Non-broadcast (PtMP-NB).

These network types don't inherently support broadcast or multicast capabilities for OSPF Hello packets. Thus, in order to form neighbor adjacencies, OSPF requires that a manual configuration of the neighbors be implemented so that unicast Hello packets can be sent directly to the indicated IP address. This can be done using the neighbor command under the ospf router configuration mode. An example of such a configuration can be found below:

R1(config)#router ospf 1 R1(config-router)#neighbor R1(config-router)#neighbor

In the above configuration, two neighbors have been manually configured.

When this is configured, an interesting behavior will be noted:

When you configure one OSPF router with the neighbor command, that router starts sending unicastunicast Hello packets to the specified neighbor. The receiving router (even if it hasn’t been configured with the corresponding neighbor command yet) will see those Hello packets and process them. If the Hello packets meet the criteria for forming an adjacency (matching area, subnet, hello/dead timers, etc.), the receiving router will respond with its own Hello packets and an adjacency can form.

So you can form an adjacency with the neighbor command applied only to one of the OSPF routers.

Note also that NBMA network type OSPF routers will also listen on the OSPF multicast router group for hello packets, and will respond with unicast hellos creating an adjacency.

However, this doesn’t mean the configuration is complete or optimal. For a resilient and predictable OSPF over NBMA network, both sides should be manually configured with neighbor commands to ensure that unicast Hellos are initiated in both directions. This also ensures that if one side is restarted or its OSPF process is reset, it will still attempt to re-establish the adjacency once it comes back up.

Although the OSPF adjacency can form with just one side configured, you should always configure both sides for best practices and operational predictability.