Take the 2-minute tour ×
Network Engineering Stack Exchange is a question and answer site for network engineers. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

up vote 8 down vote accepted

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
share|improve this answer

show interfaces <interface> switchport or show interfaces <interface> switchport | i Voice would get you what you are looking for.

Switch# show interfaces gigabitethernet0/1 switchport
Name: Gi0/1
Switchport: Enabled
Administrative Mode: dynamic auto
Operational Mode: static access
Administrative Trunking Encapsulation: negotiate
Operational Trunking Encapsulation: native
Negotiation of Trunking: On
Access Mode VLAN: 1 (default)
Trunking Native Mode VLAN: 1 (default)
Voice VLAN: none
Administrative private-vlan host-association:10 (VLAN0010) 502 (VLAN0502)
Administrative private-vlan mapping: none 
Administrative private-vlan trunk native VLAN: none
Administrative private-vlan trunk encapsulation: dot1q
Administrative private-vlan trunk normal VLANs: none
Administrative private-vlan trunk private VLANs: none
Operational private-vlan: none
Trunking VLANs Enabled: ALL
Pruning VLANs Enabled: 2-1001
Capture Mode Disabled
Capture VLANs Allowed: ALL

or

Switch# show interfaces gigabitethernet0/1 switchport | i Voice
Voice VLAN: none
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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