This is a follow-up article to part 1 of the OSPF configuration overview. In here we will go over some of the verification commands that will help us with troubleshooting issues that may arise. At this point in time we have covered the majority of the basic OSPF configuration and I will now move to the informational commands. The first useful command is the “show ip protocols” which tells us what routing protocols are currently running on this router.

OSPF-PROT-1

Starting at the top we can tell that the OSPF process ID is 25 on this router. Moving on down we have the router ID which we have hard-coded for good practice so that it does not change on us. The next line tells us the number of areas that this router is supporting and if this was an ABR then we would see a number greater than 1. This also list the type of area currently being supported by this router and we have already covered the normal(transit) area as well as the a stub area. We will cover NSSA in the advanced session of OSPF later on. The maximum path is similar to the EIGRP maximum path which we covered before and will also look at later on. Moving on we have the networks that we are currently routing for that we have configured via the OSPF network command and the area that they belong to. The reference bandwidth which is listed as 100mb/s is very important as it is used for the metric calculation in OSPF. We will cover the OSPF metric formula next and explain why this parameter is important. The last two fields tell us our neighbors, their administrative distance, and the last time there was an update. The distance filed at the bottom is just the administrative distance for the protocol which we know is 110 for OSPF by default.

Let’s go ahead and look at the “show ip route” command and then we will talk about the OSPF metric to make sense of some of the parameters in the command.

OSPF-ROUTE-1

Starting from the left we have the codes listed where O stands for networks learned via OSPF and IA is for specifying that these are inter area routes or networks in different area than our own. Moving to the right we have the administrative distance which is listed as 110 since it is the default for OSPF. The administrative distance for a protocol tells you how believable that protocol is. The lower the administrative distance that a routing protocol has, the more believable it is. The number next to the administrative distance is the metric for OSPF which uses the following formula to calculate this information:

(Reference Bandwidth)/(Bandwidth in mb/s)

We know that OSPF uses a default reference bandwidth of 100 mb/s which makes the equation

(100mbps)/(Bandwidth in mbps)

Given that all of my interfaces in this example are fast Ethernet running at a speed of 100mbps then the default reference bandwidth is fine. In the real world though, you will see Fast Ethernet, Gigabit Ethernet, 40 Gigabit Ethernet, and 100 Gigabit Ethernet in network environments. What this means is that if you plug anything greater than 100 into the denominator then you will not get a whole number for a remainder. The metric by default will get rounded to the next biggest whole number if it results in a decimal value. We would then end up with a value of 1 for any interfaces with speed greater than 100. This will obviously impact the performance of our network as OSPF will think that Fast Ethernet is the same as 100 Gigabit Ethernet. Let’s go ahead and fix the formula on all of our routers in our enterprise so that we can cover the fastest links should we have 100 Gigabit Ethernet via the following command.

R1(config-router)#auto-cost reference-bandwidth BANDWIDTHINMBPS

For our case we will use the following

R1(config-router)#auto-cost reference-bandwidth 100000

OSPF-BW-1

Note the warning about this value being consistent across all your routers. The metric gets advertised by every router participating in OSPF whether it is a DR or a router that is not a DR. It is important that they all see the same cost across the entire OSPF domain for the different links. The other important point here is that you want to make the reference bandwidth number the fastest link in your environment or the next fastest that you will upgrade to in the future. Be careful not to make this value too high as you could run into issues where some of your slowest links will have a high cost and might be considered to have an infinite metric which would get them mark as inactive.

Let’s look at the “show ip protocols” output to verify the new reference bandwidth.

OSPF-PROT-2

And looking at the metric in the “show ip route” command.

OSPF-ROUTE-2

