Network Bytes · Episode 91 · CCNA 2.1
"Voice VLANs: a phone and a PC on one port"
A voice VLAN lets an IP phone and the PC plugged into it share one switch port while staying in separate VLANs. The phone tags its voice frames for the voice VLAN, the PC's frames stay untagged in the data VLAN, and the switch tells the phone its voice VLAN with CDP or LLDP.
One cable, two devices
On most office desks there is only one network jack, but two devices want it: an IP phone and a PC. A Cisco IP phone solves this with a small built-in switch. One port goes to the wall (the switch), and the other port is for the PC. So the PC plugs into the phone, and only the phone plugs into the switch.
One front door, two flats
Picture one front door shared by two flats. Visitors for the upstairs flat wear a badge; everyone else goes downstairs. The switch port works the same way:
- The port gets two VLANs: a data VLAN (also called the access VLAN) for the PC, and a voice VLAN for the phone.
- The phone puts an 802.1Q tag on its voice frames, naming the voice VLAN. That tag is the badge.
- The PC's frames go through the phone with no tag, so the switch places them in the data VLAN.
For example, with data VLAN 10 and voice VLAN 50, the phone's frames carry a "50" tag and the PC's untagged frames end up in VLAN 10.
How the phone learns its voice VLAN
The phone has to know which VLAN number to put in its tag. The switch tells it: Cisco phones learn the voice VLAN from CDP, and many other phones use LLDP-MED. If neither is available, the voice VLAN has to be set on the phone by hand.
The configuration
`` interface GigabitEthernet0/5 switchport mode access switchport access vlan 10 switchport voice vlan 50 ``
Cisco still treats this as an access port, even though it accepts tagged voice frames. show interfaces gi0/5 switchport shows both the access (data) VLAN and the voice VLAN.
Try it yourself
In Packet Tracer, connect a Cisco IP phone to a switch and a PC to the phone. Create VLAN 20 and VLAN 70, then put switchport access vlan 20 and switchport voice vlan 70 on the switch port. Run show interfaces <port> switchport and find the "Access Mode VLAN" and "Voice VLAN" lines. Then give the PC an address in VLAN 20's subnet and check that it can reach another host in VLAN 20.
Good to know
- CCNA 2.1 covers access ports for data and voice (EP30 covers VLANs, EP31 trunks and 802.1Q tags, EP35 CDP and LLDP, EP54 QoS).
- The voice tag is a normal 802.1Q tag; it also carries a CoS priority value for the voice frames.
- Keeping voice in its own VLAN makes it easier to prioritize with QoS (EP54). Trusting the phone's priority markings needs extra QoS configuration, which the short skips.
- VLAN 10 and VLAN 50 in the video are example numbers. "One front door shared by two flats" is the analogy.
For CCNA learners
CCNA exam topic 2.1 is configure and verify VLANs spanning multiple switches, and it names access ports (data and voice). Know the three commands (switchport mode access, switchport access vlan, switchport voice vlan), that voice frames are tagged and PC frames are untagged, and that CDP or LLDP tells the phone its voice VLAN.
Answer to the comment question
VLAN 30. The PC's frames pass through the phone with no 802.1Q tag, and the switch puts untagged frames on that port into the data (access) VLAN, which is 30. Only the phone's own voice frames carry the voice VLAN 80 tag.
Test your knowledge
Quick quiz: "Voice VLANs: a phone and a PC on one port"
4 multiple-choice questions. Pick one answer for each, then check how you did.
Sources
- Cisco, "Configure Voice VLAN": an access port with an attached Cisco IP phone can carry a voice VLAN as well as its data VLAN; the switch sends the voice VLAN to the phone with CDP
- NetworkLessons, "Voice VLAN": the phone tags its voice frames with the voice VLAN; Cisco phones learn the VLAN through CDP, others often through LLDP
- Cisco IE 3000 Switch Software Configuration Guide, "Understanding Voice VLAN": the IP phone's built-in switch ports, 802.1Q tagging with CoS priority for voice, and CDP to send the voice VLAN; without CDP the VLAN must be set on the phone
- Cisco, "CCNA 200-301 v1.1 exam topics": 2.1 configure and verify VLANs spanning multiple switches, including access ports (data and voice)
Video transcript
How can a phone and a PC share one switch port, but use separate VLANs?
Often the PC plugs into the phone, and only the phone plugs into the switch.
Picture one front door for two flats. Visitors for upstairs wear a badge. Everyone else goes downstairs.
The port gets two VLANs: data for the PC, voice for the phone. The phone tags its voice frames, like a badge. The PC's frames have no tag, so they land in the data VLAN.
The switch tells the phone its voice VLAN, using CDP or LLDP.
A port has data VLAN 30 and voice VLAN 80. The PC behind the phone sends a frame. Which VLAN is it in? Comment your answer below!
That's your byte.
More from Network Bytes
- EP89"IPv6 unique local addresses"
- EP90"IPv6 anycast addresses"
- EP92"QoS policing vs shaping"
- EP93"Layer 3 switches and SVIs"