How to Enable IP Address on Network Switches

Network Switches require IP addresses to enable remote management and configuration. If the IP address is not configured the IP address, the network administrator can’t easily connect to the device for remote management.

Remote management software and protocols, such as Telnet, TeraTerm, SSH, HTTP, or HTTPS, also require an IP address for connectivity.

A network switch does not have a dedicated interface to which the IP address can be assigned. Therefore, the IP address is assigned and configured on a virtual interface called a switched virtual interface called SVI.

We can also assign network switches a default gateway. The default gateway should be the IP address of the router interface. For example, the default gateway for switch0 is 192.168.0.1, and for swithc1, it is 192.168.1.1.

network switches

Generally, the first usable IP address or the last usable IP address is reserved as the default gateway address. In this diagram, the first IP address of both subnets is already used as a router interface address, so I am going to configure the last usable IP address of both subnets (192.168.0.254 and 192.168.1.254) as the default gateway on both switches.

Switch#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#interface Vlan1
Switch(config-if)#ip address 192.168.0.254 255.255.255.0
Switch(config-if)#no shutdown
Switch(config-if)#exit
Switch(config)#ip default-gateway 192.168.0.1
Switch(config)#

Do this for switch1 also and assign IP address 192.168.1.254.