#
Introduction
Setting up VLANs (Virtual Local Area Networks) on Cisco devices is a critical skill for network administrators. This guide walks you through the VLAN configuration process for Cisco Layer 2 switches, Layer 3 switches, and routers (using the Router-on-a-Stick method). Each step is explained, from entering various modes to checking the configurations, ensuring a comprehensive understanding of the process.
#
Cisco Layer 2 Switch VLAN Configuration
Enter Privileged EXEC Mode:
Global Configuration Mode:
Create VLAN:
1
| name [VLAN_NAME] # Optional
|
Assign Ports to VLAN:
1
| interface [INTERFACE_TYPE][PORT_NUMBER]
|
1
| switchport access vlan [VLAN_ID]
|
Save Configuration:
Check VLAN Configuration:
#
Cisco Layer 3 Switch VLAN and Inter-VLAN Routing
Create VLANs and Assign SVIs:
1
| interface vlan [VLAN_ID]
|
1
| ip address [IP_ADDRESS] [SUBNET_MASK]
|
Enable IP Routing:
Configure Trunk Ports:
1
| interface [INTERFACE_TYPE][PORT_NUMBER]
|
1
| switchport trunk allowed vlan [VLAN_LIST]
|
Save Configuration:
Check Configuration:
1
| show ip interface brief
|
#
Cisco Router VLAN Configuration (Router-on-a-Stick)
Create Sub-Interfaces for VLANs:
1
| interface [INTERFACE_TYPE][PHYSICAL_INTERFACE].[VLAN_ID]
|
1
| encapsulation dot1Q [VLAN_ID]
|
1
| ip address [IP_ADDRESS] [SUBNET_MASK]
|
Repeat for each VLAN.
Save Configuration:
Check Router Configuration:
1
| show ip interface brief
|
#
Conclusion
Configuring VLANs on Cisco devices enhances network segmentation, security, and management. Whether you’re working with Layer 2 or Layer 3 switches or implementing a Router-on-a-Stick setup, this guide provides clear instructions to ensure a successful VLAN configuration. Remember, always verify your settings and ensure that your Cisco device supports these configurations.