语音VLAN信息


9

我知道能够显示分配给cisco交换机上的接口的访问VLAN。如何具体显示为接口分配的语音VLAN?

#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

show interface status命令仅显示访问VLAN,不显示语音VLAN。对命令有何建议,以专门显示分配给交换机端口的语音VLAN,而无需使用过多的正则表达式或查找正在运行的配置?

Answers:


9

首先,请注意:我不确定为什么要指定以下内容(强调我的意思),

有没有建议使用特定命令来显示分配给交换机端口的语音VLAN的命令,而无需使用过多的正则表达式或查找正在运行的配置

但是,该命令甚至可以缩短Cisco设备中最长的reg-ex alias命令。实际上,我经常使用的别名之一就是显示您要查找的确切信息。我将在下面包括。


现在,有几种方法可以获取您要查找的信息,这取决于您确切地知道什么以及要查找什么。

如果您知道该特定交换机上的语音VLAN,并希望查找分配给它们的端口,则只需发出以下命令:

show vlan id <voice-vlan-number>

这将为您提供所有使用该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,

如果您知道感兴趣的端口(或想要查看所有端口),并且只想查看该端口上正在使用哪个语音VLAN,则需要查找以下内容:

show interfaces switchport | include Name|Voice

我将这个命令别名为svv(用于show voice vlan),如下所示:

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

这是我最常用于收集此信息的命令,它给出了输出:

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)

show run如果您需要确切的接口名称和切换端口信息(例如,出于脚本目的),则另一种选择是过滤输出:

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

这给出:

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

6

show interfaces <interface> switchportshow interfaces <interface> switchport | i Voice会得到您想要的东西。

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

要么

Switch# show interfaces gigabitethernet0/1 switchport | i Voice
Voice VLAN: none
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.