Unlike small network at home, in business-class or enterprise class network – Switch Configuration is needed for the management reason and fine tuning for better performance. When inter-VLAN communication between Switches is deployed, VLAN Configuration is also needed.
Just like configuring Cisco Router, Cisco Switch Configuration has similarity. You can use mostly the same commands as you can do in Cisco router. The major differences are due to the inherent differences between the routers and the switches. For Switches with VLAN enabled, VLAN Configuration is required to manage how the devices are segmented into the VLANs.
Switch Components
The Switch has actual switch ports as the majority connectors. You can connect one device to each of the port for full-duplex communication. If half duplex communication is needed, a segment should be connected to each port. Ports are identified by numbers beginning with 1. For Switch Configuration, the interface type Ethernet is used followed by the interface number (0), and also followed by the port number. For instance, when you identify the second switch port, it is written as Ethernet 0/2.
If connection between Switches is needed, you can use the Trunk ports to connect directly each other. Typically the Trunk ports are designed with faster speeds (typically 1 Gigabit) than normal other Switch ports (typically 100/1000 Mbps). Typically the Trunk ports are identified by Trunk A and Trunk B, and for Switch Configuration purposes – the trunk ports are identified similarly to regular switch ports such as FastEthernet 0/15 (or fao/15).
For Switch Configuration, you can connect the Switch to an Ethernet network or connect the Terminal console to the console port. There are three tools to help us configure the Switches.
- CLI – Command Line Interface
- Switch Menu
- And VSM (Visual Switch Manager) Web Interface
Switch Configuration using command line interface is similar to using the router command line interface. Both switch and router command line interfaces have the following common items:
- To get help about the command – use ?, for examples: sh? Will show all the commands starting with sh
- Both Switches and routers have user exec, privileged exec, global configuration, and interface configuration modes.
- Use unique shortened form of command keywords.
The Switch itself is identified by the IP address assigned to the Switch. Assigning the IP address to the Switch is for the remote management reason typically with Telnet utility to the switch. Remember that the Switch ports are not assigned the IP address. In addition to setting the IP address, you will also need to configure the default gateway address if you want to manage the switch from a different subnet.
VLAN Configuration
VLAN has been discussed before. VLAN allows you assign devices on different switch to different logical or virtual LANs. Although each Switch can be connected to multiple VLANs, each switch port can be assigned to only one VLAN at a time. VLAN Configuration to the Switch Ports can be assigned statically (manually) or dynamically.
Being familiar with Cisco Switches you need to understand Cisco’s VLAN Trunking Protocol (VTP) which is used to simplify Switch configuration in a multi-switched network.
VLAN Trunking Protocol (VTP) allows the switches to be configured in one of the following three modes:
- Server mode, the switch is used to modify the VLAN configuration. The configuration information is then broadcasted to other VTP devices
- Client mode, the switch receives changes from a VTP server and passes VTP information to other switches. However VLAN configurations are not allowed from Client mode switch.
- Transparent mode, the Switch does not receive VTP configuration information from other switches. It just passes the VTP information to other switches as it receives the information. VLAN configuration can be done from this switch but the changes only apply to the local switch.
Complete the following processes in performing the VLAN Configuration:
- Modify the VTP mode to server or Transparent
- Enable Trunking on inter-switch interfaces
- Define the VLANs
- Assign ports to the VLAN
A switch must be in either Server or Transparent mode to allow the VLAN Configuration. Typically Cisco switches are shipped with the following default VLAN configuration:
- VLAN ID method: frame tagging using ISL
- Predefined VLANs: 1, 1002, 1003, 1004, 1005
- Default VLANs cannot be deleted or renamed
- VTP mode: server
VLAN Configuration commands
The following table lists basic VLAN configuration commands and tasks
Task | Command |
Set the VTP mode | Switch (config)# vtp server Switch (config)# vtp transparent |
Enable trunking on the inter-switch interface | Switch (config-if)# trunk on |
Create VLAN | Switch (config)# vlan <VLAN-Number> |
Assign a port to VLAN | Switch (config-if)# vlan-membership static <VLAN-number> Switch (config-if)# vlan-membership dynamic |
Examples:
The following commands set the VTP mode to server mode, and then enable trunking on the first trunking port, and create VLAN, assign ports to the VLAN
Switch (config)# vtp serverSwitch (config)# int fa0/26Switch (config-if)# trunk onSwitch (config-if)#exitSwitch (config)# vlan 20Switch (config)# int eth0/4Switch (config-if)# vlan-mem static 20Switch (config-if)# exitSwitch (config)# int eth0/5Switch (config-if)#vlan-mem static 20Verifying the VLAN configuration is important to make sure how correct the configuration is.
Show vlan | List all or selected VLANs, the output will show the status of the VLAN and the ports assigned to the VLAN |
Show vtp | Display VTP status and configuration information for the switch |
Show trunk <trunk letter> | Shows the status of the trunk ports and the trunking encapsulation method |
Show vlan-membership | List all the switch ports and their VLAN membership |
Show spantree <number> | Show spanning tree configuration and status information for a selected VLAN |
Spanning Tree Configuration
Switches can be configured in multiple paths to provide fault-tolerance. With multiple paths the network is susceptible to the bridging loops. Spanning tree algorithm is used to prevent the bridging loops from forming.
All Cisco switches are spanning tree protocol enabled by default. Switch port configuration is automatic when the switch is connected to the network and powered on. The following commands used for STP configuration:
Switch (config)# spantree <vlan#> | Enable the spanning tree protocol for the switch |
Switch (config)#no spantree <vlan#> | Disable the spanning tree protocol for the switch |
Switch# show spantree | Viewing the spanning tree configuration information and statistic |
For example: Switch (config)#spantree 22 (enable spanning tree on VLAN 22)