
In modern networking, VLAN (Virtual Local Area Network) configuration is essential for segmenting networks efficiently. Whether you're preparing for the CCNA exam or working as a network engineer, mastering Cisco VLAN configuration will give you a significant advantage.
This comprehensive guide covers static and dynamic VLANs, VTP (VLAN Trunking Protocol), and step-by-step configuration commands based on Cisco IOS.
What is a VLAN?
A VLAN allows you to divide a physical network into multiple logical networks. Each VLAN behaves like a separate broadcast domain, improving network security, efficiency, and manageability.
Types of VLANs
-
Static VLANs – VLAN assignment is done manually on switch ports.
-
Dynamic VLANs – VLAN membership is assigned based on the MAC address of the device using a VMPS (VLAN Management Policy Server).
VLAN Configuration Step-by-Step
Step 1: Access the Cisco Switch
Switch> enable Switch# configure terminal
Step 2: Create VLANs
Switch(config)# vlan 10 Switch(config-vlan)# name SALES Switch(config-vlan)# exit
Step 3: Assign VLANs to Interfaces
Switch(config)# interface FastEthernet0/1 Switch(config-if)# switchport mode access Switch(config-if)# switchport access vlan 10 Switch(config-if)# exit
Step 4: Configure Trunk Ports
Switch(config)# interface FastEthernet0/24 Switch(config-if)# switchport mode trunk Switch(config-if)# switchport trunk encapsulation dot1q Switch(config-if)# exit
Step 5: Verify VLAN Configuration
Switch# show vlan brief Switch# show interfaces trunk
Cisco Dynamic VLAN Configuration
Dynamic VLANs allow for port flexibility and automation using MAC addresses.
-
Configure a VMPS server to maintain VLAN-MAC mappings.
-
Use the
vmps
configuration on switches to allow dynamic assignments.
Note: Dynamic VLANs are less common today due to newer technologies like 802.1X and SDN.
Best Practices for VLAN Configuration
-
Use meaningful VLAN names (e.g., HR, FINANCE).
-
Avoid overlapping VLAN IDs.
-
Keep VLAN 1 for management; do not use it for user traffic.
-
Use VTP in transparent mode unless managing VLANs centrally.
-
Regularly backup your VLAN database (
vlan.dat
).
Common VLAN Configuration Commands
Command | Purpose |
---|---|
vlan [id] |
Creates a VLAN |
name [VLAN_NAME] |
Assigns name to VLAN |
switchport mode access |
Sets port as access |
switchport access vlan [id] |
Assigns VLAN to access port |
switchport mode trunk |
Sets port as trunk |
show vlan brief |
Displays VLAN info |