首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >不能在“允许的VLAN”中添加VLAN

不能在“允许的VLAN”中添加VLAN
EN

Network Engineering用户
提问于 2020-11-01 02:27:50
回答 2查看 2.6K关注 0票数 2

为什么这个命令不被接受?

代码语言:javascript
复制
switchport trunk allowed vlan add 52,160,176,177,247

我尝试只添加一个VLAN;它也不被接受。没有显示任何错误,只是在我执行show run int [interface id]时没有显示错误。我有以下配置。这将用于访问点,只是为了允许这个端口上的某些VLAN。我可能遗漏了什么,或者这可能是一个iOS错误?

代码语言:javascript
复制
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
EN

回答 2

Network Engineering用户

回答已采纳

发布于 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

票数 6
EN

Network Engineering用户

发布于 2020-11-02 10:05:10

例如,请在主干接口上的现有vlan中添加新的vlan ids

代码语言:javascript
复制
#interface ethernet 1/20
#switchport trunk allowed vlan 10,20,30,40
#switchport mode trunk
#no shutdown

例如,对于上面的senario,如果我们想向现有的主干接口添加额外的新vlan 60,那么执行命令

代码语言:javascript
复制
#int ethernet 1/20
#switchport trunk allowed vlan add 60
#no shut down

然后将配置从运行配置保存到startip配置。

代码语言:javascript
复制
#copy running-config startup-config

然后再检查你的配置

代码语言:javascript
复制
#sh run 

它应该是

代码语言:javascript
复制
#int ethernet 1/20
#switchport trunk allowed vlan 10,20,30,40,60
#switchport mode trunk
#no shutdown
票数 0
EN
页面原文内容由Network Engineering提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://networkengineering.stackexchange.com/questions/70747

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档