An OSPF Neighbor Relationship Cannot Be Established
Procedure
- Check whether the physical status and protocol status of interfaces on both ends are Up and stable, whether packet loss occurs on the interfaces, and whether the two devices can ping each other with large packets.
If the physical status of the interfaces is not Up or is unstable (interfaces flap for example), check the physical link and link layer protocol and ensure that the physical status and protocol status of the interfaces are Up and that the interfaces have no error packet statistics.
You can perform a ping test for a long time to check whether any packet loss occurs on the interfaces and ping with large packets (longer than 1500 bytes) to check whether the two devices can ping each other with large packets.
- Check whether the OSPF processes on the two devices have the same router ID.
Run the display ospf [ process-id ] brief command on the two devices to check the OSPF process router IDs.
Each router ID must be unique on the entire network. Otherwise, devices on both ends cannot establish OSPF neighbor relationships and routing information errors will occur. You need to configure a unique router ID for each OSPF process on the devices.
If the OSPF processes on the two devices have the same router ID, run the ospf [ process-id ] router-id router-id command in the system view to change the router ID for one of the OSPF processes and ensure that the OSPF processes on the two devices have different router IDs.
After the router ID is changed for one of the processes, you must run the reset ospf [ process-id ] process command in the user view to make the new router ID take effect.
- Check whether the two devices have the same OSPF area ID.
Run the display ospf [ process-id ] brief command on the two devices to check the OSPF area IDs.
If the two devices have different OSPF area IDs, run the area area-id command in the OSPF view to change one of the OSPF area IDs and ensure that the two devices have the same OSPF area ID.
- Check whether OSPF interfaces on both ends have the same network type.
Run the display ospf [ process-id ] interface command on the two devices to check the OSPF interface network types.
The network types of the OSPF interfaces on both ends of a link must be the same; otherwise, the two interfaces cannot establish an OSPF neighbor relationship.
If the network types of the two OSPF interfaces are different, run the ospf network-type { broadcast | nbma | p2mp | p2p } command in the view of one of the OSPF interfaces to change the network type of the interface and ensure that the two OSPF interfaces have the same network type.
If the network types of OSPF interfaces on both ends are NBMA, you must run the peer ip-address [ dr-priority priority ] command in the OSPF view to configure NBMA neighbors.
- Check whether OSPF interfaces on both ends have the same IP address mask.
Run the display current-configuration interface interface-type interface-number command on the two devices to check the IP address of the specified OSPF interface.
The IP address masks of the OSPF interfaces on both ends of a link must be the same; otherwise, the two interfaces cannot establish an OSPF neighbor relationship. On a P2MP network, however, you can run the ospf p2mp-mask-ignore command in the OSPF interface view to disable a device from checking the network mask so that an OSPF neighbor relationship can be established.
If the two OSPF interfaces have different IP address masks, run the ip address ip-address { mask | mask-length } command in the view of one of the OSPF interfaces to change the IP address mask of the interface and ensure that the two OSPF interfaces have the same IP address mask.
- Check whether IP addresses of the two OSPF interfaces on both ends belong to the network segment specified in the network command.
Run the display current-configuration interface interface-type interface-number command on both ends to check the IP addresses of the OSPF interfaces and run the display current-configuration configuration ospf command on both ends to check the OSPF process configuration.
OSPF can run on an interface only when the following conditions are met:
- The mask length of the interface's IP address is longer than or equal to that specified in the network command. OSPF uses reverse mask. For example 0.0.0.255 indicates that the mask length is 24 bits.
- The primary IP address of the interface belongs to the network segment specified in the network command.
If the IP address of an interface does not meet the preceding conditions, run the ip address ip-address { mask | mask-length } command in the OSPF interface view to change the IP address of the interface or run the network command in the view of the area that the OSPF process belongs to change the configured network segment so that the IP address of the interface can meet the preceding conditions.
- Check whether the DR priorities of OSPF interfaces on both ends are 0.
Run the display ospf [ process-id ] interface command on the two devices to check the OSPF interface DR priority.
On a broadcast or NBMA network, there must be at least one OSPF interface with a non-zero DR priority to ensure that the DR can be elected. Otherwise, the neighbor status of devices on both ends can be only 2-way.
If the DR priorities of the two OSPF interfaces are both 0, run the ospf dr-priority priority command in the OSPF interface view to change the DR priority and ensure that there is at least one OSPF interface with a non-zero DR priority.
- Run commit
The configuration is committed.