Understanding Huawei Switch Port VLAN Modes: Access, Trunk, and Hybrid Explained
This article explains the differences in VLAN handling on Huawei switches, detailing the IEEE 802.1Q frame format, the role of PVID, and the specific behaviors of access, trunk, and hybrid port modes, including configuration commands and traffic processing rules.
Huawei switches differ from other brands in VLAN port configuration; this article details the VLAN attributes of Huawei switch ports.
IEEE 802.1Q VLAN frame format
The tag is the VLAN tag.
Fields:
TPID is fixed 0x8100, indicating a VLAN tag.
PRI is priority (0‑7).
CFI: 0 for standard format, 1 for non‑standard.
VLAN ID: the VLAN number, range 1‑4094.
PVID (Port VLAN ID) is a basic port attribute, default 1, and can be set manually.
Huawei port modes
Huawei switch ports support three modes: access , trunk , and hybrid .
Access mode
When receiving frames:
If the frame has a VLAN tag and its VLAN ID matches the port's PVID, the frame is forwarded; otherwise it is dropped.
If the frame has no VLAN tag, the port adds a VLAN tag with the PVID and forwards it.
When sending frames:
The port only sends frames whose VLAN ID equals the PVID; the VLAN tag is stripped before transmission.
Example configuration:
[Huawei-GigabitEthernet0/0/3]port link-type access
[Huawei-GigabitEthernet0/0/3]port default vlan 10This sets the port to access mode with PVID 10. The port can send and receive frames with VLAN ID 10; untagged frames are tagged with VLAN ID 10 on ingress.
Trunk mode
When receiving frames:
Untagged frames are tagged with the port's PVID; if the PVID is in the allowed VLAN list, the frame is forwarded, otherwise dropped.
Tagged frames are forwarded only if their VLAN ID is in the allowed VLAN list; otherwise dropped.
When sending frames:
The port can send frames belonging to allowed VLANs. If a frame's VLAN ID equals the PVID, the tag is stripped; otherwise the tag is kept.
Example configuration:
[Huawei-GigabitEthernet0/0/4]port link-type trunk
[Huawei-GigabitEthernet0/0/4]port trunk pvid vlan 5
[Huawei-GigabitEthernet0/0/4]port trunk allow-pass vlan 10 20 30This configures a trunk port with PVID 5 and allowed VLANs 10, 20, 30.
Hybrid mode
When receiving frames:
Untagged frames are tagged with the PVID; if the PVID is in the allowed VLAN list, the frame is forwarded, otherwise dropped.
Tagged frames are forwarded only if their VLAN ID is in the allowed VLAN list; otherwise dropped.
When sending frames:
The port can send frames from allowed VLANs; it can be configured to send tagged or untagged frames per VLAN.
Example configuration:
[Huawei-GigabitEthernet0/0/6]port hybrid pvid vlan 10
[Huawei-GigabitEthernet0/0/6]port hybrid tagged vlan 10 20 30
[Huawei-GigabitEthernet0/0/6]port hybrid untagged vlan 100 200 300This sets a hybrid port with PVID 10 and allowed VLANs 10, 20, 30 (tagged) and 100, 200, 300 (untagged).
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Open Source Linux
Focused on sharing Linux/Unix content, covering fundamentals, system development, network programming, automation/operations, cloud computing, and related professional knowledge.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
