Context
Ports on a Layer 2 switching device can be bound to a specific VLAN. After a port is added to
a VLAN, packets of the user that is connected to the port can only be forwarded within the
VLAN, but not forwarded to another VLAN. This implementation ensures that broadcast packets
are forwarded only within a single VLAN.
You must create VLANs, configure the port type, and associate ports with VLANs.
Procedure
Step 1
Run:
system-view
The system view is displayed.
Step 2
Run:
vlan
vlan-id
A VLAN is created, and the VLAN view is displayed. If the specified VLAN has been created,
the VLAN view is directly displayed.
The VLAN ID ranges from 1 to 4094. If VLANs need to be created in batches, run the
vlan
batch
{
vlan-id1
[
to
vlan-id2
] } &<1-10> command to create VLANs in batches, and then run
the
vlan
vlan-id
command to enter the view of a specified VLAN.
NOTE
If a device is configured with multiple VLANs, configuring names for these VLANs is recommended:
Run the
name
vlan-name
command in the VLAN view. After a VLAN name is configured, you can run
the
vlan vlan-name
vlan-name
command in the system view to enter the corresponding VLAN view.
Step 3
Run:
quit
The system view is displayed.
Step 4
Configure the port type and features.
1.
Run the
interface
interface-type
interface-number
command to enter the view of an
Ethernet port to be added to the VLAN.
2.
Run the
port link-type
{
access
|
hybrid
|
trunk
} command to configure the port type.
By default, the port type is Hybrid.
l
If an Ethernet port is directly connected to a terminal, set the port type to access or
hybrid.
l
If an Ethernet port is connected to another industrial switch router, set the port type to
trunk or hybrid.
NOTE
Before changing the interface type, restore the default VLAN configuration of the interface so that
the interface belongs to only VLAN 1.
3.
(Optional) Run the
port priority
priority-value
command to configure the port priority.
By default, the port priority value is 0. The value ranges from 0 to 7. A larger value indicates
a higher priority.
Huawei AR530&AR550 Series Industrial Switch Routers
Configuration Guide - Ethernet Switching
3 VLAN Configuration
Issue 01 (2014-11-30)
Huawei Proprietary and Confidential
Copyright © Huawei Technologies Co., Ltd.
94