Monday 28 October 2019

Troubleshooting OSPF and OSPFv3 Single Area Commands

Troubleshooting OSPF and OSPFv3 Single Area Commands

Troubleshooting OSPF  is a very important topic for network engineers. While troubleshooting you must have understanding of Troubleshooting OSPF commands. When troubleshooting OSPF neighbors, be aware that the FULL or 2WAY states are normal. Commands for troubleshooting OSPF for IPv4 are discussed in detail. The troubleshooting of OSPFv3 is similar to that of OSPFv2, which you learn at the end of this post.

OSPF States

To solve OSPF problems, it is important to understand how OSPF routers go through different OSPF states when adjacencies are established.
In the illustration, the OSPF states are indicated and a summary of the functions of each state is provided.

Transition Table through OSPF states.
State
Description
Down state
No greeting package received = Down.
The router sends hello packets.
Transition to Init status.
Init Status
The neighbor's greeting packages are received.
These contain the sender router ID.
Transition to the Two-Way state.
Two-Way Status
On Ethernet links, a DR and a BDR are chosen.
Transition to ExStart state.
ExStart Status
The master / slave relationship and the sequence number of the DBD packet are negotiated.
The master starts the exchange of DBD packages.
Exchange Status
Routers exchange DBD packets.
If additional router information is required, the transition to Loading is made; otherwise, the transition to Full is made.
Loading status
LSRs and LSUs are used to obtain additional route information.
Routes are processed using the SPF algorithm.
Transition to the Full state.
Full state
The routers converged.
When troubleshooting OSPF neighbors, be aware that the FULL or 2WAY states are normal. All other states are temporary , that is, the router should not remain in those states for extended periods.

Commands for Troubleshooting OSPF

There are many different OSPF commands that can be used to facilitate the troubleshooting process. The following are the most common commands:

show ip protocols

It is used to verify fundamental OSPF configuration information, such as the OSPF process ID, the router ID, the networks announced by the router, the neighbors from which the router receives updates, and the default administrative distance, which for OSPF is 110 .

 show ip ospf neighbor

It is used to verify if the router formed an adjacency with neighboring routers.

  • It shows the ID of the neighbor router, the priority of the neighbor, the OSPF status, the timeout timer, the IP address of the neighboring interface and the interface through which the neighbor can be accessed.
  • If the neighbor router ID is not displayed or is not displayed in the FULL or 2WAY state, the two routers did not form an OSPF adjacency. If two routers did not establish adjacency, the link-state information will not be exchanged.
  • Incomplete link-state databases can create SPF trees and inaccurate routing tables. It is possible that there are no routes to the destination networks or they may not represent the most optimal route.

show ip ospf interface

It is used to display the OSPF parameters that were configured on an interface, such as the ID of the OSPF process to which the interface was assigned, the area in which the interfaces are located, the cost of the interface and the greeting and dead intervals .
If the name and interface number is added to the command, the result for a specific interface is displayed. Learn about OSPF Interface configurations

show ip ospf

It is used to examine the OSPF process ID and the router ID. In addition, this command shows OSPF area information and the last time the SPF algorithm was calculated.

show ip route ospf

It is used to show only the OSPF routes discovered in the routing table. The result shows that R1 discovered about four remote networks through OSPF.
clear ip ospf [ process-id ] process : used to reset the adjacencies of OSPFv2 neighbors.

Components of OSPF troubleshooting

As shown in the illustration, in general, OSPF problems are related to one of the following aspects:

  • Adjacences of neighbors
  • Missing Routes
  • Route selection

When troubleshooting neighbors, verify if the router established adjacencies with neighboring routers using the show ip ospf neighbors command .

  • If there are no adjacencies, routers cannot exchange routes. Check if the interfaces work and are enabled for OSPF using the show ip interface brief and show ip ospf interface commands .
  • Now, if the interfaces work and are enabled for OSPF, make sure that the interfaces on both routers are configured for the same OSPF area and are not configured as passive interfaces.
  • If the adjacency between the two routers is established, verify that there are OSPF routes in the routing table using the show ip route ospf command.
  • If there are no OSPF routes, verify that there are no other routing protocols with lower administrative distances running on the network. Verify if all required networks are advertised in OSPF. Also check if there is an access list configured on a router that could filter incoming or outgoing routing updates.
If all the required routes are in the routing table but the route the traffic takes is incorrect, verify the OSPF cost of the interfaces on the route. Also, pay special attention in cases where the interfaces have a speed greater than 100 Mb / s, since all interfaces above this bandwidth have the same OSPF cost by default.

Solving single-area OSPF Routing problems

Troubleshooting OSPF Neighbors

