Basic VLAN and interface configuration on a Cisco switch involves creating VLANs, assigning ports, and managing trunk/access modes. The fundamental commands and workflow are outlined below.
Create a VLAN
To create VLANs (e.g., VLAN 10 and VLAN 20):
Switch> enable
Switch# configure terminal
Switch(config)# vlan 10
Switch(config-vlan)# exit
Switch(config)# vlan 20
Switch(config-vlan)# exit
This creates VLANs 10 and 20 if they do not already exist.
Assign Name to VLAN (Optional)
To name a VLAN:
Switch(config)# vlan 10
Switch(config-vlan)# name Sales
Switch(config-vlan)# exit
Naming helps with identification, especially in large environments.
Assign Switch Ports to VLAN
To assign a port to VLAN 10:
Switch(config)# interface fastethernet 0/1
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 10
Switch(config-if)# exit
To assign another port to VLAN 20:
Switch(config)# interface fastethernet 0/2
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 20
Switch(config-if)# exit
Assigning ports assigns their traffic to the selected VLAN.
Assign Multiple Ports (Interface Range)
To assign several interfaces at once:
Switch(config)# interface range fastethernet 0/3 - 0/8
Switch(config-if-range)# switchport mode access
Switch(config-if-range)# switchport access vlan 10
Switch(config-if-range)# exit
This saves time on large switches.
Configure Trunk Ports
For inter-switch links (carry multiple VLANs):
Switch(config)# interface gigabitEthernet 0/1
Switch(config-if)# switchport mode trunk
Switch(config-if)# exit
Trunk ports are required for connecting switches together and passing multiple VLANs.
Common Show Commands
- Check VLANs:
Switch# show vlan
- Check interface status:
Switch# show interfaces status
- Check port VLAN assignment:
Switch# show running-config
These commands help verify configuration and troubleshoot issues.
This basic command set prepares a Cisco switch for segmented, secure communication in most enterprise or learning lab environments
Leave a comment