6.2 Route Switch Modules
6.2.5 Configure a default gateway on the switch
In order to forward a data packet, a sending device must first know what routers are connected to the local network and which Route Processor maintains the shortest path to the destination device. Because it is not the responsibility of the end-user device to create and maintain routing tables, a default gateway is used to forward all nonlocal packets.

To define a gateway on a Cisco IOS Software-based series switch, enter the following command in global configuration mode.

Switch(config)#ip default-gateway ip-address

Where ip-address  is the IP address of the default Route Processor.

A switch acts like any other IP end station and must have a default gateway configured in order for the switch to communicate with devices in other IP subnets. To do this, a default route must be added that points to the gateway router in the same subnet/VLAN as the sc0 interface on the switch. The sc0 interface is a virtual management interface on the Catalyst 4000 switch.

To configure a default route on a set command-based system, enter the following command in privileged mode:

Switch> (enable) set ip route destination gateway metric

Figure describes the variables. Figure illustrates an example of how to configure a default gateway on both a set command-based switch and a Cisco IOS command-based switch.