In this example, we will demonstrate how to solve neighbor problems . In the topology of Image 9, all routers were configured to support OSPF routing.

A look at the routing table of R1, shown in following figure, lets us know that it does not add OSPF routes.
There are several possible reasons for this. However, a requirement for a neighbor relationship between two routers to form is the layer 3 connectivity of the OSI model.
The result of following image confirms that the S0 / 0/0 interface is active and functioning. The correct ping also confirms that the R2 serial interface is active. A correct ping does not mean that an adjacency will form, because there may be overlapping subnets.
You should still verify that the interfaces on the connected devices share the same subnet. If the ping was not correct, check the wiring and verify that the interfaces on the connected devices are configured correctly and work.

Enable an interface for OSPF

To enable an interface for OSPF, you must configure a network command that matches during the OSPF routing process. Active OSPF interfaces can be verified using the show ip ospf interface command . The result of Image 12 verifies that the Serial 0/0/0 interface is enabled for OSPF. If the interfaces connected on two routers are not enabled for OSPF, neighbors will not form an adjacency.

Verify the OSPF configuration using the show ip protocols command . The result shown in following Image verifies that OSPF is enabled and also lists the networks that are advertised as enabled through the network command. If an IP address on an interface is included in an OSPF-enabled network, the interface is enabled for OSPF.

Disable the interface as passive

However, note that the Serial 0/0/0 interface is listed as passive. Remember that the passive-interface command stops incoming and outgoing routing updates, because the effect of the command causes the router to stop sending and receiving hello packets through an interface. For this reason, routers will not form a neighbor relationship.
To disable the interface as passive, use the no passive-interface command of the router configuration mode, as shown in Image below. After disabling the passive interface, the routers establish an adjacency, as indicated by the generated information message automatically.

A quick check of the routing table, shown in following Image, confirms that OSPF now exchanges routing information.

Another problem that may arise is that two neighboring routers have incompatible MTU sizes on the connected interfaces .
The MTU size is the largest network layer packet that the router forwards through each interface. By default, routers have an MTU size of 1500 bytes. However, this value can be changed for IPv4 packets using the ip mtu size interface configuration command or the mv size ipv6 interface command for IPv6 packets.
If two connected routers had incompatible MTU values, they would also try to form an adjacency, but would not exchange their LSDBs and the neighbor relationship would fail.

Troubleshooting the OSPF routing table

In the illustration topology, all routers were configured to support OSPF routing.

A look at the routing table of R1 (shown in following image) allows us to know that it receives information from the default route, the R2 LAN (172.16.2.0/24) and the link between R2 and R3 (192.18.10.8/30 ). However, it does not receive the OSPF LAN route from R3.

The result of following Image verifies the OSPF configuration on R3. Note that R3 only announces the link between R3 and R2, but does not announce the R3 LAN (192.168.1.0/24).

To enable an interface for OSPF, you must configure a network command that matches during the OSPF routing process. The result of Image (show running config) confirms that the R3 LAN is not announced on OSPF.

The result of Image verifies that the R3 LAN is now in the R1 routing table.

Commands for troubleshooting OSPFv3

See the Illustration for the OSPFv3 reference topology.

The troubleshooting of OSPFv3 is almost identical to that of OSPFv2; Therefore, many OSPFv3 commands and troubleshooting criteria also apply to OSPFv3.
For example, the following are the equivalent commands used with OSPFv3:

show ipv6 protocols

This command is used to verify fundamental OSPFv3 configuration information, including the OSPFv3 process ID, the router ID and the interfaces from which the router receives updates

show ipv6 ospf neighbor

It is used to verify that the router formed an adjacency with neighboring routers.

  • This result shows the ID of the neighbor router, the priority of the neighbor, the status of OSPFv3, the timeout timer, the ID of the neighboring interface and the interface through which the neighbor can be accessed.
  • If the neighbor router ID is not shown or is not displayed in the FULL or 2WAY state, the two routers did not form an OSPFv3 adjacency.
  • If two routers did not establish adjacency, the link-state information will not be exchanged. Incomplete link-state databases can create SPF trees and inaccurate routing tables. It is possible that there are no routes to the destination networks or that these are not the best routes.

show ipv6 ospf interface

It is used to display the OSPFv3 parameters that were configured in an interface, such as the OSPFv3 process ID to which the interface was assigned, the area in which the interfaces are located, the interface cost and the greeting and dead intervals .
If the name and interface number is added to the command, the result for a specific interface is displayed.

show ipv6 ospf

It is used to examine the OSPF process ID and router ID, as well as information on LSA transmissions

show ipv6 route ospf

It is used to show only the OSPFv3 routes discovered in the routing table. The result shows that R1 discovered about four remote networks using OSPFv3.

No comments:

Post a Comment