How to add interfaces to a VLAN in a batch

Publication Date:  2016-11-24 Views:  153 Downloads:  0
Issue Description
How to add interfaces to a VLAN in a batch
Solution
You can add interfaces to a VLAN in a batch using a port group, and directly add access interfaces to a VLAN in a batch in the system view.

Access interface

# Add GE0/0/1-GE0/0/5 to VLAN 10 in a batch.

Add interfaces to a VLAN in a batch using a port group.

<HUAWEI> system-view
[HUAWEI] port-group pg1
[HUAWEI-port-group-pg1] group-member gigabitethernet0/0/1 to gigabitethernet0/0/5
[HUAWEI-port-group-pg1] port link-type access
[HUAWEI-port-group-pg1] port default vlan 10

Add interfaces to a VLAN in a batch in the VLAN view.

<HUAWEI> system-view
[HUAWEI] vlan 10
[HUAWEI-vlan10] port gigabitethernet 0/0/1 to 0/0/5 NOTE:
Before performing this operation, configure interfaces to be added to a VLAN as access interface.

Trunk interface

# Add GE0/0/1-GE0/0/5 to VLAN 10 and VLAN 20 in a batch.

<HUAWEI> system-view
[HUAWEI] port-group pg1
[HUAWEI-port-group-pg1] group-member gigabitethernet0/0/1 to gigabitethernet0/0/5
[HUAWEI-port-group-pg1] port link-type trunk
[HUAWEI-port-group-pg1] port trunk allow-pass vlan 10 20Hybrid interface

# Add GE0/0/1-GE0/0/5 to VLAN 10 and VLAN 20 in a batch.

<HUAWEI> system-view
[HUAWEI] port-group pg1
[HUAWEI-port-group-pg1] group-member gigabitethernet0/0/1 to gigabitethernet0/0/5
[HUAWEI-port-group-pg1] port link-type hybrid
[HUAWEI-port-group-pg1] port hybrid tagged vlan 10
[HUAWEI-port-group-pg1] port hybrid untagged vlan 20

END