Managing Catalyst Switches

Catalyst switches can be managed in the same way as Cisco routers. After booting it, you move from user EXEC mode to privileged EXEC mode with the enable command, just like a router, on a CLI basis. Then, you use the configure terminal command to move to the global configuration mode and enter various configuration commands from there.

But of course, there are some things that differ from a router. Here, we will explain the following two points that differ from routers.

  • VLAN database
  • Configuring a management IP address

VLAN database

Catalyst switches maintain VLAN configuration information as a VLAN database that is separate from startup-config. the location and file name of the VLAN database varies from model to model. the Catalyst 2960 series and the Catalyst 3750. In the series, the VLAN database is a file called “vlan.dat” in flash memory.

Therefore, to fully initialize the Catalyst switch, you must erase startup-config, erase the VLAN database, and then reboot as follows.

Switch#erase startup-config
Erasing the nvram filesystem will remove all files! Continue? [confirm]
[OK]
Erase of nvram: complete
Switch#delete flash:vlan.dat
Delete filename [vlan.dat]?
Delete flash:vlan.dat? [confirm]

Don’t forget the VLAN database as well as running-config or startup-config when backing up or downloading configuration information to or from the TFTP server.

Configuring a management IP address

The Layer 2 switch does not require an IP address for normal frame forwarding operation. However, an administrative IP address may be configured to manage the Layer 2 switch itself. Configuring a management IP address allows you to manage the Layer 2 switch using the following TCP/IP management protocol.

  • Ping/Traceroute
  • Remote login via Telnet/SSH/HTTP
  • SNMP

The point here is to be very aware of where to set the administrative IP address. In a Layer 2 switch, you do not set the administrative IP address on a physical port. It’s easier to understand if you think of it as having a virtual host (PC) inside the switch for management. You create an interface to connect the switch management virtual host to a specific VLAN and set its IP address. The VLANs that connect the virtual hosts inside the switch are also called management VLANs.

When considering the configuration of a switch’s IP address, regardless of whether it is a Layer 2 or Layer 3 switch, it is important to be aware of the internal layer structure of the switch. the internal layer structure of a Layer 2 switch, such as the Catalyst 2960 series, can be modeled as shown in the following diagram

Fig. Internal layer structure of a Catalyst switch (Layer 2 switch)
Fig. Internal layer structure of a Catalyst switch (Layer 2 switch)

To create an SVI on a Layer 2 switch and connect it to a VLAN and configure an IP address for management, use the following command.

Configuring switch management IP address

(config)#interface vlan <VLAN-number>
(config-if)#ip address <address> <subnetmask>
(config-if)#no shutdown

<VLAN-number> : VLAN number
<address> <subnetmask> : ip address , subnetmask

Use the interface vlan < VLAN-number > command to create an interface that connects the virtual host to a VLAN with a specified VLAN number. the interface that connects the VLAN to the virtual host is called SVI (Switched Virtual Interface) Set the IP address to SVI. As you move into interface configuration mode, you specify the IP address and subnet mask with the ip address command as you would with a router. A model of the process is shown in the figure.

Figure Configuring a management IP address

Figure Configuring a management IP address

When configuring a switch’s administrative IP address, it is often explained as “setting the IP address to the VLAN” or something similar, but this statement is incorrect; be very aware that you are setting the IP address to the SVI connected to the VLAN, not the VLAN.

When configured in this way, the virtual host can communicate directly with the port connected to VLAN 1 to which it is connected. If you want to communicate to a host in a different VLAN, you must configure a default gateway, just like a normal host. To configure the default gateway, enter the following command in global configuration mode.

Configuring default gateway address

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

<ip-address> : ip address of default gateway

The default gateway should be the IP address of the router or Layer 3 switch on the same VLAN. In addition, multiple VLANs can be created on a Layer 2 switch. You can also connect a virtual host to multiple VLANs and configure multiple IP addresses.

Related articles