Update 4/16/2022:
In 4.2, the feature Automated Voice VLAN automates the manual configuration described in this article once a VLAN is designated as ‘voice vlan’. In adddition, when the phone is removed from the port, the entire configuration is reverted for security enhancement eg. voice vlan is removed from the port etc.
Refer to the 4.2 Release Note, and 4.2 CLI User Guide for the instruction to set the voice vlan via CLI/Web.
CLI:
EX2010P# !
EX2010P(config)# vlan 1000
EX2010P(config-vlan)# voice
Web:
To set the voice vlan via cnMaestro, edit the VLAN in the Switch Group’s Network tab and enable ‘voice vlan’.
(Note: You do not need to make any configuration as described below if the automated voice vlan is configured as described above).
This article provides sample configuration for connecting a cnMatrix switch to an IP phone.
Topology
Configuration
Configure the Switch Port to Carry Both Voice and Data Traffic
Voice traffic will be tagged on the Voice VLAN and data traffic will be untagged on Data VLAN.
cnMatrix(config)# interface gigabitethernet 0/2
cnMatrix(config-if)# switchport mode hybrid
cnMatrix(config-if)# exit
cnMatrix(config)# vlan 20
cnMatrix(config-vlan)# name voice-lan
cnMatrix(config-vlan)# port add gigabitethernet 0/2
cnMatrix(config-vlan)# exit
cnMatrix(config)# vlan 10
cnMatrix(config-vlan)# name data-vlan
cnMatrix(config-vlan)# port add gigabitethernet 0/2 untagged gigabitethernet 0/2
cnMatrix(config-vlan)# exit
cnMatrix(config)# interface gigabitethernet 0/2
cnMatrix(config-if)# switchport pvid 10
cnMatrix(config-if)# exit
Configure Uplink Port to the Network
This configuration is required only if the uplink port is of type ‘hybrid’. If the uplink port is of type ‘trunk’, skip this step.
cnMatrix(config)# vlan 10
cnMatrix(config-vlan)# port add gigabitethernet 0/1
cnMatrix(config-vlan)# exit
cnMatrix(config)# vlan 20
cnMatrix(config-vlan)# port add gigabitethernet 0/1
cnMatrix(config-vlan)# exit
Configure QoS
Set the switch port to trust the IP Phone’s 802.1p Priority in voice traffic to prioritize the voice traffic flow.
cnMatrix(config)# in gi 0/2
cnMatrix(config-if)# qos trust dot1p
cnMatrix(config-if)# exit
Configure Spanning-Tree PortFast
Enable PortFast on the switch port to indicate only the host is connected (no switch or router). PortFast allows the port to enter the spanning tree forwarding state rapidly.
cnMatrix(config)# in gi 0/2
cnMatrix(config-if)# spanning-tree portfast
cnMatrix(config-if)# exit
Configure LLDP-MED
Link Layer Discovery Protocol-Media Endpoint Discovery (LLDP-MED) is an extension to LLDP that operates between IP phones and switch to provide support for voice over IP applications. The switch detects the presence of the IP phone by listening to LLDP-MED packets from the phone. The switch then advertises the voice VLAN, 802.1p, and DSCP values to the phone. The IP Phone will send voice traffic on the voice VLAN with the 802.1p Priority.
Enable LLDP-MED on the switch port and configure voice VLAN/802.1p values to be advertised to IP phone:
cnMatrix(config)# interface gigabitethernet 0/2
cnMatrix(config-if)# lldp med-tlv-select network-policy
cnMatrix(config-if)# lldp med-app-type voice vlan vlan-id 20 priority 6 dscp 46
cnMatrix(config-if)# exit
Verify
Execute CLI commands to confirm the configuration and LLDP neighbor status.
cnMatrix# show running-config vlan
cnMatrix# show running-config interface gigabitethernet 0/2
cnMatrix# show running-config lldp
cnMatrix# show lldp neighbor detail
Using cnMaestro/XMS
VLAN and QoS settings are configurable using GUI on cnMaestro/XMS.
Spanning-tree PortFast and LLDP-MED settings can only be configured using cnMaestro User-Defined Overrides and XMS CLI Snippet.
Note: XMS CLI Snippet requires cnMatrix release 4.0 or later.
Example: cnMaestro User-Defined Overrides
Example: XMS CLI Snippet