Different metrics used and the show ip route command
show ip route command
The show ip route command shows you which BGP routes have made it to the IP routing table. BGP is NOT used to make forwarding decisions on data, it is used to learn the single best path to a destination network. To do this, BGP listens for routes and advertises the best routes it knows. BGP also places the best route it knows for each destination (prefix) into the IP routing table. A Cisco router uses the Best Path Selection Algorithm to select the single best route to a destination and then inserts it into the IP routing table.
To check a router's IP routing table for a given destination (such as Yahoo), simply use the show ip route command:
route-server>show ip route 216.109.127.30
Routing entry for 216.109.112.0/20, supernet
Known via "bgp 65000", distance 20, metric 0
Tag 7018, type external
Last update from 12.123.9.241 1d17h ago
Routing Descriptor Blocks:
* 12.123.9.241, from 12.123.9.241, 1d17h ago
Route metric is 0, traffic share count is 1
AS Hops 5
Route tag 7018
From the above output, the route to Yahoo (216.109.127.30 in this case) is known via an external BGP peer. As this is the ONLY route to the destination, this is the preferred route.
show ip route
To display the current state of the routing table, use the show ip route command in EXEC mode.
show ip route [[ip-address [mask] [longer-prefixes]] | [protocol [process-id]] | [list access-list-number | access-list-name]]
Syntax Description
ip-address |
(Optional) Address about which routing information should be displayed. |
mask |
(Optional) Argument for a subnet mask. |
longer-prefixes |
(Optional) Specifies that only routes matching the ip-address and mask pair should be displayed. |
protocol |
(Optional) Name of a routing protocol, or the keyword connected, static, or summary. If you specify a routing protocol, use one of the following keywords: bgp, egp, eigrp, hello, igrp, isis, ospf, and rip. |
process-id |
(Optional) Number used to identify a process of the specified protocol. |
list |
(Optional) The list keyword is required to filter output by an access list name or number. |
access-list-name |
(Optional) Filters the displayed output from the routing table based on the specified access list name. |
access-list-number |
(Optional) Filters the displayed output from the routing table based on the specified access list number. |
Command Modes
EXEC
Examples
The following is sample output from the show ip route command when entered without an address:
Router# show ip route
Codes: I - IGRP derived, R - RIP derived, O - OSPF derived,
C - connected, S - static, E - EGP derived, B - BGP derived,
* - candidate default route, IA - OSPF inter area route,
i - IS-IS derived, ia - IS-IS, U - per-user static route,
o - on-demand routing, M - mobile, P - periodic downloaded static route,
D - EIGRP, EX - EIGRP external, E1 - OSPF external type 1 route,
E2 - OSPF external type 2 route, N1 - OSPF NSSA external type 1 route,
N2 - OSPF NSSA external type 2 route
Gateway of last resort is 10.119.254.240 to network 10.140.0.0
O E2 172.150.0.0 [160/5] via 10.119.254.6, 0:01:00, Ethernet2
E 172.17.10.0 [200/128] via 10.119.254.244, 0:02:22, Ethernet2
O E2 172.70.132.0 [160/5] via 10.119.254.6, 0:00:59, Ethernet2
O E2 10.130.0.0 [160/5] via 10.119.254.6, 0:00:59, Ethernet2
E 172.30.0.0 [200/128] via 10.119.254.244, 0:02:22, Ethernet2
E 10.129.0.0 [200/129] via 10.119.254.240, 0:02:22, Ethernet2
E 172.80.129.0 [200/128] via 10.119.254.244, 0:02:22, Ethernet2
E 10.10.0.0 [200/128] via 10.119.254.244, 0:02:22, Ethernet2
E 172.60.139.0 [200/129] via 10.119.254.240, 0:02:23, Ethernet2
E 172.90.208.0 [200/128] via 10.119.254.244, 0:02:22, Ethernet2
E 192.84.148.0 [200/129] via 10.119.254.240, 0:02:23, Ethernet2
E 192.168.223.0 [200/128] via 10.119.254.244, 0:02:22, Ethernet2
E 192.44.236.0 [200/129] via 10.119.254.240, 0:02:23, Ethernet2
E 10.141.0.0 [200/129] via 10.119.254.240, 0:02:22, Ethernet2
E 141.140.0.0 [200/129] via 10.119.254.240, 0:02:23, Ethernet2
The following is sample output that includes IS-IS Level 2 routes learned:
Router# show ip route
Codes: I - IGRP derived, R - RIP derived, O - OSPF derived,
C - connected, S - static, E - EGP derived, B - BGP derived,
* - candidate default route, IA - OSPF inter area route,
i - IS-IS derived, ia - IS-IS, U - per-user static route,
o - on-demand routing, M - mobile, P - periodic downloaded static route,
D - EIGRP, EX - EIGRP external, E1 - OSPF external type 1 route,
E2 - OSPF external type 2 route, N1 - OSPF NSSA external type 1 route,
N2 - OSPF NSSA external type 2 route
Gateway of last resort is not set
172.180.0.0 is subnetted (mask is 255.255.255.0), 3 subnets
C 172.180.64.0 255.255.255.0 is possibly down,
routing via 0.0.0.0, Ethernet0
i L2 172.180.67.0 [115/20] via 172.180.64.240, 0:00:12, Ethernet0
i L2 172.180.66.0 [115/20] via 172.180.64.240, 0:00:12, Ethernet0
Table 57 describes the significant fields shown in the displays.
Table 57 show ip route Field Descriptions
Field
|
Description
|
---|---|
O |
Indicates protocol that derived the route. Possible values include the following: I—Interior Gateway Routing Protocol (IGRP) derived R—Routing Information Protocol (RIP) derived O—Open Shortest Path First (OSPF) derived C—connected S—static E—Exterior Gateway Protocol (EGP) derived B—Border Gateway Protocol (BGP) derived D—Enhanced Interior Gateway Routing Protocol (EIGRP) EX—EIGRP external i—IS-IS derived ia—IS-IS M—mobile P—periodic downloaded static route U—per-user static route o—on-demand routing |
E2 |
Type of route. Possible values include the following: *—Indicates the last path used when a packet was forwarded. It pertains only to the nonfast-switched packets. However, it does not indicate which path will be used next when forwarding a nonfast-switched packet, except when the paths are equal cost. IA—OSPF interarea route E1—OSPF external type 1 route E2—OSPF external type 2 route L1—IS-IS Level 1 route L2—IS-IS Level 2 route N1—OSPF not-so-stubby area (NSSA) external Type 1 route N2—OSPF NSSA external Type 2 route |
172.150.0.0 |
Indicates the address of the remote network. |
[160/5] |
The first number in the brackets is the administrative distance of the information source; the second number is the metric for the route. |
via 10.119.254.6 |
Specifies the address of the next router to the remote network. |
0:01:00 |
Specifies the last time the route was updated, in hours:minutes:seconds. |
Ethernet2 |
Specifies the interface through which the specified network can be reached. |
When you specify that you want information about a specific network displayed, more detailed statistics are shown. The following is sample output from the show ip route command when entered with the address 10.119.0.0:
Router# show ip route 10.119.0.0
Routing entry for 10.119.0.0 (mask 255.255.0.0)
Known via "igrp 109", distance 100, metric 10989
Tag 0
Redistributing via igrp 109
Last update from 10.108.35.13 on TokenRing0, 0:00:58 ago
Routing Descriptor Blocks:
* 10.108.35.13, from 10.108.35.13, 0:00:58 ago, via TokenRing0
Route metric is 10989, traffic share count is 1
Total delay is 45130 microseconds, minimum bandwidth is 1544 Kbit
Reliability 255/255, minimum MTU 1500 bytes
Loading 2/255, Hops 4
When an IS-IS router advertises its link-state information, it includes one of its own IP addresses to be used as the originator IP address. When other routers calculate IP routes, they can store the originator IP address with each route in the routing table.
The following example shows the output from the show ip route command when looking at an IP route generated by IS-IS. Each path that is shown under the Routing Descriptor Blocks report displays two IP addresses. The first address (10.22.22.2) is the next hop address, the second is the originator IP address from the advertising IS-IS router. This address helps you determine where a particular IP route has originated in your network. In the example the route to 10.0.0.1/32 was originated by a router with IP address 223.191.255.247.
Router# show ip route 10.0.0.1
Routing entry for 10.0.0.1/32
Known via "isis", distance 115, metric 20, type level-1
Redistributing via isis
Last update from 223.191.255.251 on Fddi1/0, 00:00:13 ago
Routing Descriptor Blocks:
* 10.22.22.2, from 223.191.255.247, via Serial2/3
Route metric is 20, traffic share count is 1
223.191.255.251, from 223.191.255.247, via Fddi1/0
Route metric is 20, traffic share count is 1
Compare the report using the show ip route command with an IP address to the following report using the show ip route isis command:
Router# show ip route isis
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
i L1 10.0.0.1/32 [115/20] via 10.22.22.2, Serial2/3
[115/20] via 223.191.255.251, Fddi1/0
22.0.0.0/24 is subnetted, 2 subnets
i L1 22.22.23.0 [115/20] via 223.191.255.252, Fddi1/0
Table 58 describes the significant fields shown when using the show ip route command with an IP address (previous displays).
Table 58 show ip route with Address Field Descriptions
Field
|
Description
|
---|---|
Routing entry for 10.119.0.0 (mask 255.255.0.0) |
Network number and mask. |
Known via ... |
Indicates how the route was derived. |
distance |
Administrative distance of the information source. |
Tag |
Integer that is used to implement the route. |
Redistributing via ... |
Indicates the redistribution protocol. |
Last update from 10.108.35.13 on ... |
Indicates the IP address of a router that is the next hop to the remote network and the router interface on which the last update arrived. |
0:00:58 ago |
Specifies the last time the route was updated, in hours:minutes:seconds. |
Routing Descriptor Blocks: |
Displays the next hop IP address followed by the information source. |
10.108.35.13, from 10.108.35.13, 0:00:58 ago |
Indicates the next hop address, the address of the gateway that sent the update, and the time that has elapsed since this update was received, in hours:minutes:seconds. |
from...via ... |
The first address is the next hop IP address, and the other is the information source. This report is followed by the interface for this route. |
Route metric |
This value is the best metric for this routing descriptor block. |
traffic share count |
Number of uses for this routing descriptor block. |
Total delay |
Total propagation delay (in microseconds). |
minimum bandwidth |
Minimum bandwidth encountered when sending data along this route. |
Reliability 255/255 |
Likelihood of successful packet transmission expressed as a number from 0 to 255 (255 is 100 percent reliability). |
minimum MTU |
Smallest maximum transmission unit (MTU) along the path. |
Loading 2/255 |
Effective bandwidth of the route in kbps/255 is saturation. |
Hops |
Number of hops to the destination or to the router where the route first enters IGRP. |
The following is sample output using the longer-prefixes keyword. When the longer-prefixes keyword is included, the address and mask pair becomes the prefix, and any address that matches that prefix is displayed. Therefore, multiple addresses are displayed.
In the following example, the logical AND operation is performed on the source address 128.0.0.0 and the mask 128.0.0.0, resulting in 128.0.0.0. Each destination in the routing table is also logically ANDed with the mask and compared to that result of 128.0.0.0. Any destinations that fall into that range are displayed in the output.
Router# show ip route 128.0.0.0 128.0.0.0 longer-prefixes
Codes: I - IGRP derived, R - RIP derived, O - OSPF derived,
C - connected, S - static, E - EGP derived, B - BGP derived,
* - candidate default route, IA - OSPF inter area route,
i - IS-IS derived, ia - IS-IS, U - per-user static route,
o - on-demand routing, M - mobile, P - periodic downloaded static route,
D - EIGRP, EX - EIGRP external, E1 - OSPF external type 1 route,
E2 - OSPF external type 2 route, N1 - OSPF NSSA external type 1 route,
N2 - OSPF NSSA external type 2 route
Gateway of last resort is not set
S 10.134.0.0 is directly connected, Ethernet0
S 10.10.0.0 is directly connected, Ethernet0
S 10.129.0.0 is directly connected, Ethernet0
S 172.30.0.0 is directly connected, Ethernet0
S 172.40.246.0 is directly connected, Ethernet0
S 172.20.97.0 is directly connected, Ethernet0
S 172.50.88.0 is directly connected, Ethernet0
S 172.19.141.0 is directly connected, Ethernet0
S 172.60.138.0 is directly connected, Ethernet0
S 192.44.237.0 is directly connected, Ethernet0
S 192.168.222.0 is directly connected, Ethernet0
S 172.90.209.0 is directly connected, Ethernet0
S 10.145.0.0 is directly connected, Ethernet0
S 10.141.0.0 is directly connected, Ethernet0
S 10.138.0.0 is directly connected, Ethernet0
S 10.128.0.0 is directly connected, Ethernet0
172.19.0.0 255.255.255.0 is subnetted, 1 subnets
C 172.19.64.0 is directly connected, Ethernet0
172.110.0.0 is variably subnetted, 2 subnets, 2 masks
C 172.110.232.32 255.255.255.240 is directly connected, Ethernet0
S 172.110.0.0 255.255.0.0 is directly connected, Ethernet0
Router#
Metrics
Metrics
A routing protocol uses a metric to determine which route to include in the routing table when it has two available routes to the same destination. The router will include the route with the smallest metric because it considers this route to be the shortest—and therefore best.
As opposed to administrative distance, metrics involve a single routing protocol. They have nothing to do with multiple sources for routes.
For example, here's a look at the truncated output of a show ip eigrp topology command:
P 10.55.103.0/24, 1 successors, FD is 6049536 via 10.220.100.1 (6049536/5537536), Serial3/0 via 10.55.100.14 (52825600/281600), Tunnel55
Notice that this routing protocol, EIGRP, has two routes to this network. However, the router will only include one of these routes—the one with the best metric—in the routing table. Here's an example of what the entry in the routing table looks like:
Router# show ip route 10.55.103.0 Routing entry for 10.55.103.0/24 Known via "eigrp 100", distance 120, metric 6049536, type internal Redistributing via eigrp 100 Last update from 10.220.100.1 on Serial3/0, 00:56:12 ago Routing Descriptor Blocks: * 10.220.100.1, from 10.220.100.1, 00:56:12 ago, via Serial3/0 Route metric is 6049536, traffic share count is 1 Total delay is 41000 microseconds, minimum bandwidth is 512 Kbit Reliability 226/255, minimum MTU 1500 bytes Loading 1/255, Hops 2
Different routing protocols calculate their metric in different ways. RIP uses hops, OSPF uses bandwidth, and EIGRP uses a combination of bandwidth, delay, load, and reliability.
If the router has two types of routes, for the same network, the router chooses Administrative Distance to choose the best one. But in some cases, there will be two paths found by the same protocol, to the destination network. Here the routing protocol will use routing metric value to find the best path.
Example: RIP (Routing Information Protocol) uses hop count as the metric.
Following are some of the factors to choose a best path to destination.
tination.
Metric |
Routing Protocols |
Description |
Bandwidth |
The bandwidth of the links in Kbps (T1=1,554) |
|
Cost |
Measurement in the inverse of the bandwidth of the links |
|
Delay |
IP EIGRP, IP IGRP |
Time it takes to reach the destination |
Hop count |
How many routers away from the destination |
|
Load |
IP EIGRP, IP IGRP |
The path with the least utilization |
Reliability |
IP EIGRP, IP IGRP |
The path with the least amount of errors or downtime |
If a router found multiple paths with the same administrative distance and metric to a destination, load balancing can occur. Cisco IOS Software has a limit of six equal-cost routes on the routing table, but some protocols set their own limitations. For example, EIGRP allows up to four equal-cost routes.