Display the current state of the routing table, including routes not used for forwarding.
You can display all routes, a specific route, best route to a resolved domain name, all routes beginning with a specified address, routes for a particular protocol (BGP, IS-IS, OSPF, or RIP), locally connected routes, internal control routes, static routes, or summary counters for the routing table.
To display only the best routes that are used for forwarding:
host1#show ip route Protocol/Route type codes: I1- ISIS level 1, I2- ISIS level2, I- route type intra, IA- route type inter, E- route type external, i- metric type internal, e- metric type external, O- OSPF, E1- external type 1, E2- external type2, N1- NSSA external type1, N2- NSSA external type2 L- MPLS label, V- VR/VRF, *- indirect next-hop
Prefix/Length Type Next Hop Dist/Met Intf ------------- ---- -------- -------- ------ 172.16.2.0/24 Bgp 192.168.1.102 20/1 fastEthernet0/0 10.10.0.112/32 Static 192.168.1.1 1/1 fastEthernet0/0 10.1.1.0/24 Connect 10.1.1.1 0/1 atm3/0.100
To display only the static routes from the routing table:
host1#show ip route static Protocol/Route type codes: I1- ISIS level 1, I2- ISIS level2, I- route type intra, IA- route type inter, E- route type external, i- metric type internal, e- metric type external, O- OSPF, E1- external type 1, E2- external type2, N1- NSSA external type1, N2- NSSA external type2 L- MPLS label, V- VR/VRF, *- indirect next-hop
Prefix/Length Type Next Hop Dist/Met Intf ------------- ---- -------- -------- -------------- 10.10.0.112/32 Static 192.168.1.1 1/1 fastEthernet0/0
To display the summary information for all routes available in the routing table:
host1#show ip route summary Unicast routes: 8 total routes, 576 bytes in route entries 0 isis routes 0 rip routes 3 static routes 2 connected routes 1 bgp routes 0 ospf routes 2 other internal routes 0 access routes 0 internally created access host routes
Last route added/deleted: 2::4/128 by BGP At MON FEB 04 2008 14:18:25 UTC
Unicast routes used only for Multicast RPF check: 0 total routes, 0 bytes in route entries 0 isis routes 0 rip routes 0 static routes 0 connected routes 0 bgp routes 0 ospf routes 0 other internal routes 0 access routes 0 internally created access host routes 0 mbgp routes 0 dvmrp routes
Last route added/deleted: null by Invalid At MON FEB 04 2008 14:18:04 UTC
MPLS tunnel routes (not used for forwarding): 3 total routes, 216 bytes in route entries 1 bgp tunnel routes 1 ldp tunnel routes 1 rsvp tunnel routes
Last route added/deleted: 2::4/128 by BGP Tunnel At MON FEB 04 2008 14:18:26 UTC
To display all routes in the routing table inserted from all protocols (not just the best routes that are used for forwarding):
host1#show ip route all Protocol/Route type codes: I1- ISIS level 1, I2- ISIS level2, I- route type intra, IA- route type inter, E- route type external, i- metric type internal, e- metric type external, O- OSPF, E1- external type 1, E2- external type2, N1- NSSA external type1, N2- NSSA external type2 L- MPLS label, V- VR/VRF, *- indirect next-hop
Prefix/Length Type Next Hop Dist/Met Intf ------------- ---- -------- -------- ------ 0.0.0.0/0 Static 192.168.1.1 1/1 fastEthernet0/0
1.1.1.1/32 I2-E-i 192.168.1.105 115/10 fastEthernet0/0
6.6.6.0/24 Static 192.168.1.1 1/1 fastEthernet0/0
6.33.5.0/24 Static 0.0.0.0 1/1 loopback2
8.8.8.0/24 I2-E-i 192.168.1.105 115/10 fastEthernet0/0
9.9.9.9/32 I2-E-i 192.168.1.105 115/10 fastEthernet0/0
10.0.0.0/8 I2-E-i 192.168.1.105 115/10 fastEthernet0/0
10.10.0.156/32 Static 192.168.1.1 1/1 fastEthernet0/0
11.1.1.1/32 I2-E-i 192.168.1.105 115/10 fastEthernet0/0
11.11.11.12/32 I2-I-i 192.168.1.105 115/10 fastEthernet0/0
22.2.0.0/16 I2-I-i 92.168.1.105 115/10 fastEthernet0/0
34.0.0.0/8 I2-E-i 192.168.1.105 115/10 fastEthernet0/0
172.20.32.0/24 Static 192.168.1.1 1/1 fastEthernet0/0
174.20.32.0/24 I2-I-i 192.168.1.105 115/20 fastEthernet0/0
176.20.32.0/24 Connect 176.20.32.1 0/1 loopback1
192.168.1.0/24 Connect 192.168.1.214 0/1 fastEthernet0/0
201.1.1.0/24 I2-E-i 192.168.1.105 115/10 fastEthernet0/0
201.2.1.0/24 I2-E-i 192.168.1.105 115/10 fastEthernet0/0
201.3.1.0/24 I2-E-i 192.168.1.105 115/10 fastEthernet0/0
202.1.1.1/32 I2-E-i 192.168.1.105 115/10 fastEthernet0/0
207.1.1.0/24 I2-E-i 192.168.1.105 115/10 fastEthernet0/0
To display only the best routes that are used for forwarding (after adding routes with indirect hop):
host1#show ip route
Protocol/Route type codes:
I1- ISIS level 1, I2- ISIS level2,
I- route type intra, IA- route type inter, E- route type external,
i- metric type internal, e- metric type external,
O- OSPF, E1- external type 1, E2- external type2,
N1- NSSA external type1, N2- NSSA external type2
L- MPLS label, V- VR/VRF, *- indirect next-hop
Prefix/Length Type Next Hop Dst/Met Intf
--------------- ------- --------------- --------- -------------------
21.21.21.2/32 Static 0.0.0.0 1/0 loopback0[V:pe2]
2.2.2.2/32 O-I 30.30.30.2 110/3 ATM2/0.30
31.31.31.2 110/3 ATM2/0.31
10.10.10.0/24 Connect 10.10.10.1 0/0 ATM2/0.10
20.20.20.0/24 Connect 20.20.20.1 0/0 ATM2/0.21
4.4.4.4/32 Bgp 2.2.2.2* 200/2
3.3.3.3* 200/2
5.5.5.5/32 Bgp 4.4.4.4* 20/2
To display detailed information about a specific route:
host1#show ip route 4.4.4.4 detail
Protocol/Route type codes:
I1- ISIS level 1, I2- ISIS level2,
I- route type intra, IA- route type inter, E- route type external,
i- metric type internal, e- metric type external,
O- OSPF, E1- external type 1, E2- external type2,
N1- NSSA external type1, N2- NSSA external type2
L- MPLS label, V- VRF
4.4.4.4/32 Type: Bgp Distance: 200 Metric: 0 Tag: 0
Indirect NHop: virtual-router: pe1
Address 1.1.1.1 Type Bgp Index 1
NHop: 10.10.10.2 IfIndx: 28 Intf: ATM2/0.10
NHop: 20.20.20.2 IfIndx: 28 Intf: ATM2/0.20
Indirect NHop: virtual-router: pe1
Address 2.2.2.2 Type Bgp Index 2
NHop: 10.10.10.2 IfIndx: 28 Intf: ATM2/0.10
NHop: 20.20.20.2 IfIndx: 28 Intf: ATM2/0.20
Table 1 lists the show ip route command output fields.
Table 1: show ip route Output Fields
Field Name | Field Description |
|---|---|
Protocol/Route type codes | Protocol and route type codes for the table that follows |
Prefix | IP address prefix of network destination |
Length | Network mask length for prefix |
Next Hop | IP address of the next hop to the route, whether it is a local interface or another router |
Dist | Administrative distance for the route |
Met | Number of hops |
Intf | Interface type and interface specifier |