There are a host of commands with which to troubleshoot issues in OSPF networks. They are the show and debug commands.
The different show commands and description are listed in Table 9.1.
Command | Description |
---|---|
show ip ospf 1(Process ID number) | Shows details of the OSPF process for a specified process ID. |
show ip ospf border-routers | Shows information about the border and boundary routers of OSPF for which entries exist in the routing table. |
show ip ospf database | Shows the total OSPF topological database with all the LSAs present in a router. |
show ip ospf flood-list | Shows the link states to be flooded out of an interface. |
show ip ospf interface | Lists all interfaces in the router and shows OSPF specific information for each of them. This command also shows the interface IP address, OSPF process ID, route ID, type of OSPF network, and OSPF timers. The command also shows whether the interface is passive. |
show ip ospf neighbor | Lists all the neighbor relationships in OSPF. Parameters such as the IP address of the neighbor, the interface over which the relationship is established, and the status of the router in the OSPF network are specified in this command. |
show ip ospf request-list | Shows list of LSAs that have been requested by the router. |
show ip ospf retransmission-list | Shows list of LSAs whose retransmission has been requested by the router. |
show ip ospf summary-address | Shows the summary address redistribution information. |
show ip ospf virtual-links | Shows OSPF virtual links. |
Consider the example shown in Figure 9.1. The figure shows an OSPF enabled network. Routers B1, B2, B3, and B4 are OSPF neighbors over a shared LAN 192.168.119.0/24.
Figure 9.1: An OSPF enabled network.
The output of the commands listed in Table 9.1 is discussed in this section. Listing 9.1 shows the output of the show ip ospf neighbor command at B1.
Listing 9.1 Output of the show ip ospf neighbor Command at B1
B1#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 0 192.168.119.122 1 2WAY/DROTHER 00:00:31 192.168.119.122 FastEthernet0/ 0 192.168.120.90 1 FULL/BDR 00:00:36 192.168.119.4 FastEthernet0/ 0 192.168.120.222 1 FULL/DR 00:00:35 192.168.119.10 FastEthernet0/ 0
Listing 9.2 shows the output for the show ip ospf border-routers command at B1.
Listing 9.2 Output of the show ip ospf border-routers Command at B1
B1#show ip ospf border-routers OSPF Process 1 internal Routing Table Codes: i - Intra-area route, I - Inter-area route i 192.168.120.222 [1] via 192.168.119.10, FastEthernet0/0, ASBR, Area 5, SPF 939 8 i 192.168.119.122 [1] via 192.168.119.122, FastEthernet0/0, ASBR, Area 5, SPF 93 98 i 192.168.120.90 [1] via 192.168.119.4, FastEthernet0/0, ASBR, Area 5, SPF 9398
The output for the show ip ospf database command is shown in Listing 9.3.
Listing 9.3 Output of the show ip ospf database Command at B1
B1#show ip ospf database OSPF Router with ID (192.168.120.9) (Process ID 1) Router Link States (Area 5) Link ID ADV Router Age Seq# Checksum Link count 192.168.119.122 192.168.119.122 978 0x80001C3C 0x00B6D6 10 192.168.120.90 192.168.120.90 1133 0x80001717 0x00B034 10 192.168.120.222 192.168.120.222 2 0x80005112 0x000E89 50 Net Link States (Area 5) Link ID ADV Router Age Seq# Checksum 192.168.119.10 192.168.120.222 90 0x800000B2 0x00C83F Type-5 AS External Link States Link ID ADV Router Age Seq# Checksum Tag 0.0.0.0 192.168.119.122 472 0x80000006 0x002DF3 1 24.147.216.55 192.168.119.122 716 0x800026B0 0x0047C9 0 61.3.128.49 192.168.119.122 716 0x80001C07 0x00A4E9 0 63.104.239.70 192.168.119.122 716 0x80001C07 0x002D75 0 66.218.66.240 192.168.119.122 211 0x80000006 0x00CA82 0 80.204.229.99 192.168.119.122 716 0x80001C07 0x00E534 0 150.108.77.100 192.168.119.122 716 0x800020FC 0x00656C 0 198.64.129.82 192.168.119.122 716 0x800020FC 0x007B30 0 198.172.121.204 192.168.119.122 716 0x80001C07 0x00EDD8 0 198.172.121.209 192.168.119.122 716 0x800026B3 0x0044C6 0 199.44.167.0 192.168.119.122 716 0x80001101 0x00B8BC 0 202.4.187.242 192.168.119.122 716 0x800020FC 0x0053B5 0 202.41.230.37 192.168.119.122 716 0x800026B3 0x004584 0 172.16.9.0 192.168.119.122 979 0x80001BAE 0x00CFFF 0 172.16.9.127 192.168.119.122 716 0x800000D5 0x00DAE8 0 172.16.9.140 192.168.120.222 849 0x800010CF 0x003B9C 0 172.16.9.184 192.168.120.90 1127 0x8000003A 0x003013 0 172.16.9.236 192.168.120.90 1127 0x8000000D 0x0080BB 0 172.16.52.0 192.168.119.122 716 0x80001BCE 0x00A5E1 0 172.16.52.40 192.168.120.222 1588 0x8000003C 0x00DB46 0 172.16.52.88 192.168.120.90 1128 0x8000006C 0x00B491 0 172.16.52.164 192.168.120.222 91 0x8000000C 0x005F76 0 172.16.53.0 192.168.119.122 717 0x80001BCD 0x00ABD8 0 172.16.54.16 192.168.120.90 1128 0x80000759 0x008531 0 172.16.54.64 192.168.120.222 849 0x8000053D 0x00435D 0 172.16.55.0 192.168.119.122 717 0x80001BCE 0x0093ED 0 172.16.72.36 192.168.119.122 473 0x8000004A 0x00BFCB 0 172.16.74.64 192.168.120.222 1101 0x80000002 0x008B51 0 172.16.74.128 192.168.120.222 92 0x8000004A 0x00D86B 0 172.16.74.192 192.168.120.222 850 0x80000015 0x0060E8 0 172.16.74.224 192.168.120.222 1589 0x80000169 0x00D3EF 0 172.16.75.0 192.168.120.222 1833 0x8000003D 0x00ECE3 0 172.16.75.1 192.168.120.222 1833 0x8000003D 0x0075B8 0 172.16.75.16 192.168.120.222 850 0x80000261 0x00FD9C 0 172.16.75.64 192.168.120.222 850 0x80000041 0x00417B 0 172.16.76.0 192.168.119.122 717 0x80001C07 0x00293A 0 172.16.76.24 192.168.119.122 717 0x8000158F 0x00B7D2 0 172.16.76.25 192.168.119.122 717 0x8000158F 0x00ADDB 0 172.16.77.1 192.168.120.222 92 0x8000000A 0x008D64 0 172.16.77.2 192.168.120.222 92 0x8000000A 0x00836D 0 172.16.77.3 192.168.120.222 92 0x8000000A 0x007976 0 172.16.77.128 192.168.120.222 92 0x80000068 0x005AF8 0 172.16.78.0 192.168.120.222 92 0x800000D5 0x003A0B 0 172.16.78.32 192.168.120.222 92 0x800000D5 0x0059BB 0 172.16.78.96 192.168.120.222 850 0x800010CF 0x00B218 0 172.16.78.128 192.168.120.222 850 0x800010E5 0x00454F 0 172.16.78.176 192.168.120.222 1101 0x8000008C 0x004687 0 172.16.78.192 192.168.120.222 850 0x80000261 0x00F5F0 0 172.16.78.240 192.168.120.222 92 0x800000D5 0x003113 0 172.16.115.23 192.168.119.122 718 0x80001A0C 0x009E53 0 B1#
The output for the show ip ospf interface command is shown in Listing 9.4.
Listing 9.4 Output of the show ip ospf interface Command at B1
B1#show ip ospf interface FastEthernet0/0 is up, line protocol is up Internet Address 192.168.119.1/25, Area 5 Process ID 1, Router ID 192.168.120.9, Network Type BROADCAST, Cost: 1 Transmit Delay is 1 sec, State DROTHER, Priority 1 Designated Router (ID) 192.168.120.222, Interface address 192.168.119.10 Backup Designated router (ID) 192.168.119.90, Interface address 192.168.119.90 Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5 Hello due in 00:00:02 Index 20/20, flood queue length 0 Next 0x0(0)/0x0(0) Last flood scan length is 0, maximum is 37 Last flood scan time is 0 msec, maximum is 4 msec Neighbor Count is 14, Adjacent neighbor count is 2 Adjacent with neighbor 192.168.120.222 (Designated Router) Adjacent with neighbor 203.200.163.1 (Backup Designated Router) Suppress hello for 0 neighbor(s) Simple password authentication enabled Serial3/0 is up, line protocol is up Internet Address 172.16.72.2/30, Area 5 Process ID 1, Router ID 192.168.120.9, 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 No Hellos (Passive interface) Index 7/7, flood queue length 0 Next 0x0(0)/0x0(0) Last flood scan length is 0, maximum is 0 Last flood scan time is 0 msec, maximum is 0 msec Neighbor Count is 0, Adjacent neighbor count is 0 Suppress hello for 0 neighbor(s) Simple password authentication enabled Serial3/1 is up, line protocol is up Internet Address 192.168.120.42/30, Area 5 Process ID 1, Router ID 192.168.120.9, 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 No Hellos (Passive interface) Index 21/21, flood queue length 0 Next 0x0(0)/0x0(0) Last flood scan length is 0, maximum is 0 Last flood scan time is 0 msec, maximum is 0 msec Neighbor Count is 0, Adjacent neighbor count is 0 Suppress hello for 0 neighbor(s) Simple password authentication enabled
Output of the show ip ospf 1 command is shown in Listing 9.5.
Listing 9.5 Output of the show ip ospf 1 Command at B1
B1#show ip ospf 1 Routing Process "ospf 1" with ID 192.168.120.9 Supports only single TOS(TOS0) routes Supports opaque LSA It is an autonomous system boundary router Redistributing External Routes from, connected, includes subnets in redistribution static with metric mapped to 2, includes subnets in redistribution SPF schedule delay 5 secs, Hold time between two SPFs 10 secs Minimum LSA interval 5 secs. Minimum LSA arrival 1 secs Number of external LSA 591. Checksum Sum 0x123BBA0 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 External flood list length 0 Area 5 Number of interfaces in this area is 25 Area has simple password authentication SPF algorithm executed 9412 times Area ranges are 192.168.119.0/24 Passive Advertise Number of LSA 16. Checksum Sum 0x090354 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 0
The output of the show ip protocols command is shown in Listing 9.6.
Listing 9.6 Output of the show ip protocols Command
B1#show ip protocols Routing Protocol is "ospf 1" Outgoing update filter list for all interfaces is not set Incoming update filter list for all interfaces is not set Router ID 192.168.120.9 It is an autonomous system boundary router Redistributing External Routes from, connected, includes subnets in redistribution static with metric mapped to 2, includes subnets in redistribution Number of areas in this router is 1. 1 normal 0 stub 0 nssa Maximum path: 6 Routing for Networks: 192.168.119.0 0.0.0.255 area 5 192.168.120.0 0.0.0.255 area 5 Passive Interface(s): Serial3/0 Serial3/1 Routing Information Sources: Gateway Distance Last Update 192.168.119.122 110 00:00:00 192.168.120.90 110 00:00:00 192.168.120.222 110 00:00:00 Distance: (default is 110)
The debug commands used for thorough, packet-level troubleshooting of problems in OSPF networks are listed in Table 9.2.
Command | Description |
---|---|
debug ip ospf adj | Monitors adjacencies between OSPF neighbors. |
debug ip ospf database-timer | Monitors the database timer in OSPF. |
debug ip ospf events | Displays the packet-level exchanges that occur in different events in the functioning of the OSPF routing process. |
debug ip ospf flood | Displays events during the exchange state of adjacency development, when the entire database is being exchanged. |
debug ip ospf hello | Displays when Hello packets are received and sent by the router over the various OSPF enabled interfaces in a router. |
debug ip ospf lsa-generation | Displays the events that occur when an LSA is generated. |
debug ip ospf packet | Displays types of packets generated during all subprocesses of the OSPF routing process. |
debug ip ospf retransmission | Displays the OSFP retransmission events. |
debug ip ospf spf | Displays packet-level exchanges that take place during computation of the SPF algorithm to generate the best path to a destination. |
debug ip ospf tree | Displays events leading to the computation of the OSPF tree structure. |
Note | The debug ip ospf packet command should be used with care, because this command can be quite resource consuming in an OSPF network with a large number of nodes. |
Consider the example depicted in Figure 9.1. The output of some of the debug commands is discussed. The output for the debug ip ospf hello command is shown in Listing 9.7.
Listing 9.7 Output of the debug ip ospf hello Command at B1
B1#debug ip ospf hello OSPF hello events debugging is on B1# B1# B1# 12w2d: OSPF: Rcv hello from 203.197.119.122 area 5 from Ethernet0/0 203.197.119.122 12w2d: OSPF: End of hello processing B1# 12w2d: OSPF: Rcv hello from 203.197.120.90 area 5 from Ethernet0/0 203.197.119.4 12w2d: OSPF: End of hello processing B1# B1# 12w2d: OSPF: Rcv hello from 203.197.120.222 area 5 from Ethernet0/0 203.197.119.10 12w2d: OSPF: End of hello processing B1# 12w2d: OSPF: Rcv hello from 203.197.119.122 area 5 from Ethernet0/0 203.197.119.122 B1# 12w2d: OSPF: Rcv hello from 203.197.120.90 area 5 from Ethernet0/0 203.197.119.4 12w2d: OSPF: End of hello processing B1#undebug all All possible debugging has been turned off B1# B1# 12w2d: OSPF: Rcv hello from 203.197.119.122 area 5 from Ethernet0/0 203.197.119.122 12w2d: OSPF: End of hello processing B1#
Output of the debug ip ospf adj command is shown in Listing 9.8.
Listing 9.8 Output of the debug ip ospf adj Command at B1
B1#debug ip ospf adj OSPF adjacency events debugging is on B1# 12w2d: OSPF: Interface Ethernet0/0 going Down 12w2d: OSPF: 192.168.119.1 address 192.168.119.1 on Ethernet0/0 is dead, state D OWN 12w2d: OSPF: Neighbor change Event on interface Ethernet0/0 12w2d: OSPF: DR/BDR election on Ethernet0/0 12w2d: OSPF: Elect BDR 192.168.120.90 12w2d: OSPF: Elect DR 192.168.120.222 12w2d: DR: 192.168.120.222 (Id) BDR: 203.200.163.1 (Id) 12w2d: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.119.122 on Ethernet0/0 from 2WAY t o DOWN, Neighbor Down: Interface down or detached 12w2d: OSPF: Neighbor change Event on interface Ethernet0/0 12w2d: OSPF: DR/BDR election on Ethernet0/0 12w2d: OSPF: Elect BDR 192.168.120.90 12w2d: OSPF: Elect DR 192.168.120.222 12w2d: DR: 92.168.120.222 (Id) BDR: 192.168.120.90 (Id) 12w2d: OSPF: Send DBD to 192.168.120.90 on Ethernet0/0 seq 0x2063 opt 0x42 flag 0x7 len 32 12w2d: OSPF: 192.168.120.90 address 92.168.119.4 on Ethernet0/0 is dead, state DOWN 12w2d: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.120.90 on Ethernet0/0 from EXSTART to DOWN, Neighbor Down: Interface down or detached 12w2d: OSPF: Neighbor change Event on interface Ethernet0/0 12w2d: OSPF: DR/BDR election on Ethernet0/0 12w2d: OSPF: Elect BDR 0.0.0.0 12w2d: OSPF: Elect DR 192.168.120.222 12w2d: DR: 192.168.120.222 (Id) BDR: none 12w2d: OSPF: 192.168.120.222 address 192.168.119.10 on Ethernet0/0 is dead, stat eDOWN 12w2d: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.120.222 on Ethernet0/0 from FULL t oDOWN, Neighbor Down: Interface down or detached B1#
Output of the debug ip ospf events command is shown in Listing 9.9.
Listing 9.9 Output of the debug ip ospf events Command at B1
B1#debug ip ospf events 12w2d: OSPF: Rcv hello from 192.168.119.122 area 5 from Ethernet0/0 192.168.119.122 12w2d: OSPF: End of hello processing 12w2d: OSPF: Rcv hello from 192.168.120.90 area 5 from Ethernet0/0 192.168.119.4 12w2d: OSPF: End of hello processing 12w2d: OSPF: Rcv hello from 192.168.119.122 area 5 from Ethernet0/0 192.168.119.122 12w2d: OSPF: Rcv hello from 192.168.120.90 area 5 from Ethernet0/0 192.168.119.4 12w2d: OSPF: End of hello processing
The output for the debug ip ospf packet command is shown in Listing 9.10.
Listing 9.10 Output of the debug ip ospf packet Command at B1
B1#debug ip ospf packet 12w2d: OSPF: rcv. v:2 t:1 l:100 rid:192.168.120.90 aid:0.0.0.5 chk:97FE aut:1 auk: from Ethernet0/0 12w2d: OSPF: rcv. v:2 t:1 l:100 rid:192.168.119.122 aid:0.0.0.5 chk:87FE aut:1 auk: from Ethernet0/0 12w2d: OSPF: rcv. v:2 t:1 l:100 rid:192.168.120.90 aid:0.0.0.5 chk:97FE aut:1 auk: from Ethernet0/0 12w2d: OSPF: rcv. v:2 t:1 l:100 rid:192.168.119.122 aid:0.0.0.5 chk:87FE aut:1 auk: from Ethernet0/0