2-363
Catalyst 6500 Series Switch Command Reference—Release8.4
OL-6244-01
Chapter2 Catalyst 6500 Series Switch and ROM Monitor Commands set ip route
set ip route
To add IP addresses or aliases to the IP routing table, use the set ip route command.
set ip route {destination}[/netmask] {gateway} [metric] [primary]
Syntax Description
Defaults The default configuration routes the local network through the sc0 interface with m etric 0 as soon as sc0
is configured.
Command Types Switch command.
Command Modes Privileged.
Usage Guidelines You can configure up to three default gateways. The primary is the highest priority. If you do not
designate a primary gateway, priority is based on the order of input. If you enter two primary definitions,
the second definition becomes the primary and the first definition becomes the secondary default IP
gateway.
You can only specify the primary keyword for a default route.
When you enter the destination value or gateway value, enter it in dot notation, for example, a.b.c.d.
When you specify the netmask value, this indicates the number of bits allocated to subnetting in the
host ID section of the given Class A, B, or C address. For example, if you enter an IP address for the sc0
interface as 172.22.20.7, the host ID bits for this Class B address is 16. A ny number of bits in the host ID
bits can be allocated to the netmask field. If you do not enter the netmask value, the number of bits is
assumed to be the natural netmask.
When you enter the netmask, enter it as the number of bits or dot format, for example, destination/24
or destination/255.255.255.0. If you enter the netmask in dot forma t, you m ust h ave conti guo us 1s .
destination IP address, IP alias of the network, or specific host to be added. Use default as the
destination to set the new entry as the default route.
/netmask (Optional) Number of bits in netmask or dot format (for example, 172.20.22.7/24 or
172.20.22.7/255.255.255.0).
gateway IP address or IP alias of the router.
metric (Optional) Value used to indicate the number of hops between the switch and the
gateway.
primary (Optional) Used with the multiple IP gateways feature to specify the defa ult IP gate way
with the highest priority.