华为交换机端口由trunk更改为access解决报错及更改方法

实例一:

无论如何配置,就是不能将端口有trunk改为access

后面发现这样配置,就可以将端口更改:

用下面两条命令就可以更改端口类型

[Huawei-GigabitEthernet0/0/1]undo port trunk allow-pass vlan all                  //取消trunk 口上面允许通过的所有vlan

[Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan 1                           //将trunk端口重新允许默认的vlan1通过

实例二:

[S9306-GigabitEthernet2/0/42]dis this
#
interface GigabitEthernet2/0/42 原先的为trunk,
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet2/0/42 现在改为access
undo port trunk allow-pass vlan all
port trunk allow-pass vlan 1
port link-type access
port default vlan 10

使用undo port trunk allow-pass vlan all命令时会将默认的Vlan 1也会undo掉,

所以必须再执行一次port trunk allow-pass vlan 1

 

或者使用下面的命令也可以:

interface GigabitEthernet0/0/26 原先的为trunk

port link-type trunk

port trunk allow-pass vlan 2 to 4094

#

undo port trunk allow-pass vlan 2 to 4094 先undo掉2-4094

undo port link-type 再undo掉trunk

port link-type access 设置为access
port default vlan 10 设置默认VLAN

点赞