<Huawei> system-view
[Huawei] vlan 2
[Huawei-vlan2] quit
# Set the link type of Ethernet 2/0/1 to trunk and add Ethernet 2/0/1 to VLAN 2.
[Huawei] interface ethernet 2/0/1
[Huawei-Ethernet2/0/1] port link-type trunk
[Huawei-Ethernet2/0/1] port trunk allow-pass vlan 2
[Huawei-Ethernet2/0/1] quit
# Set the link type of Ethernet 2/0/2 to trunk and add Ethernet 2/0/2 to VLAN 2.
[Huawei]interface ethernet 2/0/2
[Huawei-Ethernet2/0/2] port link-type trunk
[Huawei-Ethernet2/0/2] port trunk allow-pass vlan 2
[Huawei-Ethernet2/0/2] quit
# Create VLAN 3.
[Huawei] vlan 3
[Huawei-vlan3] quit
# Set the link type of Ethernet 2/0/3 to trunk and add Ethernet 2/0/3 to VLAN 3.
[Huawei] interface ethernet 2/0/3
[Huawei-Ethernet2/0/3] port link-type trunk
[Huawei-Ethernet2/0/3] port trunk allow-pass vlan 3
[Huawei-Ethernet2/0/3] quit
# Set the link type of Ethernet 2/0/4 to trunk and add Ethernet 2/0/4 to VLAN 3.
[Huawei] interface ethernet 2/0/4
[Huawei-Ethernet2/0/4] port link-type trunk
[Huawei-Ethernet2/0/4] port trunk allow-pass vlan 3
[Huawei-Ethernet2/0/4] quit
Step 2 Verify the configuration.
Ping any host in VLAN 3 from a host in VLAN 2. The ping operation fails, indicating that
Department 1 and Department 2 are isolated from Department 3 and Department 4.
Ping any host in Department 2 from a host in Department 1. The ping operation is successful,
indicating that Department 1 and Department 2 can communicate with each other.
Ping any host in Department 4 from a host in Department 3. The ping operation is successful,
indicating that Department 3 and Department 4 can communicate with each other.
----End
Configuration Files
Configuration file of the Router
#
vlan batch 2 to 3
#
interface Ethernet2/0/1
port link-type trunk
port trunk allow-pass vlan 2
#
interface Ethernet2/0/2
port link-type trunk
port trunk allow-pass vlan 2
#
interface Ethernet2/0/3
port link-type trunk
Huawei AR3200 Series Enterprise Routers
Configuration Guide - LAN 3 VLAN Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright © Huawei Technologies Co., Ltd.
103