3-6
Catalyst 6000 Family Software Configuration Guide—Releases 6.3 and 6.4
78-13315-02
Chapter 3 Configuring the Switch IP Address and Default Gateway
Configuring Default Gateways
This example shows how to assign an IP address, specify the number of subnet bits, and specify the
VLAN assignment for the in-band (sc0) interface:
Console> (enable)
set interface sc0 172.20.52.124/29
Interface sc0 IP address and netmask set.
Console> (enable)
set interface sc0 5
Interface sc0 vlan set.
Console> (enable)
This example shows how to specify the VLAN assignment, assign an IP address, specify the subnet mask
in dotted decimal format, and verify the configuration:
Console> (enable)
set interface sc0 5 172.20.52.124/255.255.255.248
Interface sc0 vlan set, IP address and netmask set.
Console> (enable)
show interface
sl0: flags=51<UP,POINTOPOINT,RUNNING>
slip 0.0.0.0 dest 0.0.0.0
sc0: flags=63<UP,BROADCAST,RUNNING>
vlan 5 inet 172.20.52.124 netmask 255.255.255.248 broadcast 172.20.52.17
Console> (enable)
Configuring Default Gateways
The supervisor engine sends IP packets destined for other IP subnets to the default gateway (typically,
a router interface in the same network or subnet as the switch IP address). The switch does not use the
IP routing table to forward traffic from connected devices; the switch forwards only IP traffic generated
by the switch itself (for example, Telnet, TFTP, and ping).
Note
In some cases, you might want to configure static IP routes in addition to default gateways. For
information on configuring static routes, see the
“Configuring Static Routes” section on page 20-7
.
You can define up to three default IP gateways. Use the
primary
keyword to make a gateway the
primary gateway. If you do not specify a primary default gateway, the first gateway configured is the
primary gateway. If more than one gateway is designated as primary, the last primary gateway
configured is the primary default gateway.
The switch sends all off-network IP traffic to the primary default gateway. If connectivity to the primary
gateway is lost, the switch attempts to use the backup gateways in the order they were configured. The
switch sends periodic ping messages to determine whether each default gateway is up or down. If
connectivity to the primary gateway is restored, the switch resumes sending traffic to the primary
gateway.
To configure one or more default gateways, perform this task in privileged mode:
Task
Command
Step 1
Configure a default IP gateway address for the
switch.
set ip route
default
gateway
[
metric
] [
primary
]
Step 2
(Optional) Configure additional default gateways
for the switch.
set ip route
default
gateway
[
metric
] [
primary
]
Step 3
Verify that the default gateways appear correctly
in the IP routing table.
show ip route