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:
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:
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:
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.