Lessons · Network switches · the phone and the PC on one port
One cable, two VLANs
The phone tags its own traffic with the voice VLAN and passes the PC's through untagged. One port, one cable, two devices.
Hone is a place to practise programming. This is one of its lessons, written out in full and free to read without an account.
What it is for
Two devices means two lines in the configuration, and a partial restore that lands one and refuses the other leaves phones working and PCs dead.
How to think about it
Access VLAN for the PC, voice VLAN for the phone, portfast so the PC boots. Then read the port back and count the lines.
Worked example
enableIn.
configure terminalConfiguring.
vlan 10The data VLAN.
name WORKSTATIONSNamed.
exitOut.
vlan 20The voice VLAN.
name HANDSETSNamed.
exitOut.
interface gi0/6The desk.
switchport mode accessAccess, not trunk. The phone does the tagging.
switchport access vlan 10The PC behind the phone.
switchport voice vlan 20The phone itself.
spanning-tree portfastThe warning is real and this is the port it does not apply to.
endDone.
show running-config | section GigabitEthernet0/6Four lines. If a restore leaves three, you have a working phone and an unhappy person.
Your turn
Give the phone on this port VLAN 20.
switchport voice 20
Console into a switch
The trap
Making the port a trunk because two VLANs cross it. A trunk carries every VLAN to a switch; this is one port carrying two, to a phone.
Practise the phone and the PC on one port on HoneA question on it now, a coding challenge where there is one, and it is remembered for review. Free, no email needed.