Cisco – Voice VLAN information

ciscocisco-iosvlanvoice

I am aware of the ability to show the access VLAN assigned to an interface on a cisco switch. How about showing specifically the voice VLAN an interface is assigned?

#show run int fa1/47
interface FastEthernet1/47
 description Data&Voice
 switchport access vlan 1
 switchport mode access
 switchport voice vlan 2
end

#show int status module 1 | in Fa1/47
Port      Name             Status      Vlan    Duplex  Speed  Type
Fa1/47  Data&Voice  notconnect   1          full      100      10/100BaseTX

The show interface status command only shows the access VLAN, not the voice VLAN. Any suggestions for commands to specifically show the voice VLAN assigned to a switch port without using too much reg-ex or seeking through the running configuration?

Best Answer

First, a caveat: I'm not sure why you specified the following (emphasis mine),

Any suggestions for commands to specifically show the voice vlan assigned to a switch port without using too much reg-ex or seeking through the running configuration?

However, even the lengthiest reg-ex command in a Cisco device can be shortened by the alias command. In fact one of my frequently used aliases is to show the exact information you're looking for. Which I will include below.


Now, there are several ways to get the information you're looking for, and it depends on what exactly you know, and what you're trying to find.

If you know what the voice VLAN(s) is/are on that particular switch, and you're looking to find out what ports they're assigned to, you could simply issue the command:

show vlan id <voice-vlan-number>

This would give you a list of all ports utilizing that VLAN:

ATR4506-A1A-1#show vlan id 210 

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
210  ATRIUM-IP-PHONES                 active    Gi2/2, Gi2/3, Gi2/4, Gi2/5, Gi2/6,

If you know the port of interest (or want to see all ports) and just want to see which voice VLAN is in use on that port, you are looking for something like the following:

show interfaces switchport | include Name|Voice

I have this command aliased to svv (for show voice vlan) like so:

conf t
alias exec svv show interfaces switchport | include Name|Voice

This is the command I most frequently use to gather this information, and it gives the output:

ATR4506-A1A-1#svv                                      
Name: Te1/1
Voice VLAN: none
Name: Te1/2
Voice VLAN: none
Name: Gi2/2
Voice VLAN: 210 (ATRIUM-IP-PHONES)
Name: Gi2/3
Voice VLAN: 210 (ATRIUM-IP-PHONES)
Name: Gi2/4
Voice VLAN: 210 (ATRIUM-IP-PHONES)
Name: Gi2/5
Voice VLAN: 210 (ATRIUM-IP-PHONES)

Another alternative would be to filter the show run output if you need the exact interface names and switchport info (for scripting purposes for example):

show running-config | include interface GigabitEthernet|switchport voice vlan

This gives:

ATR4506-A1A-1#show running-config | include interface GigabitEthernet|switchport voice vlan 
interface GigabitEthernet1/3
interface GigabitEthernet1/4
interface GigabitEthernet1/5
interface GigabitEthernet1/6
interface GigabitEthernet2/1
interface GigabitEthernet2/2
 switchport voice vlan 210
interface GigabitEthernet2/3
 switchport voice vlan 210
Related Topic