show ip ospf interface
Displays OSPF interface parameters and status, used to verify OSPF configuration and troubleshoot neighbor relationships.
Definition: show ip ospf interface is a Cisco IOS privileged exec command. Displays OSPF interface parameters and status, used to verify OSPF configuration and troubleshoot neighbor relationships.
Overview
The 'show ip ospf interface' command is a fundamental diagnostic tool in Cisco IOS that displays OSPF interface parameters and status. It is essential for verifying OSPF configuration, troubleshooting neighbor relationships, and understanding the operational state of OSPF on specific interfaces. OSPF (Open Shortest Path First) is a link-state routing protocol that uses the SPF algorithm to compute the shortest path to each destination.
Each OSPF-enabled interface maintains a state (e.g., DR, BDR, DROther) and participates in hello and LSA exchanges. This command provides a detailed view of interface-level OSPF settings, including area ID, network type, cost, timer values, neighbor state, and authentication. Network engineers reach for this command when OSPF neighbors are not forming, routes are missing, or when verifying that OSPF is correctly configured on an interface.
Alternatives like 'show ip ospf neighbor' focus on neighbor relationships, while 'show ip ospf database' shows the LSDB. This command fits into a broader troubleshooting workflow: after verifying basic connectivity (ping), you check OSPF interface status to ensure the interface is up, in the correct area, and has appropriate timers. It is also used during configuration to confirm that interface-level parameters (like cost or passive-interface) are applied correctly.
In IOS, the output can be lengthy for interfaces with many neighbors; it is buffered and may require multiple 'show' commands or terminal length 0 to view all. The command is available in privileged EXEC mode (enable) and does not modify the running configuration. Understanding its output is critical for CCNA and CCNP candidates, as OSPF troubleshooting is a core exam topic and real-world skill.
show ip ospf interfaceWhen to Use This Command
- Verify that OSPF is enabled on the correct interfaces and that the network type is appropriate.
- Check the OSPF cost, timer values, and neighbor state on a specific interface.
- Troubleshoot OSPF adjacency issues by examining interface-specific OSPF settings.
- Confirm the designated router (DR) and backup designated router (BDR) elections on multi-access networks.
Parameters
| Parameter | Syntax | Description |
|---|---|---|
| interface-type interface-number | e.g., GigabitEthernet0/0, Serial0/0/0 | Specifies a particular interface to display OSPF information for. If omitted, the command shows OSPF parameters for all OSPF-enabled interfaces. Common mistake: using an interface that is not OSPF-enabled or misspelling the interface name. |
| brief | brief | Displays a condensed summary of OSPF interface information, including interface name, IP address, area, cost, state, and neighbor count. Useful for a quick overview without detailed timer or authentication data. |
Command Examples
Basic OSPF interface status on GigabitEthernet0/0
show ip ospf interface gigabitethernet 0/0GigabitEthernet0/0 is up, line protocol is up
Internet Address 192.168.1.1/24, Area 0
Process ID 1, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 1
Transmit Delay is 1 sec, State DR, Priority 1
Designated Router (ID) 1.1.1.1, Interface address 192.168.1.1
Backup Designated router (ID) 2.2.2.2, Interface address 192.168.1.2
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
Hello due in 00:00:03
Supports Link-local Signaling (LLS)
Cisco NSF helper support enabled
IETF NSF helper support enabled
Index 1/1, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 1, maximum is 1
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 1, Adjacent neighbor count is 1
Adjacent with neighbor 2.2.2.2 (Backup Designated Router)
Suppress hello for 0 neighbor(s)The interface is up and OSPF is active. The router is the DR (State DR) with priority 1. Hello timer is 10 seconds, dead timer 40 seconds. There is one adjacent neighbor (2.2.2.2) which is the BDR.
OSPF interface on a point-to-point serial link
show ip ospf interface serial 0/0/0Serial0/0/0 is up, line protocol is up
Internet Address 10.0.0.1/30, Area 0
Process ID 1, Router ID 1.1.1.1, Network Type POINT_TO_POINT, Cost: 64
Transmit Delay is 1 sec, State POINT_TO_POINT
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
Hello due in 00:00:07
Supports Link-local Signaling (LLS)
Cisco NSF helper support enabled
IETF NSF helper support enabled
Index 2/2, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 1, maximum is 1
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 1, Adjacent neighbor count is 1
Adjacent with neighbor 2.2.2.2
Suppress hello for 0 neighbor(s)This is a point-to-point link (Network Type POINT_TO_POINT). No DR/BDR election occurs. Cost is 64 (default for serial). One neighbor is fully adjacent.
Understanding the Output
The output shows OSPF parameters per interface. Key fields: 'Internet Address' and 'Area' confirm OSPF configuration. 'Process ID' and 'Router ID' identify the OSPF process.
'Network Type' (BROADCAST, POINT_TO_POINT, etc.) determines behavior. 'Cost' is used for SPF calculations. 'State' indicates the router's role (DR, BDR, DROTHER, or POINT_TO_POINT).
'Timer intervals' show Hello and Dead intervals; mismatched timers prevent adjacency. 'Neighbor Count' and 'Adjacent neighbor count' indicate how many neighbors are fully adjacent. 'Adjacent with neighbor' lists the neighbor router ID and role.
Good values: interface up/up, state appropriate for network type, timers consistent, neighbor count >0. Bad values: interface down, state DOWN, mismatched timers, zero neighbors.
Configuration Scenarios
Verify OSPF Interface Parameters on a Single Interface
After configuring OSPF on a router, you need to confirm that a specific interface (GigabitEthernet0/0) is participating in OSPF with correct area, cost, and timers. This scenario helps ensure OSPF is properly enabled and neighbors can form.
Topology
R1(Gi0/0)---10.0.12.0/30---(Gi0/0)R2Steps
- 1.Step 1: Enter privileged EXEC mode: Router> enable
- 2.Step 2: View OSPF parameters for interface GigabitEthernet0/0: Router# show ip ospf interface GigabitEthernet0/0
- 3.Step 3: Examine the output for key fields: Interface address, Area, Process ID, Network Type, Cost, State, Timer intervals, Neighbor Count, and Neighbor address.
! OSPF configuration on R1 Router(config)# router ospf 1 Router(config-router)# network 10.0.12.0 0.0.0.3 area 0 Router(config-router)# exit Router(config)# interface GigabitEthernet0/0 Router(config-if)# ip ospf cost 10 Router(config-if)# ip ospf hello-interval 10 Router(config-if)# ip ospf dead-interval 40
Verify: Command: show ip ospf interface GigabitEthernet0/0 Expected output includes: 'Internet Address 10.0.12.1/30, Area 0', 'Process ID 1', 'Network Type BROADCAST', 'Cost: 10', 'State DR', 'Hello due in 00:00:03', 'Neighbor Count is 1, Adjacent neighbor count is 1', 'Adjacent with neighbor 10.0.12.2 (Designated Router)'
Watch out: If the interface is in 'DOWN' state, check that OSPF is enabled under the interface (network statement) and that the interface is not administratively down. Also ensure the interface IP address matches the network statement.
Troubleshoot OSPF Neighbor Not Forming on a Serial Link
Two routers connected via a serial link are not forming an OSPF neighbor relationship. You suspect mismatched OSPF parameters or a layer 1/2 issue. This scenario uses 'show ip ospf interface' to diagnose the problem.
Topology
R1(Serial0/0/0)---192.168.1.0/30---(Serial0/0/0)R2Steps
- 1.Step 1: Enter privileged EXEC mode: Router> enable
- 2.Step 2: Check OSPF interface status on R1: Router# show ip ospf interface Serial0/0/0
- 3.Step 3: Compare the output with expected values: ensure interface is up, OSPF is enabled, area matches, network type is point-to-point (or both sides agree), hello/dead timers match, and authentication settings are consistent.
- 4.Step 4: If the interface state is 'DOWN', check physical layer and ensure the interface is not shut down. If state is 'WAITING' or 'DR', verify network type and priority.
! OSPF configuration on R1 Router(config)# router ospf 1 Router(config-router)# network 192.168.1.0 0.0.0.3 area 0 Router(config-router)# exit Router(config)# interface Serial0/0/0 Router(config-if)# ip ospf network point-to-point Router(config-if)# ip ospf hello-interval 10 Router(config-if)# ip ospf dead-interval 40
Verify: Command: show ip ospf interface Serial0/0/0 Expected output: 'Serial0/0/0 is up, line protocol is up', 'Internet Address 192.168.1.1/30, Area 0', 'Process ID 1', 'Network Type POINT_TO_POINT', 'Cost: 64', 'State POINT_TO_POINT', 'Hello due in 00:00:05', 'Neighbor Count is 1, Adjacent neighbor count is 1', 'Adjacent with neighbor 192.168.1.2'
Watch out: A common mistake is forgetting to set the network type to point-to-point on both ends for serial links; if one side is broadcast and the other point-to-point, neighbors will not form. Also, ensure the hello and dead intervals match exactly.
Troubleshooting with This Command
When troubleshooting OSPF neighbor issues, the 'show ip ospf interface' command is often the first step after verifying basic connectivity. A healthy output shows the interface as 'up' and 'line protocol is up', OSPF enabled with the correct area, and the interface state as DR, BDR, DROther, or POINT_TO_POINT. The neighbor count should be non-zero if neighbors are expected.
Key fields to focus on include: 'State' – if it shows 'DOWN', OSPF is not operational on that interface; 'Network Type' – mismatched types (e.g., broadcast vs point-to-point) prevent neighbor formation; 'Hello due' – if the timer is stuck or not decrementing, hello packets may not be sent or received; 'Neighbor Count' – if zero, no neighbors have been discovered; 'Adjacent neighbor count' – should match neighbor count for full adjacency. Common symptoms: 'State: DOWN' indicates OSPF not enabled or interface down; 'State: WAITING' on a broadcast network suggests the router is waiting to become DR/BDR, possibly due to no hello received; 'Neighbor Count: 0' with interface up suggests hello packets are not being exchanged (check ACLs, authentication, or multicast address 224.0.0.5). A step-by-step diagnostic flow: 1) Check interface status (show ip interface brief). 2) Run 'show ip ospf interface' to verify OSPF parameters. 3) If state is DOWN, verify network statement includes the interface IP. 4) If state is DR/BDR but no neighbors, check hello/dead timers and network type. 5) Use 'debug ip ospf hello' to see hello packet exchange.
Correlate with 'show ip ospf neighbor' to see neighbor state (FULL/2WAY). For example, if neighbor state is EXSTART/EXCHANGE, check MTU mismatch – 'show ip ospf interface' shows MTU. Also, 'show ip ospf interface brief' gives a quick summary to spot interfaces that are not OSPF-enabled.
In summary, this command provides the interface-level OSPF health and is indispensable for isolating configuration mismatches.
CCNA Exam Tips
CCNA exam tip: On broadcast multi-access networks, the router with the highest OSPF priority becomes the DR; if priorities are equal, the highest router ID wins.
CCNA exam tip: The 'show ip ospf interface' command is crucial for verifying OSPF network type and timer values, which must match between neighbors.
CCNA exam tip: If the interface state is 'DOWN' or 'WAITING', check for mismatched OSPF parameters or Layer 1/2 issues.
CCNA exam tip: On point-to-point links, there is no DR/BDR election; the state will be 'POINT_TO_POINT'.
Common Mistakes
Mistake 1: Assuming OSPF is enabled on an interface without verifying with 'show ip ospf interface' — the interface may be in the wrong area or passive.
Mistake 2: Forgetting that OSPF timers must match on both sides of a link; mismatched Hello/Dead timers prevent adjacency.
Mistake 3: Misinterpreting the 'State' field — on broadcast networks, a state of 'DROTHER' is normal for non-DR/BDR routers, not an error.
show ip ospf interface vs show ip ospf
These two commands are often confused because they share the same 'show ip ospf' prefix, but they serve different purposes: one provides per-interface OSPF details, while the other gives a global process overview.
| Aspect | show ip ospf interface | show ip ospf |
|---|---|---|
| Scope | Per-interface OSPF parameters and status | Global OSPF routing process information |
| Output fields | Interface state, area, timers, neighbor count, DR/BDR | Router ID, areas, SPF statistics, LSDB size |
| Typical use | Verify OSPF adjacency on a specific interface | Check overall OSPF process health and configuration |
| Detail level | Detailed per-interface data | Summary of the entire OSPF process |
| Troubleshooting focus | Interface-specific issues (e.g., mismatched timers, passive interface) | Process-level issues (e.g., router ID duplication, area mismatch) |
Use show ip ospf interface when troubleshooting neighbor issues on a specific interface or verifying interface-specific OSPF settings.
Use show ip ospf when checking the overall OSPF process status, router ID, or area summary.
Platform Notes
In IOS-XE (e.g., Catalyst 9000 switches), the 'show ip ospf interface' command syntax and output are nearly identical to classic IOS. However, on some IOS-XE platforms, the command may support additional keywords like 'vrf' to display OSPF interface info for a specific VRF. The output format is consistent, but timer values may be displayed in milliseconds for fast hello features.
In NX-OS (Cisco Nexus switches), the equivalent command is 'show ip ospf interface' as well, but the output format differs slightly; it includes fields like 'BFD' and 'Graceful Restart' status. NX-OS also supports 'show ip ospf interface brief' for a summary. On Cisco ASA firewalls, OSPF is supported in routed mode, and the command is 'show ospf interface' (without 'ip').
The output is similar but may lack some fields like 'Neighbor Count' if not applicable. In IOS-XR, the command is 'show ospf interface' (without 'ip'), and the output is more structured, often in XML-like format. For example, 'show ospf interface GigabitEthernet0/0/0/0' displays similar information but with different field names (e.g., 'state' instead of 'State').
There are no major differences between IOS 12.x, 15.x, and 16.x for this command; however, newer versions may include additional fields like 'TTL-security' or 'Segment Routing'. Always check the specific platform documentation for exact syntax.
Related Commands
show ip ospf
Displays general information about OSPF routing process, including router ID, areas, and LSDB statistics, used to verify OSPF configuration and operational status.
show ip ospf neighbor
Displays OSPF neighbour table showing router IDs, adjacency state, dead timer, and the interface the neighbour is reachable through.
Practice for the CCNA 200-301
Test your knowledge with practice questions covering all CCNA 200-301 exam domains.
Practice CCNA 200-301 Questions