OSPFEXEC

show ip ospf neighbors

Displays OSPF neighbor information on Cisco NX-OS devices.

Overview

The 'show ip ospf neighbors' command is a fundamental troubleshooting tool for OSPF (Open Shortest Path First) on Cisco NX-OS (Nexus) devices. OSPF is a link-state routing protocol that uses hello packets to discover and maintain neighbor relationships. This command displays the current state of all OSPF neighbors, including their router IDs, interface addresses, priority, state, dead timer, and the local interface through which they are reachable. On NX-OS, OSPF process ID and VRF context are important; the command can be scoped to a specific VRF or interface. The output is critical for verifying that OSPF adjacencies have formed correctly after configuration changes or during network incidents. In troubleshooting workflows, engineers first check neighbor states to ensure they are FULL (or 2WAY for DROTHER on broadcast networks). Stuck states like EXSTART or EXCHANGE often indicate MTU mismatches or authentication issues. The dead timer field shows the time since the last hello was received; if it reaches zero, the neighbor is declared dead. The command also helps identify DR/BDR roles on multi-access networks, which affect routing behavior. NX-OS supports multiple OSPF processes and VRFs, so specifying the VRF is essential in multi-VRF environments. The 'detail' option provides additional information such as neighbor uptime, retransmission queue length, and LS Ack list, which are useful for diagnosing packet loss or adjacency flapping. Overall, this command is the first step in any OSPF troubleshooting process on Nexus switches.

Syntax·EXEC
show ip ospf [vrf {vrf-name}] neighbors [interface {interface-type number}] [neighbor-id] [detail]

When to Use This Command

  • Verify OSPF neighbor adjacency status after configuration changes.
  • Troubleshoot OSPF neighbor state transitions (e.g., stuck in EXSTART/EXCHANGE).
  • Monitor OSPF neighbor count and dead timer expiration.
  • Check OSPF neighbor details for a specific interface or VRF.

Parameters

ParameterSyntaxDescription
vrfvrf {vrf-name}Specifies the VRF (Virtual Routing and Forwarding) instance. If omitted, the default VRF is used. Useful in multi-VRF environments to isolate OSPF neighbor information per VRF.
interfaceinterface {interface-type number}Filters neighbors to a specific interface. For example, 'Ethernet1/1'. Helps focus on a single link when troubleshooting.
neighbor-idneighbor-idDisplays details for a specific neighbor by its router ID. Useful for checking a single adjacency.
detaildetailProvides extended information including DR/BDR addresses, neighbor uptime, retransmission statistics, and LS Ack list. Essential for in-depth troubleshooting.

Command Examples

Basic OSPF Neighbor Display

show ip ospf neighbors
OSPF Process ID 1 VRF default
Total number of neighbors: 2
Neighbor ID     Pri State           Dead Time   Address         Interface
10.1.1.1        1   FULL/DR         00:00:35    192.168.1.2     Ethernet1/1
10.2.2.2        1   FULL/BDR        00:00:38    192.168.2.2     Ethernet1/2

Shows two neighbors: 10.1.1.1 is the DR (Designated Router) with FULL state, 10.2.2.2 is the BDR (Backup Designated Router). Dead Time counts down from 40 seconds.

Detailed OSPF Neighbor Information

show ip ospf neighbors detail
 Neighbor 10.1.1.1, interface address 192.168.1.2
   In the area 0.0.0.0 via interface Ethernet1/1
   Neighbor priority is 1, State is FULL, 6 state changes
   DR is 192.168.1.2, BDR is 192.168.1.1
   Options is 0x52
   Dead timer due in 00:00:35
   Neighbor is up for 02:15:30
   Index 1/1/1, retransmission queue length 0, number of retransmission 0
   First 0x0(0)/0x0(0) Next 0x0(0)/0x0(0)
   Last retransmission scan length is 0, time is 0 msec
   LS Ack list: 0

Detailed output shows neighbor state changes, DR/BDR roles, options field, uptime, and retransmission statistics. Zero retransmissions indicate a healthy adjacency.

Understanding the Output

