Hello Christos
When you configure a port to be used with an IP phone and a workstation together, you configure it like so:
SW1(config)#interface GigabitEthernet 0/1
SW1(config-if)#switchport mode access
SW1(config-if)#switchport access vlan 100
SW1(config-if)#switchport voice vlan 101
SW1(config-if)#exit
Where VLAN 100 is the data VLAN, and VLAN 101 is the voice VLAN.
What does this tell the switch? Well, first notice that the mode
is access
. This means that we can expect untagged frames on this port. But what VLAN will these untagged frames be placed on? Well, the switchport access vlan 100
command tells us that untagged frames will be placed on VLAN 100.
So far, the configuration we’ve talked about is the same as that of any access port on a switch, as shown in this lesson.
All the magic happens with the next and final command of switchport voice vlan 101.
This tells the switch that it can expect tagged frames with a VLAN tag of 101 on this port.
This behavior is similar to a trunk port that has been configured with a native VLAN. Take a look at this:
SW1(config)#interface GigabitEthernet 0/1
SW1(config-if)#switchport mode trunk
SW1(config-if)#switchport trunk allowed vlan 101
SW1(config-if)#switchport trunk native vlan 100
SW1(config-if)#exit
This configuration works exactly the same way as the voice VLAN configuration. Untagged frames are placed on the configured native VLAN of 100 while tagged frames with an ID of 101 are also accepted by the port.
So why do we use the voice VLAN configuration? Because it automatically configures additional parameters that are unique to IP phones, and in particular, to Cisco IP phones. It enables CDP communication between the switch and the phone that allows the devices to negotiate various parameters such as PoE and QoS. But fundamentally, the connectivity, VLANs, and tags work the same way for both configurations above.
I hope this has been helpful!
Laz