Classic FAQs about VLANs

This issue shares with you knowledge about VLAN.
1. How to create and delete VLANs in batches
Run the vlan batch command in the system view to create VLANs in batches. Create 10 consecutive VLANs: VLAN 11 to VLAN 20.
<HUAWEI> system-view
[~HUAWEI] vlan batch 11 to 20
[*HUAWEI] commit
- 1.
- 2.
- 3.
Create 10 discontinuous VLANs in a batch: VLAN 10, VLANs 15 to 19, VLAN 25, and VLANs 28 to 30.
<HUAWEI> system-view
[~HUAWEI] vlan batch 10 15 to 19 25 28 to 30
[*HUAWEI] commit
- 1.
- 2.
- 3.
2. How to add interfaces to a VLAN in batches
You can add interfaces to a VLAN in batches through port groups. For access interfaces, you can also add interfaces to a VLAN in batches directly in the VLAN view.
3. How to restore the default VLAN configuration on an interface
The VLAN configuration on an interface includes the default VLAN and the VLANs to which the interface is assigned (that is, the VLANs that the interface allows traffic to pass). By default, the default VLAN of an interface is VLAN 1, and the interface is assigned to VLAN 1 in untagged mode.
In the interface view, first run the display this command to check the link type of the current interface. Then use the following method to restore the default VLAN configuration on the interface.
4. How to change the interface type
There are three link types for interfaces: access, trunk, and hybrid. If the default VLAN configuration on an interface is to join VLAN 1 and the PVID is VLAN 1, you can run the port link-type { access | trunk | hybrid } command to change the interface type.
5. Why is the VLANIF interface not up?
The VLANIF interface can only be Up if there is an Up physical interface in the VLAN to which it corresponds.
6. What are the uses of VLANs and VLANIF interfaces?
The purpose of VLAN division is:
- Limiting broadcast domain: The broadcast domain is limited to a VLAN, saving bandwidth and improving network processing capabilities.
- Enhanced LAN security: Messages in different VLANs are isolated from each other during transmission, that is, users in one VLAN cannot directly communicate with users in other VLANs.
- Improved network robustness: Faults are limited to one VLAN, and faults within this VLAN will not affect the normal operation of other VLANs.
- Flexible construction of virtual workgroups: VLANs can be used to divide different users into different workgroups. Users in the same workgroup do not have to be confined to a fixed physical range, making network construction and maintenance more convenient and flexible.
The purpose of configuring a VLANIF interface is to configure an IP address as a logical Layer 3 interface based on a VLAN. After VLAN division, users within the same VLAN can communicate with each other, but users in different VLANs cannot communicate directly. To enable inter-VLAN communication, configure a logical Layer 3 interface—a VLANIF interface.
7. Why is a MAC address learned in multiple VLANs?
MAC address learning is based on the MAC + VLAN method. If multiple VLANs receive packets with the same MAC address, the same MAC address will be learned in all VLANs.
8. Which VLAN will the MAC address of the port configured with QinQ or VLAN Mapping learn?
Because VLAN mapping or QinQ processing occurs before MAC address learning, after VLAN mapping or QinQ is configured, the MAC address learned is the outer VLAN.