5

Can someone please tell me the difference in Layman's termsfor these 2 configurations?

interface FastEthernet0/1
 description PHONES
 switchport mode access
 **switchport voice vlan 51**
 spanning-tree portfast
 spanning-tree bpduguard enable

AND

interface FastEthernet0/1   
 description PHONES 
 **switchport access vlan 51**  
 switchport mode access 
 spanning-tree portfast 
 spanning-tree bpduguard enable 
!

Thank you!

-Vojta

4

Traditionally with Switching, there are two types of ports:

  • Access Ports -- ports which carry traffic for only one VLAN
  • Trunk Ports -- ports which carry traffic for multiple VLANs

In a scenario where a user has their PC plugged into the wall. You would typically configure the switchport that user is connected to as an Access Port:

Practical Networking - Voice VLAN

Switch(config)# vlan 22 
Switch(config-vlan)# name DATA

Switch(config)# interface ethernet0/0
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 22

The issue you run into is what if this user also adds a VOIP phone:

Practical Networking - Voice VLAN - Two Ports

In a perfect world, each device has their own wall jack, and you can configure the two switch ports they are connected to as Access Ports, one in the Data VLAN (for the PC) and the other in the Voice VLAN (for the phone):

Switch(config)# vlan 22
Switch(config-vlan)# name DATA
Switch(config)# vlan 33
Switch(config-vlan)# name VOICE

Switch(config)# interface ethernet0/0
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 22
Switch(config)# interface ethernet0/1
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 33

Using two VLANs allows you to keep the Voice traffic on your network separate from the Data traffic.

However, a second LAN port is not always available.

In those cases, most VOIP phones have two ports, one that can accept the incoming traffic from the PC, and the other that can be connected to the wall jack.

This allows both the Phone and the PC to speak through a single switch port:

Practical Networking - Voice VLAN - one port

The question then, is, how do you configure the single Switchport both of these are connected to, even though the traffic needs to be in two different VLANs. That is where the concept of the Voice VLAN comes into play.

The Voice VLAN allows an access port — which normally only accepts untagged traffic for a single VLAN — to also accept tagged traffic for a second VLAN.

The configuration would look like this:

Switch(config)# vlan 22
Switch(config-vlan)# name DATA
Switch(config)# vlan 33
Switch(config-vlan)# name VOICE

Switch(config)# interface ethernet0/0
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 22
Switch(config-if)# switchport voice vlan 33

Note, there is another way to configure a single port to accept traffic from both VLANs, it involves using a Trunk port and the Native VLAN, but that strategy is not without it's set own set of downsides.


As for your question:

interface FastEthernet0/1
 description PHONES
 switchport mode access
 **switchport voice vlan 51**

interface FastEthernet0/1   
 description PHONES 
 **switchport access vlan 51**  
 switchport mode access 

The first configuration is an Access Port, but since there is no switchport access vlan # command, that port belongs to VLAN 1 -- any untagged traffic arriving on this port will be placed on VLAN 1. Any Tagged traffic will be dropped (generally -- possibly different behaviors for different vendors). Except for traffic tagged with VLAN 51, that traffic will be accepted and placed in VLAN 51.

The second configuration is also an Access Port, and all untagged traffic will be placed on VLAN 51. Any tagged traffic will be dropped.


Disclaimer: The images and links above come from my blog. There are no ads on the blog. It is not monetized. I offer the links and content freely solely to help the readers. Hope they help you too.

| improve this answer | |
  • Thank you for a great detailed explanation @Eddie. So the first configuration would work IF the phone was tagged with VLAN 51. If however the phone traffic remains untagged, then the traffic just travels on VLAN 1 (which is not what I want ideally.) In the second scenario, the downside is if I had a PC plugged into the passthrough port on the phone, then both the phone and PC would pick up VLAN 51 which is also not what I want correct? (if I want to separate my voice and data traffic which is the ideal setup with VOIP phones and the whole point of tagging them with VLANs to begin with). – Vojta Ripa Feb 20 at 13:17
  • @VojtaRipa Yes. Correct on both points. The ideal set up is to use both commands. The regular switchport access vlan ## command to set the VLAN for the untagged data traffic from PC's, and the switchport voice vlan ## command to set the VLAN for the tagged voice traffic from the phone. – Eddie Feb 20 at 15:31
4

The access VLAN is what is used for devices, such as PCs, connecting to the switch interface.

VoIP phones can use CDP (or possibly LLDP, depending on the model and switch configuration) to negotiate a trunk with the switch interface, and the phone will use the VoIP VLAN for itself. If you connect a different device to the phone, the phone will act as a switch and deliver the access VLAN to the device.

It is common to connect a phone to the switch, then connect a PC to the phone. This configuration allows the phone to work on the VoIP VLAN, and the PC to work on the access VLAN.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.