Configuring Voice Vlan
Configuring Voice Vlan
Configuring Voice Vlan
14
Note
For complete syntax and usage information for the commands used in this chapter, see the command
reference for this release.
This chapter consists of these sections:
14-1
Chapter 14
Phone
ASIC
P2
3-port
switch
P3
Access
port
101351
P1
PC
Note
In all configurations, the voice traffic carries a Layer 3 IP precedence value (the default is 5 for voice
traffic and 3 for voice control traffic).
In trusted mode, all traffic received through the access port on the Cisco IP Phone passes through
the phone unchanged.
In untrusted mode, all traffic in IEEE 802.1Q or IEEE 802.1p frames received through the access
port on the Cisco IP Phone receive a configured Layer 2 CoS value. The default Layer 2 CoS value
is 0. Untrusted mode is the default.
14-2
OL-8603-04
Chapter 14
Note
Untagged traffic from the device attached to the Cisco IP Phone passes through the phone unchanged,
regardless of the trust state of the access port on the phone.
You should configure voice VLAN on switch access ports; voice VLAN is not supported on
trunk ports.
Note
Voice VLAN is only supported on access ports and not on trunk ports, even though the
configuration is allowed.
The voice VLAN should be present and active on the switch for the IP phone to correctly
communicate on the voice VLAN. Use the show vlan privileged EXEC command to see if the
VLAN is present (listed in the display). If the VLAN is not listed, see Chapter 12, Configuring
VLANs, for information on how to create the voice VLAN.
Before you enable voice VLAN, we recommend that you enable QoS on the switch by entering the
mls qos global configuration command and configure the port trust state to trust by entering the mls
qos trust cos interface configuration command. If you use the auto-QoS feature, these settings are
automatically configured. For more information, see Chapter 28, Configuring QoS.
You must enable CDP on the switch port connected to the Cisco IP Phone to send the configuration
to the phone. (CDP is globally enabled by default on all switch interfaces.)
The Port Fast feature is automatically enabled when voice VLAN is configured. When you disable
voice VLAN, the Port Fast feature is not automatically disabled.
If the Cisco IP Phone and a device attached to the phone are in the same VLAN, they must be in the
same IP subnet. These conditions indicate that they are in the same VLAN:
They both use IEEE 802.1p or untagged frames.
14-3
Chapter 14
The Cisco IP Phone uses IEEE 802.1p frames, and the device uses untagged frames.
The Cisco IP Phone uses untagged frames, and the device uses IEEE 802.1p frames.
The Cisco IP Phone uses IEEE 802.1Q frames, and the voice VLAN is the same as the access
VLAN.
The Cisco IP Phone and a device attached to the phone cannot communicate if they are in the same
VLAN and subnet but use different frame types because traffic in the same subnet is not routed
(routing would eliminate the frame type difference).
You cannot configure static secure MAC addresses in the voice VLAN.
Note
If you enable IEEE 802.1x on an access port on which a voice VLAN is configured and
to which a Cisco IP Phone is connected, the phone loses connectivity to the switch for
up to 30 seconds.
Protected port. See the Configuring Protected Ports section on page 19-5 for more
information.
A source or destination port for a SPAN or RSPAN session.
Secure port. See the Configuring Port Security section on page 19-8 for more information.
Note
When you enable port security on an interface that is also configured with a voice
VLAN, you must set the maximum allowed secure addresses on the port to two plus the
maximum number of secure addresses allowed on the access VLAN. When the port is
connected to a Cisco IP Phone, the phone requires up to two MAC addresses. The phone
address is learned on the voice VLAN and might also be learned on the access VLAN.
Connecting a PC to the phone requires additional MAC addresses.
14-4
OL-8603-04
Chapter 14
voice traffic a higher priority and forward all voice traffic through the native (access) VLAN. The Cisco
IP Phone can also send untagged voice traffic or use its own configuration to send voice traffic in the
access VLAN. In all configurations, the voice traffic carries a Layer 3 IP precedence value (the default
is 5).
Beginning in privileged EXEC mode, follow these steps to configure voice traffic on a port:
Command
Purpose
Step 1
configure terminal
Step 2
interface interface-id
Step 3
Step 4
Before configuring the port trust state, you must first globally enable
QoS by using the mls qos global configuration command.
Step 5
end
Step 6
Step 7
This example shows how to configure a port connected to a Cisco IP Phone to use the CoS value to
classify incoming traffic, to use IEEE 802.1p priority tagging for voice traffic, and to use the default
native VLAN (VLAN 0) to carry all traffic:
Switch# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)# interface gigabitethernet0/1
Switch(config-if)# mls qos trust cos
Switch(config-if)# switchport voice vlan dot1p
Switch(config-if)# end
To return the port to its default setting, use the no switchport voice vlan interface configuration
command.
14-5
Chapter 14
Purpose
Step 1
configure terminal
Step 2
interface interface-id
Specify the interface connected to the Cisco IP Phone, and enter interface
configuration mode.
Step 3
Set the priority of data traffic received from the Cisco IP Phone access port:
cos valueConfigure the phone to override the priority received from the
PC or the attached device with the specified CoS value. The value is a
number from 0 to 7, with 7 as the highest priority. The default priority is
cos 0.
trustConfigure the phone access port to trust the priority received from
the PC or the attached device.
Step 4
end
Step 5
Step 6
copy running-config
startup-config
This example shows how to configure a port connected to a Cisco IP Phone to not change the priority of
frames received from the PC or the attached device:
Switch# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)# interface gigabitethernet0/1
Switch(config-if)# switchport priority extend trust
Switch(config-if)# end
To return the port to its default setting, use the no switchport priority extend interface configuration
command.
14-6
OL-8603-04