How to add interfaces to a VLAN in a batch

8

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.

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.

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.

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.

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

Other related questions:
Add an interface to different VLANs
An access interface cannot be added to different VLANs. Run the port default vlan command to configure a default VLAN. A trunk interface can be added to multiple VLANs by running the port trunk allow-pass vlan command. A hybrid interface can be added to multiple VLANs in untagged or tagged mode by running the port hybrid untagged vlan or port hybrid tagged vlan command.

Configure a VLAN on the S1728GWR-4P switch
Configure a VLAN on an S1728GWR-4P switch as follows: 1. Create a VLAN. Choose VLAN > Static and select Add from the Action list box. Enter a VLAN ID, and click Apply. 2. Add VLAN members. Choose VLAN >Static. From the Action drop-down list box, select Modify, Edit/Show Member by Interface, Edit Member by Interface Range, or Edit/Show Member by VLAN to configure members for a specified VLAN, interface, or interface range. In the interface list displayed, configure the VLAN attributes of interfaces.

How to create VLANs in a batch
Run the vlan batch command in the system view to create VLANs in a batch. Create 10 contiguous VLANs: VLAN 11 to VLAN 20. system-view [HUAWEI] vlan batch 11 to 20 Create 10 discontiguous VLANs in a batch: VLAN 10, VLAN 15 to VLAN 19, VLAN 25, VLAN 28 to VLAN 30. system-view [HUAWEI] vlan batch 10 15 to 19 25 28 to 30 NOTE: You can create a maximum of 10 discontiguous VLANs or VLAN range at one time. If there are more than 10 VLANs, run this command multiple times. For example, the vlan batch 10 15 to 19 25 28 to 30 command creates four discontiguous VLAN ranges.

How to delete a single VLAN or VLANs in a batch
The device supports deletion of a single VLAN or VLANs in a batch. Delete VLAN 10. system-view [HUAWEI] undo vlan 10Delete VLAN 10 to VLAN 20 in a batch. system-view [HUAWEI] undo vlan batch 10 to 20 NOTE: In the earlier versions of V200R005, before deleting a VLAN where a VLANIF interface has been configured, run the undo interface vlanif command to delete the VLANIF interface.

If you have more questions, you can seek help from following ways:
To iKnow To Live Chat
Scroll to top