// Lesson 18 of 49 · Switching and VLANs
VLANs and access ports
A VLAN splits one physical switch into several logical switches. Devices in different VLANs cannot talk to each other without a router, even when they are plugged into the same switch.
Why use VLANs
- Smaller broadcast domains — less unnecessary traffic.
- Security and policy — separate staff, guests, servers, cameras; filter between them at the router or firewall.
- Flexibility — group users by role, not by where their desk is.
VLAN numbers
| Range | Notes |
|---|---|
| 1 | Default VLAN; every port starts here. Do not use it for users. |
| 2–1001 | Normal range |
| 1002–1005 | Reserved for legacy Token Ring / FDDI |
| 1006–4094 | Extended range |
Create VLANs and assign access ports
SW1(config)# vlan 10
SW1(config-vlan)# name STAFF
SW1(config-vlan)# vlan 20
SW1(config-vlan)# name GUEST
SW1(config-vlan)# exit
SW1(config)# interface range GigabitEthernet1/0/1 - 12
SW1(config-if-range)# switchport mode access
SW1(config-if-range)# switchport access vlan 10
SW1(config)# interface range GigabitEthernet1/0/13 - 20
SW1(config-if-range)# switchport mode access
SW1(config-if-range)# switchport access vlan 20
If you assign a port to a VLAN that does not exist yet, newer IOS versions create it automatically — but name your VLANs explicitly.
Voice VLAN
An IP phone and a PC often share one wall port: the PC plugs into the phone. The port carries the PC's traffic untagged in the access (data) VLAN and the phone's traffic tagged in a separate voice VLAN:
SW1(config)# interface GigabitEthernet1/0/5
SW1(config-if)# switchport mode access
SW1(config-if)# switchport access vlan 10
SW1(config-if)# switchport voice vlan 110
The phone learns the voice VLAN through CDP or LLDP.
Verify
SW1# show vlan brief
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Gi1/0/21, Gi1/0/22, Gi1/0/23
10 STAFF active Gi1/0/1, Gi1/0/2, ... Gi1/0/12
20 GUEST active Gi1/0/13, ... Gi1/0/20
SW1# show interfaces GigabitEthernet1/0/5 switchport
Note: trunk ports do not appear in show vlan brief — use show interfaces trunk.
Common mistakes
- Port in the wrong VLAN → the host gets an address from the wrong DHCP scope or none.
- VLAN exists on one switch but not on the next → traffic does not cross the trunk.
- VLAN shut down (
shutdownunder the VLAN) or suspended.
Key points
- VLAN = separate broadcast domain; inter-VLAN traffic needs routing.
switchport mode access+switchport access vlan N.- Voice VLAN: data untagged, phone traffic tagged.
show vlan brieffor access ports,show interfaces trunkfor trunks.
Sign in to save your lesson progress across devices. You can read every published lesson without an account.