FAQ--S系列交换机如何批量加入VLAN

发布时间:  2014-12-21 浏览次数:  377 下载次数:  0
问题描述
S系列交换机如何批量加入VLAN
解决方案
由于交换机接口默认是hybrid模式,在vlan视图下,使用命令port interface-type { interface-number1 [ to interface-number2 ]}会出现如下报错提示:Error: Trunk or Hybrid port(s) cannot be added or deleted in this manner.可以使用port-group端口组解决此问题。
举例如下:
将接口g0/0/1--g0/0/4加入vlan4

<HUAWEI>system-view
Enter system view, return user view with Ctrl+Z.
[HUAWEI]vlan 4

[HUAWEI-vlan4]port GigabitEthernet 0/0/1 to 0/0/4
Error: Trunk or Hybrid port(s) cannot be added or deleted in this manner. //接口缺省模式是hybrid
[HUAWEI-vlan4]quit 
使用端口组操作如下:
[HUAWEI]port-group 1
[HUAWEI-port-group-1]group-member GigabitEthernet 0/0/1 to GigabitEthernet 0/0/4
[HUAWEI-port-group-1]port link-type access
[HUAWEI-GigabitEthernet0/0/1]port link-type access
[HUAWEI-GigabitEthernet0/0/2]port link-type access
[HUAWEI-GigabitEthernet0/0/3]port link-type access
[HUAWEI-GigabitEthernet0/0/4]port link-type access
[HUAWEI-port-group-1]port default vlan 4
[HUAWEI-GigabitEthernet0/0/1]port default vlan 4
[HUAWEI-GigabitEthernet0/0/2]port default vlan 4
[HUAWEI-GigabitEthernet0/0/3]port default vlan 4
[HUAWEI-GigabitEthernet0/0/4]port default vlan 4
[HUAWEI-port-group-1]quit

[HUAWEI]

END