The 'show ip ospf neighbors' command output provides a snapshot of OSPF neighbor relationships. Key fields include: Neighbor ID (Router ID of the neighbor), Pri (OSPF interface priority used in DR/BDR election), State (OSPF neighbor state, e.g., DOWN, INIT, 2WAY, EXSTART, EXCHANGE, LOADING, FULL), Dead Time (time remaining before neighbor is declared dead, typically 40 seconds on broadcast networks), Address (neighbor's interface IP address), and Interface (local interface). A healthy neighbor should show FULL state for broadcast networks (or FULL/DR or FULL/BDR). Problematic states include DOWN (no adjacency), INIT (hello received but not bidirectional), EXSTART/EXCHANGE (database descriptor exchange issues), or LOADING (LSR/ LSU exchange). High dead timer values (e.g., 00:00:39) indicate recent hello reception; if it reaches 0, the neighbor goes DOWN. The 'detail' option adds information like DR/BDR addresses, neighbor uptime, retransmission queue length (should be 0), and LS Ack list (should be 0). Non-zero retransmission counts or queue lengths suggest packet loss or mismatched MTU.

Configuration Scenarios

Basic OSPF Neighbor Verification on a Single Interface

After configuring OSPF on Ethernet1/1, verify the neighbor adjacency.

Topology

[Nexus-A]---Ethernet1/1---[Nexus-B]

Steps

  1. 1.Configure OSPF on both Nexus switches.
  2. 2.Use 'show ip ospf neighbors interface ethernet 1/1' to check adjacency.
Configuration
! On Nexus-A
interface Ethernet1/1
  ip address 192.168.1.1/24
  ip router ospf 1 area 0
!
router ospf 1
  router-id 10.0.0.1

Verify: Verify neighbor state is FULL and dead timer is counting down from 40 seconds.

Watch out: Ensure both interfaces are in the same OSPF area and subnet; otherwise, neighbor will not form.

Troubleshooting Stuck EXSTART State

Neighbor is stuck in EXSTART state, often due to MTU mismatch.

Topology

[Nexus-A]---Ethernet1/1---[Nexus-B]

Steps

  1. 1.Check MTU on both interfaces using 'show interface ethernet 1/1'.
  2. 2.Ensure MTU matches (e.g., 1500).
  3. 3.If mismatch, adjust MTU with 'ip mtu' under interface.
Configuration
! On both sides, set same MTU
interface Ethernet1/1
  ip mtu 1500

Verify: After MTU correction, neighbor should transition to FULL within a few seconds.

Watch out: Also check for authentication mismatch or area ID mismatch.

Troubleshooting with This Command

When troubleshooting OSPF neighbor issues on Cisco NX-OS, start with 'show ip ospf neighbors' to identify the neighbor state. A FULL state indicates a healthy adjacency. If the state is DOWN, check physical connectivity and OSPF configuration (network statements, area ID, passive interface). If the state is INIT, the router has received a hello but not seen its own router ID in the neighbor's hello (bidirectional communication issue). Check for access lists blocking OSPF (protocol 89) or mismatched subnet masks. If the state is 2WAY, the neighbor is discovered but DR/BDR election is pending; this is normal for DROTHER routers. If stuck in EXSTART or EXCHANGE, the most common cause is MTU mismatch. Use 'show interface' to verify MTU values; they must match. Also check for authentication mismatch (type or key) using 'show ip ospf interface'. If the state is LOADING, the router is exchanging LSAs; if stuck, check for high CPU or memory issues. The dead timer field is crucial: if it resets to 40 seconds, hello packets are being received; if it counts down to 0, the neighbor is lost. Use 'debug ip ospf hello' (with caution) to see hello packet details. On NX-OS, also verify that OSPF is enabled in the correct VRF and that the interface is not configured as passive (unless intentional). The 'detail' option provides retransmission queue length; non-zero values indicate packet loss. Additionally, check OSPF process ID and router ID uniqueness. If neighbors are flapping, examine the event history with 'show logging' or 'show ip ospf events'. For multi-access networks, ensure the DR/BDR election is stable; if a new router with higher priority appears, it may cause temporary disruption. Finally, verify that the OSPF network type matches on both ends (e.g., broadcast vs point-to-point).

CCNA Exam Tips

1.

Memorize OSPF neighbor states: DOWN, ATTEMPT, INIT, 2WAY, EXSTART, EXCHANGE, LOADING, FULL.

2.

Understand that FULL state is normal for point-to-point links; for broadcast networks, FULL/DR or FULL/BDR is expected.

3.

Know that a neighbor stuck in EXSTART often indicates MTU mismatch.

Common Mistakes

Confusing Neighbor ID with interface IP address; Neighbor ID is the router ID.

Assuming FULL state is always required; on multi-access networks, DROTHER routers show 2WAY/DROTHER.

Ignoring dead timer; if it resets to 40, hello packets are being received; if it counts down to 0, neighbor is lost.

Platform Notes

On Cisco NX-OS, the 'show ip ospf neighbors' command is similar to Cisco IOS but with VRF support. In IOS, the command is 'show ip ospf neighbor' (without 's' in neighbor). NX-OS uses 'neighbors' (plural). The output format is largely the same, but NX-OS includes the VRF name in the header. NX-OS also supports multiple OSPF processes, so the process ID is shown. The 'detail' option provides additional fields like 'LS Ack list' which is not present in IOS. On Nexus, the dead timer is displayed in 'HH:MM:SS' format, while IOS uses '00:00:35' similarly. For VRFs, NX-OS requires the 'vrf' keyword; IOS uses 'vrf' as well but with different syntax. Equivalent commands on other platforms: Juniper uses 'show ospf neighbor', Arista uses 'show ip ospf neighbor'. NX-OS versions prior to 7.0 may have slightly different output formatting. Always check the specific NX-OS version documentation. The command is available in all NX-OS modes (EXEC).

Practice for the CCNA 200-301

Test your knowledge with hundreds of CCNA practice questions covering all exam domains.

Practice CCNA Questions