PDF(49.9 KB) View with Adobe Reader on a variety of devices
ePub(86.7 KB) View in various apps on iPhone, iPad, Android, Sony Reader, or Windows Phone
Mobi (Kindle)(80.9 KB) View on Kindle device or Kindle app on multiple devices
Updated:November 28, 2022
The documentation set for this product strives to use bias-free language. For the purposes of this documentation set, bias-free is defined as language that does not imply discrimination based on age, disability, gender, racial identity, ethnic identity, sexual orientation, socioeconomic status, and intersectionality. Exceptions may be present in the documentation due to language that is hardcoded in the user interfaces of the product software, language used based on RFP documentation, or language that is used by a referenced third-party product. Learn more about how Cisco is using Inclusive Language.
This document describes the information contained in the show ip ospf neighbor command output.
Cisco recommends that you have knowledge of these topics:
A basic understanding of IP routing protocols
The OSPF routing protocol in general
The information in this document is based on the software and hardware versions:
Cisco IOS® Software Release 12.2(10b)
Cisco 2500 Series Routers
The information in this document was created from the devices in a specific lab environment. All of the devices used in this document started with a cleared (default) configuration. If your network is live, ensure that you understand the potential impact of any command.
An interface data structure stores information from a network to which it is connected. With this information, an Open Shortest Path First (OSPF) router builds hello packets. These hello packets are exchanged between directly-connected neighbors to learn more about each other. You can use the show ip ospf neighbor command to observe the neighbor data structure. This command displays OSPF-related neighbor information.
Neighbor Data Structure
This diagram and show ip ospf neighbor command output are used as an example:
Router2# show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
192.168.45.1 1 FULL/DR 00:00:36 10.0.0.1 Ethernet0
The next sections describe the show ip ospf neighbor command output from the previous example.
The Neighbor ID is the router ID of the neighbor router. The router ID is the highest IP address or the highest ip address among loopback addresses (if one is configured) on the Cisco router or can be configured manually by "router-id x.x.x.x". In the previous example, Router 1 has a loopback address, 192.168.45.1, which becomes the router ID. Once the router ID is chosen, it cannot changed unless the OSPF process is reset (clear ip ospf process xx) or the router is reloaded. And IP address of router ID does not need to be reachable.
The Pri field indicates the priority of the neighbor router. The router with the highest priority becomes the designated router (DR). If the priorities are the same, then the router with the highest router ID becomes the DR. By default, priorities are set to 1. A router with a priority of 0 never becomes a DR or a backup designated router (BDR); it is always a DROTHER, that means a router that is neither the DR or the BDR.
The State field indicates the functional state of the neighbor router. Refer to OSPF Neighbor States for more information about states. FULL means the router is fully adjacent with its neighbor. The neighbor is the DR, so it is Router 1.
The Dead Time field indicates the amount of time that remains as the router waits to receive an OSPF hello packet from the neighbor before it declares the neighbor is down. On broadcast and point-to-point media, the default dead interval is 40 seconds. On non-broadcast and point-to-multipoint links, the default dead interval is 120 seconds. In the previous example, the Dead Time is 36 seconds before the neighbor 192.168.45.1 is declared down.
The Address field indicates the IP address of the interface to which this neighbor is directly connected. In the case of unnumbered links, this field shows the IP address of the interface to which the neighbor is unnumbered. When OSPF packets are transferred to the neighbor, this address is the destination address. In the previous example the interface IP address of the neighbor is 10.0.0.1.
The Interface field indicates the interface on which the OSPF neighbor has formed adjacency. In the previous example the neighbor can be reached through Ethernet 0.