CLI Reference Guide-R04

Table Of Contents
Chapter 30
| IP Routing Commands
Global Routing Configuration
– 948 –
IPv4 Commands
ip route This command configures static routes. Use the no form to remove static routes.
Syntax
ip route destination-ip netmask next-hop [distance]
no ip route {destination-ip netmask [next-hop] | *}
destination-ip – IP address of the destination network, subnetwork, or host.
netmask - Network mask for the associated IP subnet. This mask identifies
the host address bits used for routing to specific subnets.
next-hop – IP address of the next hop router used for this route.
distance – An administrative distance for the route. (Range: 1-255,
Default: 1)
* – Removes all static routing table entries.
Default Setting
No static routes are configured.
Command Mode
Global Configuration
Command Usage
Up to 24 static routes can be configured.
If more than one route is configured for the same destination, the route with
the smallest distance is used.
For information on how to define multiple default gateways or remove a
default gateway for a VLAN interface refer to the Command Usage section and
the examples for the ip address command.
Example
This example forwards all traffic for subnet 192.168.1.0 to the gateway router
192.168.5.254, using the default metric of 1.
Console(config)#ip route 192.168.1.0 255.255.255.0 192.168.5.254
Console(config)#