一、修改端口模式之前需要将端口恢复成默认配置。
二、修改方法有两种:
1、逐条删除命令,直到端口上没有其他非默认配置为止
2、V200R001及其以后版本可以在系统视图下通过clear configuration interface GigabitEthernet x/x/x一键清除配置,执行命令后端口会被shutdown,需要在接口视图下手动undo shutdown打开。
三、交换机修改端口模式的时候报错案例:
交换机的端口原来是trunk模式,透传了所有vlan。现在想将其修改为access模式时报错。
#
interface Ethernet0/0/5
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
return
[Quidway-Ethernet0/0/5]undo port trunk allow-pass vlan all
[Quidway-Ethernet0/0/5]port link-type access
Error: Please renew the default configurations.
1、分析报错信息是Error: Please renew the default configurations.表示端口目前不是默认配置不能修改端口模式。需要还原端口默认配置。
2、在查看本端口的配置
[Quidway-Ethernet0/0/5]disp this
#
interface Ethernet0/0/5
port link-type trunk
undo port trunk allow-pass vlan 1
#
return
3、对比端口默认配置发现端口多了标红的那条命令,端口下默认配置是没有这一条的。因此需要将此命令去掉。
4、在端口下执行命令:
[Quidway-Ethernet0/0/5]port trunk allow-pass vlan 1
再display this看:
#
interface Ethernet0/0/5
port link-type trunk
#
已经是默认配置了。
5、再次修改端口模式成功:
[Quidway-Ethernet0/0/5]port link-type access
[Quidway-Ethernet0/0/5]display this
interface Ethernet0/0/5
port link-type access
#