We will calculate the metric=cost to the 10.0.0.8/30 network from R1 so that we have an idea of how the metric calculations works. If you are a router in an area that is calculating the cost to a network that is not in your area then the first step that you do is calculate the cost to the ABR that leads you to that network. R1 will then calculate the cost to R2 which is the ABR that leads it to the 10.0.0.8/30 network. The cost to reach R2 is simply 100000Mbps/100Mbps = 1000 since R1 has a fast Ethernet link that leads it to R2 and we are also using the updated reference bandwidth as the numerator. The next step is for R1 to take this cost and add it to the cost to reach this network that is being advertised by R2. R2 being an ABR will already have cost values associated with all networks that correspond to its areas since it is located at the boundary. What this means for other routers that are traversing R2 to reach a certain network is that they can use the costs that the boundary router is advertising since it already knows the lowest cost to reach those network. We can then just use what they are advertising to come up with the final cost. Note that R2 would advertise the cost of the 10.0.0.8/30 network via a type 3 LSA to area 0 and if you look at my type 3 LSA example then you will see that there is a cost listed in these LSAs.

OSPF-DIAG-1

Calculating the cost to networks within your area is simple since every router in that area should know about all the different destinations and links since this is how OSPF operates. With a complete map of the network within an area, a router can simply calculate the most efficient path to a destination by using the formula that we covered and selecting the lowest cost route.

Another basic OSPF command but also important for verification is the “show ip ospf neighbor” which outputs a list of neighbors that you have an adjacency with.

OSPF-NEIG-1

It will list the neighbor ID, the priority that they are advertising to us(crucial in determining DR/BDR), current state, and whether they are the DR/BDR/DROTHER for this network segment. The last three columns list the dead time or how long we will wait until we consider them dead, their respective IP addresses, and our local interface that we are using for the adjacency.

Note: A DROTHER is labeled for a router that is neither a DR or BDR.

In the above output you should have noticed the state field which has a value of “full”. This field describes the current  OSPF state with the neighboring routers and it is useful for troubleshooting purposes. OSPF has 8 different states that it goes through until it reaches a full state with the neighbor and should anything be preventing it from moving forward to the next state then this can help with the troubleshooting. Here is a table of the 8 different OSPF states with their meaning

State Meaning
Down Hellos were not received and the dead timer countdown reach 0
Attempt Applicable when we manually configure OSPF neighbors and this router sends a hello message without receiving one from the manually configure neighbor
Init We received a hello message from the neighbor but it did not pass the neighbor validation checks or list my RID(router ID) as an active neighbor. See part 1 for a list of matching parameters before an OSPF adjacency can be established. The router will stay in this state until the parameters match.
2Way We received a hello message from our neighbor and the validation checks have passed. My RID is also listed in the hello packet as a neighbor.
ExStart Negotiating the DBD message sequence numbers and who will transmit first.
Exchange DBD message negotiation complete and exchanging DBD packets.
Loading DBD message transmission complete and currently exchanging LSR, LSU, and LSAck messages.
Full Neighbor adjacency complete and link state databases are identical for this area. The OSPF algorithm can now run to determine what paths to put into the routing table.

Note: The initial hello messages sent by routers do not contain a list of active neighbors but future ones will as the adjacency comes up. See below for a hello message from R1 that list both R2 and R4 as active neighbors.

OSPF-HELLO-1

The next command that we will look at is the “show ip ospf interface brief” command

OSPF-INT-1

This command list the interface in which OSPF is enabled based on the network commands that we used. Note that this command will omit passive interfaces which we will configured later on. On a similar note the “show ip ospf interface” command will give us the same information as above with more details:

OSPF-INT-2

The first line tells us the interface that it is enabled on and the physical/data link status which is UP/UP in this case. We get the IP address of the interface and the area that it belongs to. It still tells us the PID, RID, Cost, and network type which is a more advanced OSPF topic. The state and priority of the interface we have already covered before. It then list the DR and BDR for this broadcast network segment and the different timers in seconds that are configured on the interface. At the bottom we get a list of a complete neighbor count for this router.

That covers the majority of verification commands and this is good point to end this article. In the next part of the OSPF configuration overview I will cover the advanced OSPF topics. Thanks for reading this article and see you here next time.

Leave a Reply

Your email address will not be published. Required fields are marked *