Core issue
In Catalyst OS (CatOS), a default gateway must be defined on the Supervisor Engine. This default gateway is usually the IP address of an active interface on the router. The router may be internal, such as the MultiLayer Switch Feature Card (MSFC) or Route Switch Module (RSM) on the Catalyst 6500 or 6000 series, and the Route Switch Feature Card (RSFC) or RSM on the Catalyst 5500 and 5000 series, or external. The default gateway allows frames (which then become encapsulated as packets) to be sent to the router for routing between VLANs or to other subnets.
Resolution
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).
You can define up to three default IP gateways. Use the primary keyword to make a 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.
To specify one or more default gateways, perform the following steps in privileged mode:
- Configure a default IP gateway address for the switch, by issuing the set ip route default gateway [metric] [primary] command.
- (Optional) Configure additional default gateways for the switch, by issuing the set ip route default gateway [metric] [primary] command.
- Verify that the default gateways appear correctly in the IP routing table, by issuing the show ip route command.
To remove default gateway entries, perform one of these tasks in privileged mode:
- Clear an individual default gateway entry by issuing the clear ip route default gateway command.
- Clear all default gateways and static routes, by issuing the clear ip route all command.
This example shows how to configure three default gateways on the switch and how to verify the default gateway configuration:
Console> (enable) set ip route default 10.1.1.10
Route added.
Console> (enable) set ip route default 10.1.1.20
Route added.
Console> (enable) set ip route default 10.1.1.1 primary
Route added.
Console> (enable)
Console> (enable) show ip route
Fragmentation Redirect Unreachable
------------- -------- -----------
enabled enabled enabled
The primary gateway: 10.1.1.1
Destination Gateway RouteMask Flags Use Interface
--------------- --------------- ---------- ----- -------- ---------
default 10.1.1.1 0x0 UG 6 sc0
default 10.1.1.20 0x0 G 0 sc0
default 10.1.1.10 0x0 G 0 sc0
10.0.0.0 10.1.1.100 0xff000000 U 75 sc0
default default 0xff000000 UH 0 sl0
Console> (enable)
For information on configuring default gateway on Catalyst Layer 3 switches running Cisco IOS System software, refer the document How To Configure InterVLAN Routing on Layer 3 Switches.