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.
Definition: show ip ospf is a Cisco IOS privileged exec command. Displays general information about OSPF routing process, including router ID, areas, and LSDB statistics, used to verify OSPF configuration and operational status.
Overview
The 'show ip ospf' command is a fundamental diagnostic tool in Cisco IOS that displays global information about the OSPF routing process. It provides a comprehensive snapshot of the OSPF instance, including the router ID, OSPF process ID, areas configured, link-state database (LSDB) statistics, and neighbor state summary. This command is essential for verifying OSPF configuration, monitoring the health of the OSPF process, and troubleshooting routing issues.
OSPF (Open Shortest Path First) is a link-state routing protocol that uses the Dijkstra algorithm to compute the shortest path tree to each destination. It is widely used in enterprise and service provider networks due to its fast convergence, scalability, and support for hierarchical design through areas. The 'show ip ospf' command is typically the first step in OSPF troubleshooting, as it reveals whether the OSPF process is running, the router ID assignment, and the number of areas and interfaces participating.
It also displays LSDB statistics such as the number of LSAs (Link-State Advertisements) and the sequence numbers, which help detect database inconsistencies. Unlike 'show ip ospf neighbor', which focuses on neighbor relationships, or 'show ip ospf database', which dumps the entire LSDB, 'show ip ospf' provides a high-level overview that quickly confirms the OSPF process is operational and correctly configured. In a typical workflow, a network engineer might use 'show ip ospf' after configuring OSPF to verify the router ID and area assignments, or during troubleshooting to check if the process is running and if the LSDB is stable.
The command output is buffered and may be truncated if the terminal length is set; using 'terminal length 0' before the command can display the full output. Privilege level 15 (enable mode) is required to execute this command. It does not modify the running configuration, so it is safe to use in production.
Understanding the output of 'show ip ospf' is critical for CCNA and CCNP candidates, as it appears frequently in exam scenarios and real-world network operations. The command reveals key parameters such as the OSPF process ID, router ID (which can be manually set or automatically derived from the highest loopback or active interface IP), the number of areas (including the backbone area 0), and the number of interfaces in each area. It also shows the SPF algorithm execution statistics, which indicate how often the SPF tree has been recalculated—a high number may indicate network instability.
The LSDB statistics section shows the number of LSAs by type (router, network, summary, external), and the checksum and sequence numbers help verify database synchronization. Additionally, the command displays the OSPF timer values (hello, dead, wait, retransmit) and the reference bandwidth used for cost calculation. By analyzing this output, engineers can quickly identify misconfigurations such as incorrect router ID, missing area definitions, or mismatched timer values.
The command also indicates whether OSPF is running in a special mode like NSSA (Not-So-Stubby Area) or if authentication is enabled. In summary, 'show ip ospf' is a versatile and indispensable command for any network professional working with OSPF, providing a wealth of information in a concise format.
show ip ospfWhen to Use This Command
- Verify OSPF process is running and check router ID after initial configuration.
- Troubleshoot OSPF adjacency issues by confirming the router ID and area configuration.
- Check OSPF LSDB statistics to monitor memory usage and database size.
- Confirm OSPF is enabled on the correct interfaces and in the correct area.
Parameters
| Parameter | Syntax | Description |
|---|---|---|
| process-id | <1-65535> | Optional parameter to specify a particular OSPF process ID. If omitted, the command displays information for all OSPF processes. Valid values are from 1 to 65535. A common mistake is forgetting to include the process ID when multiple OSPF processes are running, which results in output for all processes. |
Command Examples
Basic OSPF Process Information
show ip ospfRouting Process "ospf 1" with ID 192.168.1.1
Start time: 00:02:34.567, Time elapsed: 00:15:22.123
Supports only single TOS(TOS0) routes
Supports opaque LSA
Supports Link-local Signaling (LLS)
Supports area transit capability
Router is not originating router-LSAs with maximum metric
Initial SPF schedule delay 5000 msecs
Minimum hold time between two consecutive SPFs 10000 msecs
Maximum wait time between two consecutive SPFs 10000 msecs
Incremental-SPF disabled
Minimum LSA interval 5 secs
Minimum LSA arrival 1000 msecs
LSA group pacing timer 240 secs
Interface flood pacing timer 33 msecs
Retransmission pacing timer 66 msecs
Number of external LSA 0. Checksum Sum 0x000000
Number of opaque AS LSA 0. Checksum Sum 0x000000
Number of DCbitless external and opaque AS LSA 0
Number of DoNotAge external and opaque AS LSA 0
Number of areas in this router is 1. 1 normal 0 stub 0 nssa
Number of areas transit capable is 0
External flood list length 0
IETF NSF helper support enabled
Cisco NSF helper support enabled
Reference bandwidth unit is 100 mbps
Area BACKBONE(0)
Number of interfaces in this area is 2
Area has no authentication
SPF algorithm executed 4 times
Area ranges are
Number of LSA 3. Checksum Sum 0x00A5B6
Number of opaque link LSA 0. Checksum Sum 0x000000
Number of DCbitless LSA 0
Number of indication LSA 0
Number of DoNotAge LSA 0
Flood list length 0Line 1: OSPF process number and router ID. Line 2: Uptime since OSPF started. Lines 3-6: Supported features. Lines 7-14: SPF timers and LSA pacing. Lines 15-18: External LSA counts. Lines 19-20: Area summary. Lines 21-22: NSF helper status. Line 23: Reference bandwidth. Lines 24-33: Area 0 details including interface count, authentication, SPF runs, LSA count.
OSPF Process with Multiple Areas
show ip ospfRouting Process "ospf 1" with ID 10.0.0.1
Start time: 01:23:45.678, Time elapsed: 2d05h
...
Number of areas in this router is 2. 1 normal 1 stub 0 nssa
Area BACKBONE(0)
Number of interfaces in this area is 1
...
Area 1
Number of interfaces in this area is 1
It is a stub area
...Shows two areas: backbone (0) and a stub area (1). The stub area line indicates area type. Useful for verifying multi-area OSPF design.
Understanding the Output
The 'show ip ospf' command provides a high-level overview of the OSPF process. Key fields: 'Routing Process' shows process ID and router ID; 'Start time' indicates how long OSPF has been running; 'Number of areas' tells how many areas the router participates in; each area section lists interfaces, authentication, SPF execution count, and LSA count. A healthy OSPF process should have a router ID that is reachable, SPF algorithm executed a reasonable number (not excessively high), and LSA counts that are stable.
Watch for 'Maximum metric' originating (indicates a problem), high SPF counts (possible flapping), or missing areas (misconfiguration).
Configuration Scenarios
Verify OSPF Process and Router ID on a Single Router
After configuring OSPF on a router, you need to confirm that the OSPF process is running, the router ID is correctly set, and the router is participating in the expected areas.
Topology
R1 (Loopback0: 1.1.1.1, Gi0/0: 10.0.12.1/24)Steps
- 1.Step 1: Enter privileged EXEC mode: enable
- 2.Step 2: Run the command: show ip ospf
- 3.Step 3: Examine the output for the OSPF process ID, router ID, and area information.
! Configuration on R1 interface Loopback0 ip address 1.1.1.1 255.255.255.255 ! interface GigabitEthernet0/0 ip address 10.0.12.1 255.255.255.0 ip ospf 1 area 0 ! router ospf 1 router-id 1.1.1.1 network 10.0.12.0 0.0.0.255 area 0
Verify: Expected output snippet: Routing Process "ospf 1" with ID 1.1.1.1 Start time: 00:01:23.456, Time elapsed: 00:10:00 Number of areas in this router is 1. 1 normal 0 stub 0 nssa Area BACKBONE(0) Number of interfaces in this area is 1
Watch out: If the router ID is not manually configured, it will be automatically selected as the highest IP address on a loopback interface or the highest active physical interface IP. This can lead to unexpected router ID changes if interfaces go down. Always set the router-id manually.
Troubleshoot OSPF Process Not Starting Due to Missing Network Statement
A router has OSPF configured but does not show any OSPF neighbors. The 'show ip ospf' command reveals that the OSPF process is running but no interfaces are participating in any area.
Topology
R1 (Gi0/0: 192.168.1.1/24) --- R2 (Gi0/0: 192.168.1.2/24)Steps
- 1.Step 1: Enter privileged EXEC mode: enable
- 2.Step 2: Run: show ip ospf
- 3.Step 3: Notice the output shows 'Number of areas in this router is 0' or 'Number of interfaces in this area is 0'.
- 4.Step 4: Check the OSPF configuration: show running-config | section router ospf
- 5.Step 5: Verify that the network statement matches the interface IP and subnet mask.
! Incorrect configuration on R1 router ospf 1 network 192.168.2.0 0.0.0.255 area 0 ! Wrong network ! Correct configuration router ospf 1 network 192.168.1.0 0.0.0.255 area 0
Verify: After correction, 'show ip ospf' should show: Number of areas in this router is 1. 1 normal 0 stub 0 nssa Area BACKBONE(0) Number of interfaces in this area is 1
Watch out: A common mistake is using an incorrect wildcard mask or network address in the network statement. The network statement must include the exact subnet of the interface. Also, ensure the interface is not in shutdown state and has an IP address assigned.
Verify OSPF Area Types and LSDB Statistics in a Multi-Area Network
In a multi-area OSPF network, you need to verify that the router is correctly configured with the right area types (normal, stub, NSSA) and that the LSDB is stable.
Topology
R1 (Area 0) --- R2 (ABR) --- R3 (Area 1, stub)Steps
- 1.Step 1: Enter privileged EXEC mode: enable
- 2.Step 2: Run: show ip ospf
- 3.Step 3: Look for the area listing and note the area type (normal, stub, nssa).
- 4.Step 4: Check the LSDB statistics: 'Number of LSAs in the database' and 'Number of external LSAs'.
- 5.Step 5: Verify that stub areas show 0 external LSAs.
! Configuration on R2 (ABR) router ospf 1 network 10.0.0.0 0.255.255.255 area 0 network 172.16.0.0 0.0.255.255 area 1 area 1 stub ! Configuration on R3 (stub router) router ospf 1 network 172.16.0.0 0.0.255.255 area 1 area 1 stub
Verify: On R2, 'show ip ospf' output should include: Area 1 Number of interfaces in this area is 1 It is a stub area Number of LSAs in the database: 3 Number of external LSAs: 0
Watch out: If a stub area router receives an external LSA, it indicates a misconfiguration (e.g., the ABR is not configured with the 'area stub' command). Also, ensure that all routers in the stub area have the same area type configured.
Troubleshooting with This Command
When troubleshooting OSPF issues, 'show ip ospf' is the first command to run after verifying basic connectivity. A healthy output shows the OSPF process running with a valid router ID, at least one area (usually area 0), and interfaces participating in those areas. The LSDB statistics should show a reasonable number of LSAs that are stable (sequence numbers not incrementing rapidly).
Key fields to focus on include: 'Routing Process' line confirms the process ID and router ID; 'Number of areas' indicates if the router is correctly participating in the expected areas; 'SPF schedule delay' and 'Hold time between two SPFs' show the SPF throttling timers; 'Number of LSAs in the database' and 'Number of external LSAs' help detect database issues. Common symptoms and their indicators: 1) OSPF process not running: The command returns no output or shows 'OSPF not enabled'. This means OSPF is not configured or the configuration is incomplete. 2) Router ID missing or 0.0.0.0: Indicates that no router ID could be determined, often because no interface has an IP address. 3) No areas or interfaces: The output shows 'Number of areas in this router is 0' or 'Number of interfaces in this area is 0'.
This typically means the network statement does not match any interface, or interfaces are down. 4) High SPF execution count: If the 'SPF algorithm executed' count is increasing rapidly, it indicates network instability such as flapping links or routes. 5) LSDB inconsistencies: If the number of LSAs is unexpectedly high or low, or if checksum errors are reported, it may indicate database corruption or mismatched area types. A step-by-step diagnostic flow: Step 1: Run 'show ip ospf' to confirm the process is running and check the router ID. Step 2: If the router ID is 0.0.0.0, configure a loopback interface with an IP address or set the router-id manually.
Step 3: Check the number of areas and interfaces. If zero, verify the network statements under 'router ospf' and ensure interfaces are up/up. Step 4: If areas are present but neighbors are not forming, check 'show ip ospf neighbor' and 'show ip ospf interface'.
Step 5: If SPF executions are high, use 'debug ip ospf spf' (with caution) to see what triggers recalculations. Correlate 'show ip ospf' with 'show ip route ospf' to see if routes are being installed. Also, 'show ip ospf database' can provide detailed LSA information.
In summary, 'show ip ospf' is a powerful first-line troubleshooting command that quickly narrows down OSPF issues to configuration, interface, or database problems.
CCNA Exam Tips
CCNA exam may ask to identify the router ID from the output; remember it's the highest loopback or active interface IP.
Know that 'Number of areas' indicates if the router is an ABR (multiple areas) or internal router (single area).
Be able to differentiate between normal, stub, and NSSA areas from the area description line.
Remember that SPF algorithm execution count increases with network changes; a high count may indicate instability.
Common Mistakes
Confusing router ID with process ID; router ID is an IP address, process ID is a number.
Assuming OSPF is running if the command returns output; verify the router ID is correct and areas are present.
Misinterpreting 'Number of areas' as number of interfaces; it's the count of distinct OSPF areas configured.
show ip ospf vs show ip ospf interface
Both 'show ip ospf' and 'show ip ospf interface' are essential OSPF verification commands, but they operate at different levels: process-wide versus per-interface. They are commonly confused because they share a similar syntax and both start with 'show ip ospf', yet they provide distinct information critical for troubleshooting.
| Aspect | show ip ospf | show ip ospf interface |
|---|---|---|
| Scope | Entire OSPF process (router ID, areas, LSDB stats) | Specific interface (parameters, neighbor state, timers) |
| Key Information | Router ID, area count, SPF runs, LSDB totals | IP address, network type, cost, hello/dead intervals, neighbor state |
| Typical Use Case | Verify OSPF process is running and see high-level health | Check why a neighbor is not forming or troubleshoot interface-specific issues |
| Output Detail | Summarized, one block per area | Detailed, one section per interface |
Use 'show ip ospf' when you need a quick overview of the OSPF process status, including router ID, area memberships, and LSDB statistics.
Use 'show ip ospf interface' when you need to examine OSPF parameters on a specific interface, such as network type, cost, timers, or the state of neighbor adjacencies.
Platform Notes
In IOS-XE (e.g., Catalyst 9000 switches), the 'show ip ospf' command syntax and output are largely identical to classic IOS. However, IOS-XE may include additional fields such as 'OSPF with ID' and 'NSR (Non-Stop Routing) state'. The command is available in all IOS-XE versions.
In NX-OS (e.g., Nexus switches), the equivalent command is 'show ip ospf' but the output format differs significantly. NX-OS uses a more structured output with sections like 'OSPF Process', 'Router ID', 'Number of areas', and 'LSDB Statistics'. Additionally, NX-OS supports multiple OSPF instances and VRFs, so you may need to specify the VRF: 'show ip ospf vrf <vrf-name>'.
In ASA firewalls, OSPF is supported in routed mode, and the command is 'show ospf' (without 'ip') or 'show ospf process'. The output is similar but tailored to ASA features like security contexts. In IOS-XR (e.g., ASR 9000), the command is 'show ospf' with different syntax and output.
IOS-XR uses a hierarchical configuration model and the command may require specifying the OSPF instance: 'show ospf <instance-name>'. The output is more verbose and includes process details, area information, and SPF statistics. For older IOS versions (12.x), the output may lack some fields present in 15.x/16.x, such as 'SPF throttling' timers.
In general, the command is consistent across platforms, but always check the specific platform documentation for exact syntax and field descriptions.
Related Commands
show ip ospf database
Displays the OSPF link-state database (LSDB) to verify OSPF adjacencies, check for missing or corrupt LSAs, and troubleshoot OSPF routing issues.
show ip ospf interface
Displays OSPF interface parameters and status, used to verify OSPF configuration and troubleshoot neighbor relationships.
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