Data and Voice VLANS
An access port can belong to only one data VLAN at a time. However, a port can also be associated to a voice VLAN. For example, a port connected to an IP phone and an end device would be associated with two VLANs: one for voice and one for data.
LANs supporting voice traffic typically also have quality of service (QoS) enabled. Voice traffic must be labeled as trusted as soon as it enters the network. Use the mls qos trust cos interface configuration command to set the trusted state of an interface, and to indicate which fields of the packet are used to classify traffic.
Configuring the Voice VLAN
Create both Data and Voice VLANS
S1(config)# vlan [vlan-id] S1(config-vlan)# name [vlan-name] S1(config-vlan)# vlan [vlan-id] S1(config-vlan)# name [vlan-name]
Enter interface configuration for the port to be assigned to the Voice/Data VLAN
S1(config)# interface [interface-id]
Set the port to access mode
S1(config-if)# switchport mode access
Assign the port to the Data VLAN
S1(config-if)# switchport access vlan [vlan-id]
Configure Voice traffic to become “Trusted” as soon as it enters the network
S1(config-if)# mls qos trust cos
Assign the port to the Voice VLAN
S1(config-if)# switchport voice vlan [vlan-id]
Assigning an access port to both a Data and a Voice VLAN on a Switch Complete Configuration Example
S1> enable S1# Configure Terminal S1(config)# vlan 10 S1(config-vlan)# name STAFF S1(config-vlan)# vlan 150 S1(config-vlan)# name VOICE S1(config-vlan)# exit S1(config)# interface fa0/2 S1(config-if)# switchport mode access S1(config-if)# switchport access vlan 10 S1(config-if)# mls qos trust cos S1(config-if)# switchport voice vlan 150 S1(config-if)# exit S1#