Configure the Ip Address and Default Gateway of Your Switch
In this article I will show you how to configure an Ip address and a default gateway in your manageable switch.
But first things first,
Why is an Ip address and default gateway needed in the switch?
After all switches are OSI Layer 2 devices that care only about MAC addresses.
The modern switches are manageable and support extra features than normal old fashion switches. This features include the support of TCP/IP applications like ping, telnet, trace route etc. For example, if you want to telnet or ping a switch, the switch must have an Ip configured. Also, if you want to execute ping or telnet to a device in another subnet the switch must have a default gateway configured.
Now let’s see the configuration for a 2950 series cisco switch.
Ip address
To configure the ip address first you have to enter from global configuration mode to interface vlan 1.
Switch#
Switch#conf t
Switch(config)#int vlan 1
Switch(config-if)#ip address {your ip address} {mask}
Switch(config-if)#no shutdown
Default Gateway
Be careful!!! The configuration of default gateway takes place in the configuration mode and the command does not include the mask for the ip.
Switch#
Switch#conf t
Switch(config)#ip default-gateway {ip address}
Now you can access your switch remotely, you can ping it from another network with different subnet and start “playing” with the settings. Have fun
1a32604d39a5…
1a32604d39a519af31b4…
hello
Thanks for this fast information, usefull.
So, How would we check the status of the default gateway that was configured on the switch?
If i have more than one VLAN configured on the switch, what would be the default-gateway i configure on the switch ??? (each VLAN is in a different subnet …. )
this is very nice n easy articale to understandd n also to confugure