VLANInterface Config

switchport voice vlan [vlan-id]

Configures a switch port to carry voice traffic from an IP phone on a specific VLAN, separating voice and data traffic on the same physical port.

Syntax·Interface Config
switchport voice vlan [vlan-id]

When to Use This Command

  • Deploying Cisco IP phones in an office environment where PCs are daisy-chained through the phone's pass-through port.
  • Segmenting voice traffic into a dedicated VLAN for QoS and security purposes.
  • Enabling a switch port to automatically use CDP to assign a voice VLAN to a connected IP phone.
  • Integrating with a VoIP system that requires a specific VLAN for voice traffic.

Command Examples

Basic voice VLAN assignment

switchport voice vlan 10

This command configures the interface to use VLAN 10 for voice traffic. No output is shown if successful; the command is applied immediately.

Verifying voice VLAN configuration

show interfaces gigabitethernet 0/1 switchport
Name: Gi0/1
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: trunk
Administrative Trunking Encapsulation: dot1q
Operational Trunking Encapsulation: dot1q
Negotiation of Trunking: On
Access Mode VLAN: 1 (default)
Trunking Native Mode VLAN: 1 (default)
Administrative Native VLAN tagging: enabled
Voice VLAN: 10
Administrative Private VLAN Host Association: none
Administrative Private VLAN Mapping: none
Operational Private VLAN: none
Trunking VLANs Enabled: ALL
Pruning VLANs Enabled: 2-1001
Capture Mode Disabled
Capture VLANs Allowed: ALL

Protected: false
Unknown unicast blocked: disabled
Unknown multicast blocked: disabled
Appliance trust: none

The 'Voice VLAN: 10' line confirms that voice traffic on this port will be tagged with VLAN 10. Other fields show the port is in trunk mode, with native VLAN 1. The 'Access Mode VLAN' is the data VLAN. This output is useful to verify that the voice VLAN is set correctly.

Understanding the Output

The 'show interfaces switchport' command displays the voice VLAN configuration under the 'Voice VLAN' field. A value of '10' indicates that voice traffic is tagged with VLAN 10. If the field shows 'none' or is missing, the voice VLAN is not configured. The 'Access Mode VLAN' shows the data VLAN for untagged traffic. In a typical setup, the IP phone uses CDP to learn the voice VLAN and tags its traffic accordingly, while the PC traffic remains untagged on the access VLAN. Ensure the voice VLAN exists in the VLAN database and is allowed on trunk links if the port is a trunk. A common issue is forgetting to create the VLAN first, which results in the port being error-disabled or the configuration being rejected.

CCNA Exam Tips

1.

CCNA exam tip: The voice VLAN command is only available on switch ports configured as access or trunk; it is not valid on routed ports.

2.

CCNA exam tip: The IP phone uses CDP to discover the voice VLAN; if CDP is disabled, the phone may not tag traffic correctly.

3.

CCNA exam tip: The voice VLAN can be configured as a VLAN ID or as 'dot1p' to use 802.1p priority tagging on the native VLAN.

4.

CCNA exam tip: On a trunk port, the voice VLAN is automatically added to the allowed VLAN list; you do not need to manually add it.

Common Mistakes

Mistake 1: Forgetting to create the voice VLAN before applying the command, causing the port to go into error-disabled state.

Mistake 2: Applying the command on a port that is already configured as a trunk without verifying that the voice VLAN is allowed on the trunk.

Mistake 3: Confusing the voice VLAN with the access VLAN; the access VLAN is for data, the voice VLAN is for voice traffic.

Related Commands

Practice for the CCNA 200-301

Test your knowledge with hundreds of CCNA practice questions covering all exam domains.

Practice CCNA Questions