How to Configure VLANs on Multiple Switches
This beginner-friendly guide walks through configuring VLANs across multiple switches, covering VLAN creation, trunk configuration, and port assignments with clear step-by-step instructions and verification commands.
Setting up VLANs across multiple switches is a fundamental skill for network engineers. While it might seem complex at first, the process follows a logical sequence that becomes second nature with practice. Let's walk through configuring VLANs on multiple switches step by step.
Understanding the Basics
Before diving into configuration, remember that VLANs create logical network segments within your physical network. When you configure VLANs on multiple switches, you're extending these logical networks across your entire infrastructure. Each VLAN needs to be created on every switch where devices in that VLAN will connect.
Planning Your VLAN Setup
Start with a simple plan. For this beginner VLAN guide, we'll configure three VLANs across two switches:
- VLAN 10: Sales Department
- VLAN 20: Engineering Department
- VLAN 30: Guest Network
Both switches will need trunk links between them to carry traffic for all VLANs.
Step 1: Create VLANs on Each Switch
Connect to your first switch via console and enter global configuration mode:
Switch> enable
Switch# configure terminal
Switch(config)# vlan 10
Switch(config-vlan)# name Sales
Switch(config-vlan)# exit
Switch(config)# vlan 20
Switch(config-vlan)# name Engineering
Switch(config-vlan)# exit
Switch(config)# vlan 30
Switch(config-vlan)# name Guest
Switch(config-vlan)# exitRepeat this exact process on your second switch. Each switch must have the same VLAN numbers and names for consistency.
Step 2: Configure Trunk Links
Trunk links carry traffic for multiple VLANs between switches. Configure the interface connecting your switches. Note that interface names may vary depending on your switch model (e.g., GigabitEthernet, FastEthernet, or simply Ethernet):
Switch(config)# interface fastethernet 0/24
Switch(config-if)# switchport mode trunk
Switch(config-if)# switchport trunk allowed vlan 10,20,30
Switch(config-if)# exitConfigure the same trunk settings on the corresponding interface of your second switch. This creates a pathway for all VLAN traffic to flow between switches.
Step 3: Assign Access Ports
Now assign specific ports to VLANs on each switch. For example, to put port FastEthernet 0/1 into VLAN 10:
Switch(config)# interface fastethernet 0/1
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 10
Switch(config-if)# exitRepeat this process for other ports, assigning them to appropriate VLANs based on which devices will connect.
Step 4: Save Your Configuration
This is a critical step that's often overlooked. Save your running configuration to startup configuration to ensure your changes persist after a reboot:
Switch# copy running-config startup-configOr alternatively, you can use:
Switch# write memoryRepeat this on all switches to ensure your configuration is permanently saved.
Step 5: Verify Your Configuration
Always verify your VLAN setup works correctly. Use these commands to check your switch configuration:
Switch# show vlan briefThis displays all VLANs and their assigned ports. You should see your VLANs listed with their names and associated interfaces.
Check your trunk configuration:
Switch# show interfaces trunkThis shows which interfaces are trunking and which VLANs are allowed across each trunk.
Testing Connectivity
Connect devices to ports in the same VLAN on different switches and test connectivity. Devices in VLAN 10 on Switch 1 should communicate with devices in VLAN 10 on Switch 2, but not with devices in other VLANs.
Common Troubleshooting Tips
If devices can't communicate across switches:
- Verify VLAN numbers match on both switches
- Check that trunk links are configured on both ends
- Ensure the required VLANs are allowed on trunk interfaces
- Confirm access ports are assigned to the correct VLANs
- Verify that configuration has been saved on both switches
What's Next
Now that you understand basic VLAN configuration across multiple switches, you're ready to explore more advanced topics like VLAN Trunking Protocol (VTP) for managing VLANs centrally, and inter-VLAN routing to enable communication between different VLANs.
Tools and resources for this topic
- CCNA Official Cert Guide (Wendell Odom) — The definitive CCNA study resource. Both volumes cover the 200-301 exam blueprint in full.
- Wendell Odom CCNA Vol 1 — Covers networking fundamentals, switching, and routing basics.
- Wendell Odom CCNA Vol 2 — Covers advanced routing, WAN, infrastructure services, and security.