A switch must have a default gateway address configured to remotely manage the switch from another network. To configure an IPv4 default gateway on a switch, use the ip default-gateway ip-address global configuration command.
S1(config)#ip default-gateway 192.168.1.1