There are many different OSPF commands that can be used to help in the troubleshooting process. The following summarizes the most common of these commands:
- show ip protocols (Figure 1) - Used to verify vital OSPF configuration information, including the OSPF process ID, the router ID, networks the router is advertising, the neighbors the router is receiving updates from, and the default administrative distance, which is 110 for OSPF.
- show ip ospf neighbor (Figure 2) - Used to verify that the router has formed an adjacency with its neighboring routers. Displays the neighbor router ID, neighbor priority, OSPF state, Dead timer, neighbor interface IP address, and interface that the neighbor is accessible through. If the router ID of the neighboring router is not displayed, or if it does not show as a state of FULL or 2WAY, the two routers have not formed an OSPF adjacency. If two routers do not establish adjacency, link-state information will not be exchanged. Incomplete link-state databases can cause inaccurate SPF trees and routing tables. Routes to destination networks may not exist or may not be the most optimum path.
- show ip ospf interface (Figure 3) - Used to display the OSPF parameters configured on an interface, such as the OSPF process ID that the interface is assigned to, the area that the interfaces are in, the cost of the interface, and the Hello and Dead intervals. Adding the interface name and number to the command displays output for a specific interface.
- show ip ospf (Figure 4) - Used to examine the OSPF process ID and router ID. Additionally, this command displays the OSPF area information, as well as the last time the SPF algorithm was calculated.
- show ip route ospf (Figure 5) - Used to display only the OSPF learned routes in the routing table. The output shows that R1 has learned about four remote networks through OSPF.
- clear ip ospf [ process-id ] process - Used to reset the OSPFv2 neighbor adjacencies.