为什么这个命令不被接受?
switchport trunk allowed vlan add 52,160,176,177,247我尝试只添加一个VLAN;它也不被接受。没有显示任何错误,只是在我执行show run int [interface id]时没有显示错误。我有以下配置。这将用于访问点,只是为了允许这个端口上的某些VLAN。我可能遗漏了什么,或者这可能是一个iOS错误?
Switch Model: WS-C3560-24PS
IOS Version: C3560 Software (C3560-IPBASEK9-M), Version 12.2(55)SE4, RELEASE SOFTWARE (fc1)
interface FastEthernet0/22
switchport trunk encapsulation dot1q
switchport trunk native vlan 247
switchport mode trunk
spanning-tree portfast trunk
end
show int fa0/22 shows that allowed vlan are still showing "ALL".
Switch#sh int fa0/22 switchport
Name: Fa0/22
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: down
Administrative Trunking Encapsulation: dot1q
Negotiation of Trunking: On
Access Mode VLAN: 1 (default)
Trunking Native Mode VLAN: 247
Administrative Native VLAN tagging: enabled
Voice VLAN: none
Administrative private-vlan host-association: none
Administrative private-vlan mapping: none
Administrative private-vlan trunk native VLAN: none
Administrative private-vlan trunk Native VLAN tagging: enabled
Administrative private-vlan trunk encapsulation: dot1q
Administrative private-vlan trunk normal VLANs: none
Administrative private-vlan trunk associations: none
Administrative private-vlan trunk mappings: none
Operational private-vlan: none
Trunking VLANs Enabled: ALL
Pruning VLANs Enabled: 2-1001
Capture Mode Disabled
Capture VLANs Allowed: ALL发布于 2020-11-01 02:33:50
在使用add命令添加到现有列表之前,必须在允许的列表(而不是“全部”)中有一个VLAN。
所以,首先,使用:switchport trunk allowed vlan 52
然后您可以使用:switchport trunk allowed vlan add 160,176,177,247
原因是,现在它设置为" all ",所以没有什么可添加的,因为它们都已经被允许了。这就是为什么你必须限制它只是一个或更多(但不是“全部”)的vlan(s),然后添加到它之后的事实。
或者,您可以在一个命令中使用多个VLAN设置VLAN允许的列表,只需在您已经尝试的内容中不使用"add“关键字,例如:switchport trunk allowed vlan 52,160,176,177,247。
发布于 2020-11-02 10:05:10
例如,请在主干接口上的现有vlan中添加新的vlan ids
#interface ethernet 1/20
#switchport trunk allowed vlan 10,20,30,40
#switchport mode trunk
#no shutdown例如,对于上面的senario,如果我们想向现有的主干接口添加额外的新vlan 60,那么执行命令
#int ethernet 1/20
#switchport trunk allowed vlan add 60
#no shut down然后将配置从运行配置保存到startip配置。
#copy running-config startup-config然后再检查你的配置
#sh run 它应该是
#int ethernet 1/20
#switchport trunk allowed vlan 10,20,30,40,60
#switchport mode trunk
#no shutdownhttps://networkengineering.stackexchange.com/questions/70747
复制相似问题