One socket, two devices
Offices run a single cable to each desk. A Cisco-style IP phone has a small built-in switch with a second port, so the PC plugs into the phone and the phone plugs into the wall. That gives a design problem: the phone and PC should sit in different networks. Voice traffic needs predictable delay and its own address range, and the PC should not be able to reach phone systems directly.
How the phone and the switch agree
- The switch port is an access port in the data VLAN (here 10) with a voice VLAN (40) added.
- The phone starts up and the switch tells it the voice VLAN ID with CDP (Cisco phones) or LLDP-MED (standards-based phones).
- The phone tags its own frames with VLAN 40 using 802.1Q and gets its address from the voice VLAN's DHCP scope.
- The PC's frames pass through the phone untouched and untagged. The switch puts untagged frames into the access VLAN, 10.
So the same cable carries one tagged and one untagged VLAN, like a trunk with a native VLAN of 10, but the switch still treats the port as an access port with a voice extension. See tagged and untagged frames for how the tag works.
Why a separate voice VLAN is worth it
- Quality of service: the switch can trust the phone's markings and queue voice ahead of PC downloads.
- Security: access lists can keep PCs away from the phone system, and the other way round.
- Addressing: voice gets its own subnet and DHCP scope, including options such as the call server address.
- Troubleshooting: a broadcast problem on the data VLAN does not hit calls.
How to configure a voice VLAN
Commands are based on Cisco IOS documentation and have not been run on a lab device here.
vlan 10
name DATA
vlan 40
name VOICE
!
interface GigabitEthernet1/0/5
description IP phone + PC
switchport mode access
switchport access vlan 10
switchport voice vlan 40
spanning-tree portfastCreate both VLANs first. The port is an access port in VLAN 10 and also carries VLAN 40 for the phone. PortFast lets the port come up straight away.
The voice VLAN must also be allowed on every trunk between this switch and the call server, and have a gateway and DHCP scope. The switchport voice vlan command has alternatives: dot1p (the phone tags with VLAN 0 and priority only) and untagged (the phone sends untagged frames), for phones that cannot tag a VLAN ID.
Verifying it
SW1#show interfaces GigabitEthernet1/0/5 switchport Name: Gi1/0/5 Switchport: Enabled Administrative Mode: static access Operational Mode: static access Negotiation of Trunking: Off Access Mode VLAN: 10 (DATA) Trunking Native Mode VLAN: 1 (default) Voice VLAN: 40 (VOICE)
show cdp neighbors should list the phone on that port, and show mac address-table interface gi1/0/5 should show one MAC address in VLAN 40 (the phone) and one in VLAN 10 (the PC).
Voice VLAN faults
On small screens, swipe sideways or focus the diagram and use the arrow keys.
Voice VLAN in short
- An access port plus
switchport voice vlancarries two VLANs: data untagged, voice tagged. - The switch advertises the voice VLAN ID to the phone with CDP or LLDP-MED.
- Create the VLAN, allow it on the trunks, and give it a DHCP scope and a gateway.
- Verify with
show interfaces switchportandshow cdp neighbors.
Test yourself
A PC is plugged into an IP phone and the phone into Gi1/0/5 with access VLAN 10 and voice VLAN 40. Which VLAN carries the PC's frames?
Which protocols tell a phone its voice VLAN?
A phone gets no IP address. The voice VLAN is configured on the port. What should you check first?
Is a voice VLAN port a trunk?
Which benefit is a main reason to put phones in their own VLAN?