Sub topic 11
Voice VLANs on Access Ports
This chapter assumes you can configure access ports and trunks, and that you know what the 802.1Q tag and the native VLAN are. It covers how one switch port carries an IP phone and a PC in two different VLANs.
The problem a voice VLAN solves
An IP phone usually sits on a user's desk, and the user's PC plugs into a small switch built into the phone. Only one cable runs from the wall to the access switch. Voice and data still need to be separate:
- Voice traffic needs its own subnet, so you can apply QoS (quality of service) markings and security policy to it.
- Data traffic should stay in the user VLAN.
A plain access port belongs to one VLAN, so it cannot do both. A trunk could, but a trunk exposes more than you want on a user-facing port. The voice VLAN feature is a compromise. The port stays an access port for the PC, and it also accepts tagged frames for one extra VLAN, the voice VLAN.
How it works
The phone has three ports: one to the switch, one to the PC, and an internal port for the phone itself.
- The phone tags its own traffic with the voice VLAN ID in an 802.1Q tag.
- The phone passes the PC's traffic through unchanged, so it stays untagged.
- The switch treats untagged frames as belonging to the access VLAN, and tagged frames as belonging to the voice VLAN.
The switch tells the phone which voice VLAN to use, normally with CDP or LLDP-MED. The phone reads the VLAN ID and starts tagging. Without that discovery step, the phone sends untagged frames and lands in the data VLAN.
Configuration
This example puts data in VLAN 10 and voice in VLAN 120.
vlan 10
name USERS
vlan 120
name VOICE
!
interface GigabitEthernet0/3
switchport mode access
switchport access vlan 10
switchport voice vlan 120
spanning-tree portfastThe port stays in switchport mode access. The switchport voice vlan 120 line is the only addition. Both VLANs must exist in the VLAN database, or the traffic has nowhere to go.
On many Cisco switches, the voice VLAN port appears as a trunk-like port in some output, but it is still operationally an access port with an auxiliary VLAN. Check it with:
show interfaces GigabitEthernet0/3 switchport
show vlan briefIn the switchport output, look for Access Mode VLAN: 10 and Voice VLAN: 120.
Common errors
| Symptom | Likely cause |
|---|---|
| Phone gets no IP address | The voice VLAN is missing from the switch, or the DHCP scope or relay for the voice subnet is not set up. |
| Phone works but sits in the data VLAN | The phone never learned the voice VLAN. Check that CDP or LLDP-MED is enabled on the port. |
| PC loses connectivity | The access VLAN is wrong or missing. The PC is untagged, so it follows the access VLAN. |
| Voice VLAN is not carried to other switches | The voice VLAN is not in the allowed list on the trunk uplink. |
Voice VLAN traffic must also cross trunks to reach the voice gateway or call server. Add it to the allowed VLAN list on every uplink in the path.
Exercise
Exercise
A port is configured with switchport access vlan 10 and switchport voice vlan 120. A phone and a PC are attached. Which frames are tagged on the link between the switch and the phone, and which are untagged?
Show answer
Frames from the phone are tagged with VLAN 120. Frames from the PC are untagged and belong to VLAN 10, the access VLAN.
Exercise
A phone on this port never leaves the data VLAN and receives an address from the VLAN 10 subnet. What should you check first?
Show answer
Check that the phone learns the voice VLAN through CDP or LLDP-MED, so confirm that the protocol is enabled on the port and that the phone supports it. Also confirm that VLAN 120 exists on the switch.