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),
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:
This would give you a list of all ports utilizing that VLAN:
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:
I have this command aliased to
svv
(for show voice vlan) like so:This is the command I most frequently use to gather this information, and it gives the output:
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):This gives: