To define a default gateway when IP routing is disabled, issue the ip default-gateway global configuration command. Then, enter the IP address of the next-hop router interface that is directly connected to the switch where a default gateway is being configured.
The default gateway receives IP packets with unresolved destination IP addresses from the switch. Once the default gateway is configured, the switch has connectivity to the remote networks with which a host needs to communicate.
Note: When the switch is configured to route with IP, it does not need to have a default gateway set.
For more information, refer to Assigning the Switch IP Address and Default Gateway.