A Cisco switch port is configured to support both a data VLAN and a voice VLAN simultaneously, using the commands required to separate traffic from a VoIP phone and a connected workstation on a single access port.
Configure Voice VLAN on Switch
Now let's take a look at how to set up a voice VLAN on a switch. In fact, as we mentioned, a phone has a built-in switch, so we're going to set it up as both a voice and a data VLAN and take a look and see what that looks like.
Here I'm on switch 2 right now, and I just did a show run interface Fa0/5 to see what it's configured with right now. As we can see, there's no real settings on this interface.
So let's get into the interface and start configuring it. I'm going to get into the global configuration mode and then get into interface Fa0/5 so we can configure that.
The first command I'm going to do is I'm going to set this as an access port, so switchport mode access. Now it's an access port. Then we are going to set it up with the VLAN it's a part of. The data VLAN that I'm going to use for this one is going to be the sales VLAN. I've got that over here showing that the sales VLAN over here is what I'm going to set it up for. So let's set it up for VLAN 50: switchport access vlan 50. We'll hit enter and now it's set up with that.
I'm going to do show run interface Fa0/5 just so we can look and see what's on it right now.
Now I'm going to set this up with a voice VLAN. Since it's going to have voice on it, I want there to be that class of service set up. So what I'm going to do is mls qos, quality of service, trust cos, and hit enter. Now let's take a look and see what happened on this interface. So now that is set up with the mls qos trust interface.
Next what I'm going to do is a switchport voice vlan and the VLAN ID. So the voice VLAN is 150, so the voice VLAN is going to be VLAN 150. I'm going to hit enter, and now let's take a look at that interface.
Now I've got all of that set up. It actually does have spanning tree on it, so it included something else we haven't talked about; we haven't talked about spanning tree yet. But now it's set up as being a voice VLAN. So now as I plug the phone into it, it's going to have that traffic tagged with the appropriate VLAN information that it's a part of. The computer is going to be plugged into the data VLAN of 50, and the phone will be using VLAN 150.
TechKnowSurge builds IT and cybersecurity professionals through hands-on, concept-first training built around real understanding — not memorization. Free interactive tools, structured programs, and 25+ years of real-world experience, all in one place.
Explore free tools and programs →