Core
VLANs
VLANs segment a switch into separate broadcast domains at Layer 2. Each VLAN requires its own IP subnet if hosts need to route between VLANs.
What you need to know
- VLAN IDs range from 1 to 4094; 1002-1005 are reserved for legacy Token Ring/FDDI.
- VLAN 1 is the default VLAN and cannot be deleted or renamed.
- VLANs are stored in vlan.dat in flash, not in the running-config, unless VTP transparent mode with certain IOS versions.
- A port not assigned to any VLAN explicitly belongs to VLAN 1 (access) by default.
- Deleting a VLAN that a port is assigned to puts that port into an inactive state until reassigned.
- VLAN names are locally significant and do not need to match between switches.
- Extended range VLANs (1006-4094) require VTP transparent mode or VTP version 3.
Configuration commands
| Command | Mode | Purpose |
|---|---|---|
| vlan 10 | config | Create VLAN 10 and enter VLAN configuration mode. |
| name SALES | config-vlan | Assign a descriptive name to the VLAN. |
| vlan 20,30,40 | config | Create multiple VLANs in one command. |
| no vlan 10 | config | Delete VLAN 10 from the VLAN database. |
| interface range fastethernet 0/1 - 5 | config | Select a range of interfaces for bulk configuration. |
| switchport access vlan 10 | config-if | Assign the interface to VLAN 10 as an access port. |
| show vlan brief | exec | List VLANs and their assigned ports. |
Verify it
- show vlan brief
- show vlan id 10
- show interfaces status
- show interfaces vlan 10
- show running-config interface fa0/1
Common mistakes
- Creating a VLAN but forgetting to assign it to any port.
- Assuming VLAN configuration lives in running-config instead of vlan.dat.
- Using inconsistent VLAN names across switches and assuming it affects VTP.
- Deleting a VLAN that is still assigned to active ports, leaving them inactive.
- Confusing VLAN ID with subnet number and assigning overlapping subnets.
Practise VLANs in a real CLI
Generated labs, graded against the simulated network state.