Understanding Show IP Route

On Cisco Layer 3 devices, the Show IP Route command tells us about all the L3 routes the device knows about (though you will have to specify the VRF if you are using that too).

Let’s take a look at the sample output below, taken kindly and slightly adapted from this website.

ROUTER# show ip route

Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is 192.168.5.10 to network 0.0.0.0

C    192.168.5.0/24 is directly connected, FastEthernet0/1
C    192.168.1.0/24 is directly connected, FastEthernet0/0
     192.168.100.0/24 is variably subnetted, 2 subnets, 2 masks
S       192.168.100.0/24 [1/0] via 192.168.5.2
S       192.168.100.75/32 [1/0] via 192.168.5.5
O    192.68.132.0 [110/5] via 192.168.5.10, 0:00:59, FastEthernet0/2
O    192.168.150.0 [110/5] via 192.168.5.10, 0:00:59, FastEthernet0/2
O    192.168.150.0 [110/10] via 192.168.5.20, 0:01:59, FastEthernet0/3
O    192.168.200.0 [110/5] via 192.168.5.20, 0:00:59, FastEthernet0/3
D    192.168.200.0 [90/6] via 192.168.5.10, 0:00:59, FastEthernet0/2

Codes and the Gateway of Last Resort

Thankfully, the output of this command gives us some information on how to interpret the details we are given. Lines 3-9 tell us what the letters in the first column of the output stand for, the Routing Protocol of choice that the route uses or how the Route is learnt.

On Line 11 we can see that the ‘Gateway of Last Resort’ is set to be 131.119.254.240. This device will forward a packet to this address when it does not have a specific route for it.

Routes, Admin Distances and Metrics

The biggest thing that confused me when I first started out were the two numbers in the brackets next to each of the routes in the list known as the Admin Distance/Metric.

Lets post the relevant output below so we can look at it much more easily:

Gateway of last resort is 192.168.5.10 to network 0.0.0.0

C    192.168.5.0/24 is directly connected, FastEthernet0/1
C    192.168.1.0/24 is directly connected, FastEthernet0/0
     192.168.100.0/24 is variably subnetted, 2 subnets, 2 masks
S       192.168.100.0/24 [1/0] via 192.168.5.2
S       192.168.100.75/32 [1/0] via 192.168.5.5
O    192.68.132.0 [110/5] via 192.168.5.10, 0:00:59, FastEthernet0/2
O    192.168.150.0 [110/5] via 192.168.5.10, 0:00:59, FastEthernet0/2
O    192.168.150.0 [110/10] via 192.168.5.20, 0:01:59, FastEthernet0/3
O    192.168.200.0 [110/5] via 192.168.5.20, 0:00:59, FastEthernet0/3
D    192.168.200.0 [90/6] via 192.168.5.10, 0:00:59, FastEthernet0/2

We have a mixture of Directly Connected, Static, EIGRP and OSPF Routes.

The 2 main questions we should be asking ourselves are:

  1. What happens when the Router has to decide between similar Routes using the same Protocol?
  2. What happens when the Router has to decide between similar Routes using a different Protocol?

How does the Router decide? Here’s where the numbers in the brackets come in.

Scenario #1 – Similar Routes Using the Same Protocol

From the Routes above, lets take the ones from Lines 9-10:

O    192.168.150.0 [110/5] via 192.168.5.10, 0:00:59, FastEthernet0/2
O    192.168.150.0 [110/10] via 192.168.5.20, 0:01:59, FastEthernet0/3

As we can see, these 2 Routes to the same destination 141.140.0.0 are both using EIGRP. So how does the Router know which Route to use? (Try saying that fast!)

This is where its helpful to know about Administrative Distance, the first value in the brackets. Each Route is rated on its ‘reliability’. The smaller the Administrative Distance value, the more ‘reliable’ the Route. In the Networking world, different Routing Protocols have default values for their Administrative Distances, some are listed below.

Protocol/METHODDefault Admin distance value
Directly Connected0
Static Route1
External BGP20
EIGRP90
OSPF110
IS-IS115
RIP120
Internal BGP200

So now after explaining that, we can see that the Admin Distance … isnt going to be the factor that decides which Route is ultimately used for traffic to 192.168.150.0, clearly we need another variable.

This is where the second value in the brackets, the Metric value, comes in.

Each Routing Protocol uses its own variable to determine the difference between Routes, and in this case this will be the deciding factor. OSPF uses Cost (the best path within the OSPF network) to determine the Metric value of an OSPF Route. Again, the lower the Metric value, the better and more preferred the Route. Other Protocols may use metrics calculated using Bandwidth, Latency and more.

In our example, we can clearly see that the first Route is preferred since it has the lower OSPF Metric of 5 compared to 10 for the other Route. Therefore packets destined for 192.168.150.0 will go via FastEthernet0/2.

Scenario #2 – Similar Routes Using Different Protocols

Lets choose the Routes on Lines 11-12. These are again the same Route but use different Routing Protocols, one is using OSPF and the other EIGRP.

O    192.168.200.0 [110/5] via 192.168.5.20, 0:00:59, FastEthernet0/3
D    192.168.200.0 [90/6] via 192.168.5.10, 0:00:59, FastEthernet0/2

Though we have already discussed the concept of Metrics in the first scenario, we wont need to use it here at all. Here the Admin Distance values will easily make that decision.

Remember that the lower the value the better. The EIGRP Route has an Admin Distance value of 90 compared to the 110 of the OSPF route. Therefore the packets destined for 192.168.200.0 will go through the EIGRP Route via FastEthernet0/2.

Other Details

We also have information on when the Route information was last updated, and what the next hop for a particular Route is.

I hope this short post has been beneficial!



Leave a Reply

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

Fill out this field
Fill out this field
Please enter a valid email address.

Subscribe to Blog

Enter your email below to subscribe to this blog.

Ads