BSCI: Verifying OSPF Operations
Posted by Aragoen Celtdra on 1st August 2008
sh ip route ospf Command
- Displays the OSPF routes known to the router. That is, it verifies the OSPF routes in the IP routing table.
- One of the best ways to determine connectivity between the local router and the rest of the internetwork.
Figure 1: sh ip route ospf Command

- O – indicates that the routes was learned from OSPF
- IA – (Interarea) indicates that the learned route is in a different area
- The 10.2.1.0 subnet is recognized on Fasthethernet0/0 of this router via neighbor 10.64.0.2
- [110/65]
- 110 is the administrative distance of OSPF
- 65 is the total cost to reach subnet 10.2.1.0
sh ip ospf interface Command
- Verifies that interfaces are configured in the intended areas.
- Displays the time intervals, such as hello interval, and shows the neighbor adjacencies.
- sh ip ospf interface [type number] [brief]
- type – (Optional) specifies the interface type.
- number – (Optional) specifies the interface number
- brief – (Optional) displays brief overview information for OSPF interfaces, states, addresses and masks, and areas on the router.
Figure 2: show ip ospf interface Command

- The command on the above example details the OSPF status of the FastEthernet 0/0 interface
- It shows that OSPF is running on this interface including verification that it is in Area 0
- It also displays other information such as:
- OSPF process ID – (Process ID 1)
- Router ID – (Router ID 10.64.0.1)
- Network Type – (Broadcast)
- DR – (10.64.0.1)
- BDR – (10.64.0.2)
- Hello and Dead timers – (10/40)
- Neighbor adjacency information – (10.64.0.2)
sh ip ospf neighbor Command
- Displays a list of neighbors with information for each interface including their:
- OSPF router ID
- OSPF priority
- neighbor adjacency state (such as init, exstart, or full)
- Dead timer
- sh ip ospf neighbor [type number] [neighbor-id] [detail]
- type – (Optional) specifies the interface type
- number – (Optional) specifies the interface number
- neighbor-id – (Optional) specifies the neighbor ID
- detail – (Optional) displays details of all neighbors
Figure 3: show ip ospf neighbor Command Output

- The first entry shows the adjacency formed on the FastEthernet interface.
- A FULL state means that the LSDB has been exchanged successfully.
- The DR entry means that this neighbor is the Designated Router.
- Another entry that you might see is DROTHER, which means that a router other than this neighboring router is the DR.
- Notice also that it has a Pri of 1. That refers to the OSPF priority
- The second line represents Router B’s neighbor on the serial interface.
- It is neither a DR and BDR because they are not used on point-to-point interfaces (as indicated by a dash [-].
- Recall also that an OSPF priority of 0 prevents an interface from becoming a DR or BDR. Had this interface been on a broadcast link, the fact that its priority is set to 0 disqualifies it from being elected as DR or BDR.
Figure 4: show ip ospf neighbor detail Command Output

debug ip ospf events Command
- Used to display OSPF-related events
Figure 5: debug ip ospf events Command Output

- The output shows that the router received a hello packet on its Fa0/0, interface (sent from the Fa0/0 interface of the neighbor).
- It also shows this router sending a hello packet on its Fa0/0 interface to multicast address 224.0.0.5
OSPF Router ID
- An OSPF Router ID (RID) is the router’s OSPF identification in the network.
- The OSPF routing process chooses a router ID for itself when it starts up.
- It is a unique ID that can be assigned in several ways, as follows:
- Highest IP address
- By defualt, the highest IP address of any physical interface when OSPF starts becomes the router ID.
- The interface does not need to have OSPF enabled on it. An interface only has to be up for the RID to be assigned.
- If there’s is no interface with an IP address is up when the OSFP process starts, an error occurs.
- Loopback Interface
- If a loopback interface is present, its IP address is always preferred instead of the physical interface’s IP address. That is because loopback interfaces never go down.
- If there is more than one loopback interface, then the highest IP wins.
- Manually
- To configure use the router configuration command:
- router-id ip-address
- This method overrides the first two methods.
- This is also the preferred procedure for setting the router ID.
- To configure use the router configuration command:
- Highest IP address
- Router ID should be unique
- No matter how they are configured, router IDs should always be unique throughout the OSPF autonomous system. This is how the OSPF database is able to uniquely describe each router in the network.
- Remember that every router keeps a complete toplogy database of all routers and links in an area and network. Therefore each router ID being unique helps distinguish them.
- After the router ID has been set, it does not change, even if the interface that the router is using for the router ID goes down.
- It only changes if the router reloads or if the OSPF routing process restarts.
- Loopback Interfaces
- To assign a Router ID using loopback interface:
- interface loopback number
- Overrides the highest IP address on any active physical interface.
- More stable because they never fail.
- Can be used for testing (ping) if advertised with the network command.
- Can use private address to save public IP address usage.
- A loopback address requires a different subnet for each router, unless the host itself is advertised. By default, OSPF advertises loopback as /32 host routes.
- To assign a Router ID using loopback interface:
- router-id Command
- router-id ip-address
- Allows to specifically assign a desired router ID.
- The ip-address can be any unique arbitrary 32-bit address in a dotted decimal format.
- After it is configured se the clear ip ospf process EXEC command to restart the OSPF routing process, so the router reselects the new IP address as its RID.
- Caution: this will disrupt an operational network momentarily.
Note: Changing the OSPF router ID of a router whose router ID was set by configuring a loopback interface requires you to either reboot the router or to disable and then enable OSPF. Changing a router ID of a router whose router ID was set by configuring it under the OSPF process requires only that the OSPF process be cleared, a much less drastic move.
show ip ospf
- Use this command to verify the router ID.
- This command also displays OSPF timer settings and other statistics, including the number of times the shortest path first (SPF) algorithm has been executed.
Figure 6: show ip ospf Command Output

sh ip protocols
- Displays IP routing protocol parameters including:
- Timers
- Filters
- Metrics
- Networks
- Other information for the entire router
Figure 7: show ip protocols Command Output

debug ip ospf adj
- Tracks adjacencies as they go up and down
Figure 8: debug ip ospf adj Command Output When a Neighbor Interface Fails

Figure 9: debug ip ospf adj Command Output When a Neighbor Interface Comes Up

This entry is not an authoritative guide. These are merely notes and rehash of the primary text materials and resources that I use. For a thorough guide of the BSCI course, consider purchasing Building Scalable Cisco Internetworks (BSCI) (Authorized Self-Study Guide) (3rd Edition) by Diane Teare and Catherine Paquet, as well as following the links on the resources section of this entry.
Posted in Uncategorized | 3 Comments » |





