CLI Reference Guide

IP Routing Commands 1071
prefix-length
—Length of prefix, in bits. Must be preceded with a forward
slash (/). (Range: 0-32 bits.)
longer-prefixes
—Indicates that the
ip-address
and
subnet-mask
pair
becomes the prefix, and the command displays the routes to the addresses
that match that prefix.
Default Configuration
This command has no default configuration.
Command Mode
User EXEC, Privileged EXEC modes, Configuration mode and all
Configuration submodes
User Guidelines
If the subnet mask is specified, then only routes with an exact match are
displayed. For example:
show ip route 192.168.2.0 /24
If only an IP address is specified, the best route for the IP address is
displayed. For example:
show ip route 192.168.2.0
•If the
longer-prefixes option is specified, then the subnets within an
aggregate are displayed. For example:
show ip route 192.168.2.0 /23 longer-prefixes
Example
The following example displays the IPv4 address of the default gateway and
the default route associated with the gateway.
console#show ip route
Route Codes: R - RIP Derived, O - OSPF Derived,
C - Connected, S - Static
B - BGP Derived, IA - OSPF Inter Area
E1 - OSPF External Type 1, E2 - OSPF External Type 2
N1 - OSPF NSSA External Type 1, N2 - OSPF NSSA External Type 2
*Indicates the best (lowest metric) route for the subnet
Default gateway 10.1.20.1 is configured
2CSNXXX_SWUM200.book Page 1071 Tuesday, December 10, 2013 1:22 PM