01-05 VLAN Configuration
01-05 VLAN Configuration
Switches
Configuration Guide - Ethernet Switching 5 VLAN Configuration
5 VLAN Configuration
Definition
Virtual Local Area Network (VLAN) technology divides a physical LAN into
multiple broadcast domains, each of which is called a VLAN.
Purpose
Ethernet technology implements data communication over shared media based on
Carrier Sense Multiple Access/Collision Detection (CSMA/CD). When an Ethernet
network has a large number of hosts, both collisions and broadcast storms
become a serious problem, affecting network performance and in some cases
causing the network to completely break down. Although using switches to
connect LANs can prevent collisions, they cannot isolate broadcast packets or
improve network quality.
VLAN technology divides a physical LAN into multiple VLANs to isolate broadcast
domains. Because each VLAN functions as a separate broadcast domain, hosts can
communicate directly with other hosts only if they are in the same VLAN.
SwitchA SwitchB
VLAN2 VLAN3
Figure 5-1 shows a simple VLAN networking diagram. Two switches are placed in
different locations (for example, in different floors of a building). Each switch is
connected to two servers that respectively belong to different VLANs, and the four
servers belong to two VLANs.
Benefits
The VLAN technology brings the following benefits to customers:
● Limits scope of broadcast domains: A broadcast domain is limited in a VLAN.
This saves bandwidth and improves network processing capabilities.
● Enhances LAN security: Packets from different VLANs are transmitted
separately, preventing hosts in a VLAN from communicating directly with
hosts in another VLAN.
● Improves network robustness: A fault in one VLAN does not affect hosts in
other VLANs.
● Allows flexible definition of virtual groups: With VLAN technology, hosts in
different geographical locations can be grouped together, thereby simplifying
network construction and maintenance.
PRI 3 bits Priority (PRI), indicating the The value ranges from 0 to 7. The
frame priority. greater the value, the higher the
priority. These values can be used
to prioritize different classes of
traffic to ensure that frames with
high priorities are transmitted first
when traffic is heavy.
CFI 1 bit Canonical Format Indicator If the value is 0, the MAC address
(CFI), indicating whether is in the canonical format. CFI is
the MAC address is in used to ensure compatibility
canonical format. between Ethernet networks and
Token Ring networks. It is always
set to zero for Ethernet switches.
Each frame sent by a 802.1Q-capable switch carries a VLAN ID. The following are
the two types of Ethernet frames in a VLAN:
● Tagged frames: frames with 4-byte 802.1Q tags.
● Untagged frames: frames without 4-byte 802.1Q tags.
Link Types
As shown in Figure 5-4, there are the following types of VLAN links:
● Access link: connects a host to a switch. Generally, a host does not know
which VLAN it belongs to, and host hardware cannot distinguish frames with
VLAN tags. Therefore, hosts send and receive only untagged frames.
● Trunk link: connects a switch to another switch or to a router. Data of
different VLANs is transmitted along a trunk link. The two ends of a trunk link
must be able to distinguish frames with VLAN tags. Therefore, only tagged
frames are transmitted along trunk links.
VLAN3 VLAN3
Server3 Server4
Access link
3
3 3
2 Trunk link Trunk link 2
DeviceB DeviceA DeviceC
2
Access link
Server1 Server2
VLAN2 VLAN2
Access Link
Trunk Link
NOTE
● A host does not need to know the VLAN to which it belongs. It sends only untagged
frames.
● After receiving an untagged frame from a host, a switching device determines the
VLAN to which the frame belongs. The determination is based on the configured
VLAN assignment method such as port information, and then the switching device
processes the frame accordingly.
● If the frame needs to be forwarded to another switching device, the frame must be
transparently transmitted along a trunk link. Frames transmitted along trunk links
must carry VLAN tags to allow other switching devices to properly forward the frame
based on the VLAN information.
● Before sending the frame to the destination host, the switching device connected to
the destination host removes the VLAN tag from the frame to ensure that the host
receives an untagged frame.
Generally, only tagged frames are transmitted on trunk links; only untagged frames are
transmitted on access links. In this manner, switching devices on the network can properly
process VLAN information and hosts are not concerned about VLAN information.
Port Types
After the 802.1Q defines VLAN frames, ports can be classified into four types:
● Access port
As shown in Figure 5-4, an access port on a switch connects to the port on a
host. The access port can only connect to an access link. Only the VLAN
whose ID is the same as the default VLAN ID is allowed on the access port.
Ethernet frames sent from the access port are untagged frames.
● Trunk port
As shown in Figure 5-4, a trunk port on a switch connects to another switch.
It can only connect to a trunk link. Multiple tagged VLAN frames are allowed
on the trunk port.
● Hybrid port
As shown in Figure 5-5, a hybrid port on a switch can connect either to a host
or to another switch. A hybrid port can connect either to an access link or to a
trunk link. The hybrid port allows multiple VLAN frames and removes tags
from some VLAN frames on the outbound port.
Hybrid Port
Access Link
Trunk Link
● QinQ port
QinQ ports are enabled with the IEEE 802.1 QinQ protocol. A QinQ port adds
a tag to a single-tagged frame and supports a maximum of 4094 x 4094
VLAN tags, which meets the requirement for the VLAN quantity.
Figure 5-6 shows the format of a QinQ frame. The outer tag is often called
the public tag and carries the VLAN ID of the public network, whereas the
inner tag is often called the private tag and carries the VLAN ID of the private
network.
Default VLAN
The default VLAN ID of an interface is called the port default VLAN ID (PVID). The
meaning of the default VLAN varies according to the port type.
For details on different PVIDs and methods of processing Ethernet frames, see
Frame processing based on the port type.
VLAN Assignment
VLAN assignment is a basic VLAN configuration. Users in the same VLAN can
communicate with each other. Table 5-2 shows the VLAN assignment methods
and their usage scenarios.
The switch supports multiple VLAN assignment modes, the priority is of MAC
address-based VLAN assignment or IP subnet-based VLAN assignment, protocol-
based VLAN assignment, interface-based VLAN assignment in a descending order.
● If packets match both MAC address-based VLAN assignment and IP subnet-
based VLAN assignment, by default, MAC address-based VLAN assignment is
Access Accepts an untagged ● Accepts the tagged After the PVID tag
port frame and adds a tag frame if the frame's is stripped, the
with the default VLAN VLAN ID matches frame is
ID to the frame. the default VLAN transmitted.
ID.
● Discards the tagged
frame if the frame's
VLAN ID differs
from the default
VLAN ID.
QinQ QinQ ports are enabled with the IEEE 802.1 QinQ protocol. A QinQ
port port adds a tag to a single-tagged frame, and supports a maximum of
4094 x 4094 VLAN tags, which meets the requirement on the number
of VLANs.
NOTE
Because all interfaces join VLAN 1 by default, broadcast storms may occur if unknown
unicast, multicast, or broadcast packets exist in VLAN 1. To prevent loops, delete interfaces
that do not need to be added to VLAN 1 from VLAN 1.
Intra-VLAN Communication
Sometimes VLAN users are connected to different switches, in which case the
VLAN spans multiple switches. Since ports between these switches must recognize
and send packets belonging to the VLAN, the trunk link technology becomes
helpful in simplifying this solution.
● Trunk line
The trunk link transparently transmits VLAN packets between switches.
● Backbone line
The trunk link transmits packets belonging to multiple VLANs.
VLAN 3
VLAN 2
UserA UserB
As shown in Figure 5-7, the trunk link between DeviceA and DeviceB must both
support the intra-communication of VLAN 2 and the intra-communication of
VLAN 3. Therefore, the ports at both ends of the trunk link must be configured to
belong to both VLANs. That is, Port2 on DeviceA and Port1 on DeviceB must
belong to both VLAN 2 and VLAN 3.
Inter-VLAN Communication
After VLANs are configured, users in different VLANs cannot directly communicate
with each other. To implement communication between VLANs, use either of the
following methods:
● Layer 3 sub-interface
As shown in Figure 5-8, DeviceA is a Layer 3 switch supporting Layer 3 sub-
interface, and DeviceB is a Layer 2 switch. LANs are connected using the
switched Ethernet interface on DeviceB and the routed Ethernet interface on
DeviceA. User hosts are assigned to VLAN2 and VLAN3. To implement inter-
VLAN communication, configure as follows:
– On DeviceA, create two Layer 3 sub-interfaces Port1.1 and Port2.1 on the
Ethernet interface connecting to DeviceB, and configure 802.1Q
encapsulation on Layer 3 sub-interfaces corresponding to VLAN2 and
VLAN3.
– Configure IP addresses for Layer 3 sub-interfaces.
– Set types of Ethernet interfaces connecting DeviceB and DeviceA to
Trunk or Hybrid, to allow VLAN2 and VLAN3 frames.
– Set the default gateway address to the IP address of the Layer 3 sub-
interface mapping the VLAN to which the user host belongs.
DeviceA
Port1.1 Port2.1
VLAN Trunk
DeviceB
Access port
VLANIF2 VLANIF3
to correspond to one Layer 3 logic interface. However, this can waste IP addresses.
Figure 5-10 shows the VLAN division in the device.
VLANIF3:10.1.1.17
2 10.1.1.0/28 10.1.1.1 14 13 10
3 10.1.1.16/2 10.1.1.17 6 5 5
9
4 10.1.1.24/3 10.1.1.25 2 1 1
0
mode even if the optimal scheme is used. Nearly half of the addresses is wasted.
In addition, if VLAN 2 is accessed to three servers instead of 10 servers later, the
extra addresses will not be used by other VLANs and will be wasted.
This division is inconvenient for the later network upgrade and expansion. Assume
that two more servers need to be added to VLAN 4 and VLAN 4 does not want to
change the assigned IP addresses, and the addresses after 10.1.1.24 has been
assigned to others, a new subnet with the mask length as 29 bits and a new VLAN
need to be assigned for the new customers of VLAN 4. Therefore, the customers of
VLAN 4 have only three servers, but the customers are assigned to two subnets
and are not in the same VLAN. As a result, this is inconvenient for network
management.
In above, many IP addresses are used as the addresses of subnets, directional
broadcast addresses of subnets, and default addresses of network gateways of
subnets. These IP addresses cannot be used as the server addresses in the VLAN.
The limit on address assignation reduces the addressing flexibility, so that many
idle addresses are wasted. To solve this problem, VLAN aggregation is used.
Principle
The VLAN aggregation technology, also known as the super-VLAN, provides a
mechanism that partitions the broadcast domain using multiple VLANs in a
physical network so that different VLANs can belong to the same subnet. In VLAN
aggregation, two concepts are involved, namely, super-VLAN and sub-VLAN.
● Super-VLAN: It is different from the common VLAN. In the super-VLAN, only
Layer 3 interfaces are created and physical ports are not contained. The super-
VLAN can be viewed as a logical Layer 3 concept. It is a collection of many
sub-VLANs.
● Sub-VLAN: It is used to isolate broadcast domains. In the sub-VLAN, only
physical ports are contained and Layer 3 VLANIF interfaces cannot be created.
The Layer 3 switching with the external network is implemented through the
Layer 3 interface of the super-VLAN.
A super-VLAN can contain one or more sub-VLANs retaining different broadcast
domains. The sub-VLAN does not occupy an independent subnet segment. In the
same super-VLAN, IP addresses of servers belong to the subnet segment of the
super-VLAN, regardless of the mapping between servers and sub-VLANs.
The same Layer 3 interface is shared by sub-VLANs. Some subnet IDs, default
gateway addresses of the subnets, and directed broadcast addresses of the
subnets are saved and different broadcast domains can use the addresses in the
same subnet segment. As a result, subnet differences are eliminated, addressing
becomes flexible and idle addresses are reduced.
Table 5-4 is used to explain the implementation. Suppose that user demands are
unchanged. In VLAN 2, 10 server addresses are demanded; in VLAN 3, five server
addresses are demanded; in VLAN 4, one server address is demanded.
According to the implementation of VLAN aggregation, create VLAN 10 and
configure VLAN 10 as a super-VLAN. Then assign a subnet address 10.1.1.0/24
with the mask length being 24 to VLAN 10; 10.1.1.0 is the subnet ID and 10.1.1.1
is the gateway address of the subnet, as shown in Figure 5-11. Address
assignments of sub-VLANs (VLAN 2, VLAN 3, and VLAN 4) are shown in Table
5-5.
L3 Switch
Super VLAN 10
VLANIF10:10.1.1.1/24
Table 5-5 Example for assigning Server addresses in VLAN aggregation mode
VLAN Subnet Gateway Number of Number of Practical
address available available requirement
addresses servers s
3 5 10.1.1.12-10.1.1. 5
16
4 1 10.1.1.17 1
(10.1.1.2 to 10.1.1.17). A total of 19 IP addresses are used, that is, the 16 server
addresses together with the subnet ID (10.1.1.0), the default gateway of the
subnet (10.1.1.1), and the directed broadcast address of the subnet (10.1.1.255). In
the network segment, 236 addresses (255 - 19 = 236) are available, which can be
used by any server in the sub-VLAN.
Super-VLAN 4
VLANIF 4
IP:10.10.10.3/24
MAC:3-3-3
VLAN 3 VLAN 2
Sub-VLAN 3 Sub-VLAN 2
HostA HostB
IP:10.10.10.1/24 IP:10.10.10.2/24
MAC:1-1-1 MAC:2-2-2
You can enable inter-VLAN proxy ARP on VLANIF 4 of the Switch to solve this
problem.
a. Host A sends an ARP Request packet for the MAC address of Host B.
b. After receiving the ARP Request packet, the Switch detects that the
destination IP address is not its IP address and determines that the
requested MAC address is not its MAC address. The Switch then checks
whether there is an ARP entry of Host B.
Internet
Switch2
Port1 VLAN Trunk all
Port3 VLAN Trunk all
Switch1
Port1 Port2
Super VLAN 10
VLANIF10:10.1.1.1/24
VLAN 2 VLAN 3
Server A Server B
10.1.1.2/24 10.1.1.3/24
The frame that accesses Switch1 through Port1 on Server A is tagged with the
ID of VLAN 2. The VLAN ID, however, is not changed to the ID of VLAN 10 on
Switch1 even if VLAN 2 is the sub-VLAN of VLAN 10. After passing through
Port3, which is the trunk type, this frame still carries the ID of VLAN 2.
That is, Switch1 itself does not send the frames of VLAN 10. In addition,
Switch1 discards the frames of VLAN 10 that are sent to Switch1 by other
devices because Switch1 has no corresponding physical port for VLAN 10.
A super-VLAN has no physical port. This limitation is obligatory, as shown
below:
– If you configure the super-VLAN and then the trunk interface, the frames
of a super-VLAN are filtered automatically according to the VLAN range
set on the trunk interface.
As shown in Figure 5-13, no frame of the super-VLAN 10 passes through
Port3 on Switch1, even though the interface allows frames from all
VLANs to pass through.
– If you finish configuring the trunk interface and allow all VLANs to pass
through, you still cannot configure the super-VLAN on Switch1. The root
cause is that any VLAN with physical ports cannot be configured as the
super-VLAN, and the trunk interface allows only the frames tagged with
VLAN IDs to pass through. Therefore, no VLAN can be configured as a
super-VLAN.
As for Switch1, the valid VLANs are just VLAN 2 and VLAN 3, and all frames
are forwarded in these VLANs.
● Layer 3 communication between a sub-VLAN and an external network
Super VLAN 4
VLANIF4:10.1.1.1/24
VLAN 2 VLAN 3
Server A Server B
10.1.1.2/24 10.1.1.3/24
Basic Concepts
As shown in Table 5-6, a MUX VLAN is classified into principal VLANs and
subordinate VLANs; a subordinate VLAN is classified into separate VLANs and
group VLANs.
Internet
Principal Port
Switch
On an aggregation device, you can create a VLANIF interface for the principal
VLAN. The IP address of the VLANIF interface can be used as the gateway address
of a server. As shown in Figure 5-16, MUX VLAN is configured on aggregation
switch Switch1 to implement isolation or interworking.
Internet
VLAN2
(Principal VLAN)
Switch1
If the device works as the gateway or provides the snooping functions for only
some VLANs, the device does not need to process protocol packets in other VLANs.
After the protocol packets in other VLANs are sent to the CPU, the CPU needs to
forward them to other devices. This mechanism is called software forwarding.
Switch
User A User A
VLAN 10 VLAN 10
Switch A
Trunk Link
L2 Switch
As shown in Figure 5-19, if VLAN 2, VLAN 3, and VLAN 4 only belong to SwitchA,
you can configure a VLANIF interface for each VLAN on SwitchA to implement the
communications between these VLANs.
As shown in Figure 5-20, VLAN 2, VLAN 3, and VLAN 4 are VLANs across different
switches. In such a situation, you can configure a VLANIF interface respectively on
Switch A and Switch B for each VLAN, and then configure a static route or run a
routing protocol between Switch A and Switch B.
Network
Switch
Proxy ARP
As shown in Figure 5-21, four VLANs, namely, VLAN 21, VLAN 22, VLAN 31, and
VLAN 32, are configured. If these VLANs need to communicate with each other,
you should configure an IP address for each VLAN on the Switch.
Alternatively, you can enable VLAN aggregation to aggregate VLAN 21 and VLAN
22 into super VLAN 2, and VLAN 31 and VLAN 32 into super VLAN 3. Therefore,
you can save IP addresses by only assigning IP addresses to the super VLANs.
After Proxy ARP is configured on Switch, the sub-VLANs in each super VLAN can
communicate with each other.
Licensing Requirements
VLAN is a basic function of the switch, and as such is controlled by the license for
basic software functions. The license for basic software functions has been loaded
and activated before delivery. You do not need to manually activate it.
Version Requirements
CE8860EI V100R006C00
CE8861EI/CE8868EI V200R005C10
CE8850-32CQ-EI V200R002C50
CE8850-64CQ-EI V200R005C00
CE7850EI V100R003C00
CE7855EI V200R001C00
CE6810EI V100R003C00
CE6810-32T16S4Q-LI, V100R005C10
CE6810-24S2Q-LI
CE6850EI V100R001C00
CE6850-48S6Q-HI V100R005C00
CE6855HI V200R001C00
CE6856HI V200R002C50
CE6857EI V200R005C10
CE6860EI V200R002C50
CE6865EI V200R005C00
CE6870-24S6CQ-EI V200R001C00
CE6870-48S6CQ-EI V200R001C00
CE6870-48T6CQ-EI V200R002C50
CE6875-48S4CQ-EI V200R003C00
CE6880EI V200R002C50
CE5810EI V100R002C00
CE5850EI V100R001C00
CE5850HI V100R003C00
CE5855EI V100R005C10
CE5880EI V200R005C10
NOTE
For details about the mapping between software versions and switch models, see the
Hardware Query Tool.
▪ These reserved VLANs take effect without requiring the restart of the
switch. You can configure a maximum of eight reserved VLAN ranges
for Layer 3 main interfaces. The reserved VLAN ranges specified
using the vlan reserved for main-interface startvlanid to endvlanid
command multiple times cannot overlap.
Default VLAN ID 1
Damping time 0s
Procedure
Step 1 Run system-view
Step 2 (Optional) Run vlan assign { global | local } { vlan-id1 [ to vlan-id2 ] } &<1-5>
NOTE
CE5800 series switches excluding CE5880EI, CE6810EI, CE6810LI, and CE6850EI do not support
this command.
forwarder. To prevent VLAN conflicts on the SDN controller and forwarder and
reduce maintenance costs, run the vlan assign command to configure VLAN
assignment.
● global: After VLANs are assigned globally, the VLAN created by the vlan vlan-
id command must be in the allocated VLAN range.
● local: After VLANs are assigned locally, the VLANs allowed by all interfaces
must be in the allocated VLAN range.
Step 3 (Optional) Run vlan reserved vlan-id
A reserved VLAN is configured.
By default, the reserved VLAN ID ranges from 4064 to 4094. After vlan-id is
specified, the VLAN specified by vlan-id to the VLAN specified by vlan-id plus 30
are configured as reserved VLANs.
NOTE
NOTE
When multiple VLANs are created on a switch, you are advised to configure names for the
VLANs to facilitate management.
Run the name vlan-name command in the VLAN view to create a VLAN name. After the
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 7 Add the Ethernet interface to a VLAN. By default, the VLAN and default VLAN that
an interface joins are both VLAN 1.
Run the following command as required.
● Access or QinQ interface
Run the port default vlan vlan-id command to add the interface to the
specified VLAN.
Run the port interface-type { interface-number1 [ to interface-number2 ] }
&<1-10> command in the VLAN view to add one interface or a group of
interfaces to a VLAN.
● Trunk interface
– Run the port trunk allow-pass vlan { { vlan-id1 [ to vlan-id2 ] }
&<1-40> | all } command to add the interface to the specified VLAN.
– (Optional) Run the port trunk pvid vlan vlan-id command to configure
the default VLAN of the trunk interface.
● Hybrid interface
– Run the following command as required.
----End
Context
NOTE
The switch enabled with MAC address-based VLAN assignment cannot process protocol
packets sent to the CPU, and it is recommended that MAC address-based VLAN assignment
be used in Layer 2 transparent transmission scenarios.
VLANs configured based on MAC addresses process only untagged frames, and
treat tagged frames in the same manner as VLANs configured based on ports.
After receiving an untagged frame, a port searches for a MAC-VLAN mapping
based on the source MAC address in the frame.
● If a mapping is found, the port forwards the frame based on the VLAN ID and
priority value in the mapping.
● If no matching mapping is found, the port matches the frame with other
matching rules.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 (Optional) Run vlan assign global { vlan-id1 [ to vlan-id2 ] } &<1-5>
VLANs that can be globally assigned are specified.
NOTE
CE5800 series switches excluding CE5880EI, CE6810EI, CE6810LI, and CE6850EI do not support
this command.
After VLANs are assigned, the VLANs created using the vlan vlan-id command
must be within the assignable VLAN range.
Step 3 (Optional) Run vlan reserved vlan-id
A reserved VLAN is configured.
By default, the reserved VLAN ID ranges from 4064 to 4094. After vlan-id is
specified, the VLAN specified by vlan-id to the VLAN specified by vlan-id plus 30
are configured as reserved VLANs.
NOTE
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.
NOTE
● For CE6870EI and CE6875EI, MAC address-based VLAN assignment cannot be used with
port security or MAC address limiting on the same interface.
● When MAC address-based VLAN assignment is used, the priority of packets with the
VLAN ID of 0 cannot be modified.
● When MAC address-based assignment is configured on the CE6870EI and CE6875EI,
running the mac-vlan enable or undo mac-vlan enable command may cause few
packets to be discarded. Exercise caution when you run this command.
----End
IP subnet-based assignment allows users to easily join a VLAN, transfer from one
VLAN to another, and exit from a VLAN. IP subnet-based VLAN assignment is
applicable to networks that have traveling users and require simple management.
The switch enabled with IP subnet-based VLAN assignment processes only
untagged frames. After receiving untagged frames, the switch determines the
VLANs to which the frames belong based on their source IP addresses and
network segment addresses before sending them to corresponding VLANs.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 (Optional) Run vlan assign global { vlan-id1 [ to vlan-id2 ] } &<1-5>
VLANs that can be globally assigned are specified.
NOTE
CE5800 series switches excluding CE5880EI, CE6810EI, CE6810LI, and CE6850EI do not support
this command.
After VLANs are assigned, the VLANs created using the vlan vlan-id command
must be within the assignable VLAN range.
Step 3 (Optional) Run vlan reserved vlan-id
A reserved VLAN is configured.
By default, the reserved VLAN ID ranges from 4064 to 4094. After vlan-id is
specified, the VLAN specified by vlan-id to the VLAN specified by vlan-id plus 30
are configured as reserved VLANs.
NOTE
NOTE
If the switch 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.
The CE5810EI and CE5855EI support 256 subnets, the CE6870EI and CE6875EI
support 16 subnets, and other models support 512 subnets. The IP subnet or the
IP address associated with a VLAN cannot be a multicast network segment or
multicast address.
NOTE
----End
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 (Optional) Run vlan assign global { vlan-id1 [ to vlan-id2 ] } &<1-5>
VLANs that can be globally assigned are specified.
NOTE
CE5800 series switches excluding CE5880EI, CE6810EI, CE6810LI, and CE6850EI do not support
this command.
After VLANs are assigned, the VLANs created using the vlan vlan-id command
must be within the assignable VLAN range.
Step 3 (Optional) Run vlan reserved vlan-id
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.
Manually configuring and maintaining VLANs is challenging on a large Layer 2 network.
Configuration inconsistency may occur. To improve maintenance efficiency and simplify
configuration, run the vlan range { vlan-id1 [ to vlan-id2 ] } &<1-10> command to create a
temporary VLAN range and configure services in the VLAN range view. Services are then
delivered in batches to all the VLANs in the VLAN range.
Step 5 Run protocol-vlan [ protocol-index ] { at | ipv4 | ipv6 | ipx { ethernetii | llc | raw
| snap } | mode { ethernetii-etype etype-id1 | llc dsap dsap-id ssap ssap-id |
snap-etype etype-id2 } }
Protocols are associated with VLANs and a protocol profile is specified.
● protocol-index specifies the index of a protocol profile.
A protocol profile depends on protocol types and encapsulation formats, and
a VLAN associated with a protocol can be defined in a protocol profile.
● When specifying the source and destination service access points, pay
attention to the following points:
– dsap-id and ssap-id cannot be both set to 0xaa.
– dsap-id and ssap-id cannot be both set to 0xe0. 0xe0 indicates llc,
encapsulation format of IPX packets.
– dsap-id and ssap-id cannot be both set to 0xff. 0xff indicates raw,
encapsulation format of IPX packets.
Step 6 Run quit
The system view is displayed.
Step 7 Configure attributes for the Ethernet interface.
1. Run interface interface-type interface-number
The view of the interface that allows the protocol-based VLAN is displayed.
----End
Procedure
● Run the display vlan reserved command to view information about reserved
VLANs.
● Run the display port vlan [ interface-type interface-number ] [ active ]
command to view information about interfaces of the VLAN.
● Run the display vlan command to check information about all VLANs or a
specified VLAN.
● Run the display mac-vlan { mac-address { all | mac-address } | vlan vlan-id }
command to check information about VLANs configured based on MAC
addresses.
● Run the display ip-subnet-vlan vlan { all | vlan-id1 [ to vlan-id2 ] }
command to check information about IP subnet associated with VLANs.
● Run the display protocol-vlan vlan { all | vlan-id1 [ to vlan-id2 ] } command
to check the types and indexes of the protocols associated with VLANs.
● Run the display protocol-vlan interface { all | interface-type interface-
number } command to check information about VLANs configured based on
protocols associated with ports.
----End
Pre-configuration Tasks
Before creating a VLANIF interface, complete the following tasks:
● Create a VLAN.
● Associate the VLAN with the physical interface.
NOTE
To implement communication between VLANs, hosts in each VLAN must use the IP address
of the corresponding VLANIF interface as the gateway address.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 (Optional) Run set shutdown default vlanif
A VLANIF interface is Up only when at least one physical port added to the
corresponding VLAN is Up.
The delay-time value ranges from 0 to 20, in seconds. By default, the delay is 0
seconds, indicating that VLAN damping is disabled.
NOTE
● The MTU refers to the maximum length of the Layer 3 IP header and subsequent data
frames, excluding the Layer 2 frame header.
● The mtu value plus the Layer 2 frame header of a VLANIF interface must be smaller
than the jumboframe value of the peer interface; otherwise, some packets may be
discarded.
----End
Context
Users belong to different VLANs and are located on different network segments
can communicate with each other by configuring Layer 3 sub-interfaces.
NOTE
To implement communication between VLANs, hosts in each VLAN must use the IP address
of the corresponding Layer 3 sub-interface as the gateway address.
NOTE
Procedure
Step 1 Run system-view
The mode switching function takes effect when the interface only has attribute
configurations (for example, shutdown and description configurations).
Alternatively, if configuration information supported by both Layer 2 and Layer 3
interfaces exists (for example, mode lacp and lacp system-id configurations), no
configuration that is not supported after the working mode of the interface is
switched can exist. If unsupported configurations exist on the interface, delete the
configurations first and then run the undo portswitch command.
NOTE
If many Ethernet interfaces need to be switched to Layer 3 mode, run the undo portswitch
batch interface-type { interface-number1 [ to interface-number2 ] } &<1-10> command in
the system view to switch these interfaces to Layer 3 mode in batches.
----End
Procedure
● Run the display vlan [ vlan-id1 [ to vlan-id2 ] | vlan-name vlan-name |
summary ] command to check information about all VLANs or a specified
VLAN.
● Run the display interface vlanif [ vlan-id ] command to check information
about VLANIF interfaces.
Before running this command, ensure that VLANIF interfaces have been
configured.
----End
Context
In VLAN aggregation, a sub-VLAN can contain only physical interfaces (it cannot
contain VLANIF interfaces). All the interfaces in a sub-VLAN use the same IP
address of the VLANIF interface associated with the super-VLAN. VLAN
aggregation reduces the number of subnet IDs, subnet default gateway addresses,
and directed broadcast IP addresses needed on the network segment and ensures
that IP addresses are assigned efficiently. VLAN aggregation allows each sub-
VLAN to function as a broadcast domain to implement broadcast isolation and
saves IP address resources.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run vlan vlan-id
A sub-VLAN is created and the sub-VLAN view is displayed.
NOTE
If a device is configured with multiple VLANs, it is recommended that you configure a name for
each VLAN.
To do so, run the name vlan-name command in the VLAN view. After a VLAN name is
configured, run the vlan vlan-name vlan-name command in the system view to enter the
corresponding VLAN view.
----End
Prerequisites
Before configuring a super-VLAN, ensure that sub-VLANs have been configured.
Context
A super-VLAN consists of several sub-VLANs. A VLANIF interface can be configured
for the super-VLAN and assigned an IP address (no physical interface can be
added to a super-VLAN).
Procedure
Step 1 Run system-view
A super-VLAN is created.
Before adding sub-VLANs to a super-VLAN, ensure that these sub-VLANs are not
configured with VLANIF interfaces.
----End
Context
The IP address of the VLANIF interface of a super-VLAN must contain the subnet
segments where users in sub-VLANs reside. All the sub-VLANs use the IP address
of the VLANIF interface of the super-VLAN, saving IP addresses.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run interface vlanif vlan-id
A VLANIF interface is created for a super-VLAN, and the view of the VLANIF
interface is displayed.
Step 3 Run ip address ip-address { mask | mask-length } [ sub ]
An IP address is assigned to the VLANIF interface.
Step 4 Run commit
The configuration is committed.
----End
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run interface vlanif vlan-id
The view of the VLANIF interface of the super-VLAN is displayed.
----End
Context
Specifying an IP address range for users in a sub-VLAN filters out unauthorized
users of which IP addresses are beyond the range.
After configuring an IP address pool for a sub-VLAN, note the following points:
● Only packets with IP addresses in the IP address pool are processed in the
sub-VLAN. The packets include ARP Request packets, ARP Reply packets, and
ARP proxy packets. Packets with IP addresses beyond the IP address pool are
discarded.
NOTE
If the sub-VLAN and DHCP address pools are used together, ensure that the range of the
sub-VLAN address pool covers the range of the DHCP address pool. Or, do not use the sub-
VLAN and DHCP address pools together.
● Only entries mapping IP addresses in the IP address pool are learned in the
sub-VLAN.
Procedure
Step 1 Run system-view
----End
NOTE
Pre-configuration Tasks
Before configuring a MUX VLAN, complete the following task:
● Creating VLANs
Context
Ports added to a principal VLAN can communicate with every port in the MUX
VLAN.
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 (VLANs 4064 to 4094 are default reserved
VLANs. You can run the vlan reserved command to configure the reserved VLAN
range). 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.
The VLAN ID assigned to a principal VLAN can no longer be used to configure the
VLANIF interface, Super-VLAN, Sub-VLAN, VLAN Mapping, VLAN Stacking.
----End
Context
A VLAN associated with a group port is called a group VLAN. Group ports in a
group VLAN can communicate with each other.
Procedure
Step 1 Run system-view
The VLAN ID assigned to a group VLAN can no longer be used to configure the
VLANIF interface, Super-VLAN, Sub-VLAN, VLAN Mapping, VLAN Stacking.
----End
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run vlan vlan-id
The view of a created principal VLAN is displayed.
Step 3 Run subordinate separate vlan-id
A separate VLAN is configured for a subordinate VLAN.
Only one separate VLAN can be configured for a principal VLAN.
Group VLANs and separate VLANs in one MUX VLAN cannot use the same VLAN
ID.
The VLAN ID assigned to a separate VLAN can no longer be used to configure the
VLANIF interface, Super-VLAN, Sub-VLAN, VLAN Mapping, VLAN Stacking.
Step 4 Run commit
The configuration is committed.
----End
Context
After the MUX VLAN function is enabled on a port, the principal VLAN and
subordinate VLAN can communicate with each other; ports in a group VLAN can
communicate with each other; ports in a separate VLAN cannot communicate with
each other.
Pre-configuration Tasks
Before enabling the MUX VLAN function on a port, complete the following task:
● Adding the port to a principal or subordinate VLAN as an access, hybrid, or
trunk interface
Procedure
Step 1 Run system-view
The system view is displayed.
NOTE
● Access interfaces can be added to only one MUX VLAN group. Trunk and hybrid
interfaces can be added to multiple MUX VLAN groups. An interface can be added to a
maximum of 32 MUX VLAN groups.
● The interface enabled with the MUX VLAN function cannot be added to other VLANs of
the MUX VLAN group.
● Disabling MAC address learning or limiting the number of learned MAC addresses on an
interface affects the MUX VLAN function on the interface.
● The MUX VLAN and port security functions cannot be enabled on the same interface.
● In a cascading scenario, the MUX VLAN cannot be enabled between interfaces
connecting access and aggregation devices.
----End
Context
Management VLAN (mVLAN) configuration allows users to use the VLANIF
interface of the mVLAN to log in to the management switch to centrally manage
devices. To use a network management system to manage multiple devices, create
a VLANIF interface on each device and configure a management IP address for the
VLANIF interface. You can then log in to a device and manage it using its
management IP address. If a user-side interface is added to the VLAN, users
connected to the interface can also log in to the device. This brings security risks
to the device.
Pre-configuration Tasks
Before creating a VLANIF interface, complete the following tasks:
● Create a VLAN.
● Associate the VLAN with the physical interface.
Procedure
Step 1 Run system-view
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.
An mVLAN is configured.
After assigning an IP address to the VLANIF interface, you can run the stelnet
command to log in to a management switch to manage attached devices.
----End
Context
If the device is a gateway of some VLANs or snooping functions are deployed in
some VLANs, the device does not need to process protocol packets in other VLANs.
After the protocol packets in other VLANs are sent to the CPU, the CPU needs to
forward them to other devices. This mechanism is called software forwarding.
Software forwarding affects the forwarding speed and efficiency of protocol
packets because protocol packets need to be processed.
To address this issue, deploy transparent transmission of protocol packets in
VLANs where protocol packets do not need to be processed. This function enables
the device to transparently transmit the protocol packets in the VLANs to other
devices, which improves the forwarding speed and efficiency.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run vlan vlan-id
The VLAN view is displayed.
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.
NOTE
----End
Context
All packets sent from user devices are untagged, so user-side interfaces on a
switch does not receive tagged packets, and the interface must be configured as
an access interface. If a user connects a switch to a user-side interface without
permission, the user-side interface may receive tagged packets. To prevent
unauthorized access, you can configure the user-side interface to discard incoming
tagged packets.
Only interfaces that are connected to user devices and do not receive tagged
packets can be configured to discard incoming tagged packets.
Procedure
Step 1 Run system-view
----End
Context
NOTE
● After a hash mode of the VLAN-XLATE table is configured, you must restart the device to
make the configuration take effect.
● Only the CE6850HI, CE6851HI, CE6855HI, CE6856HI, CE6850U-HI, CE6855HI, CE6857EI,
CE6860EI, CE6865EI, CE7800 series, and CE8800 series switches support this function.
Procedure
Step 1 Run system-view
Step 2 Run assign forward vlan-xlate { egress | ingress } hash { crc16-lower | crc16-
upper | crc32-lower | crc32-upper | lsb }
By default, the uplink and downlink hash modes of the VLAN-XLATE table are
both crc32-lower.
----End
Context
You can enable traffic statistics collection on a VLAN or on a VLANIF interface to
monitor VLAN traffic.
Procedure
● Configure traffic statistics collection in a VLAN.
a. Run the system-view command to enter the system view.
b. Run the vlan vlan-id command to enter the VLAN view.
c. In the VLAN view, run the statistics enable command to enable traffic
statistics collection in a VLAN.
By default, traffic statistics collection is disabled in a VLAN.
NOTE
If the forwarding mode on a CE5880EI or CE6880EI switch is cut through, the switch
cannot collect traffic statistics in a VLAN.
Traffic statistics collection in a VLAN and traffic statistics collection on a Layer 2 sub-
interface are mutually exclusive on the CE6870EI and CE6875EI.
d. Run the commit command to commit the configuration.
● Configure traffic statistics collection on a VLANIF interface.
NOTE
Follow-up Procedure
● Run the display vlan vlan-id statistics command in any view to check traffic
statistics in a specified VLAN.
● Run the display interface vlanif [ vlan-id ] command in any view to check
traffic statistics on a VLANIF interface.
Context
If you want to collect traffic statistics for a specified time on an interface, you
must first clear existing statistics on the interface.
NOTICE
Statistics about VLAN packets cannot be restored after you clear it. So, confirm the
action before you use the command.
To clear the statistics of VLAN packets, run the following reset vlan statistics
command in the user view:
Procedure
● Run the reset vlan vlan-id statistics command to clear the packets of the
specified VLAN statistics.
----End
Context
Similar to IP ping, GMAC ping efficiently detects and locates Ethernet faults and
monitors link quality.
NOTE
Procedure
Step 1 Run the system-view command to enter the system view.
Step 2 Run the ping mac enable command to globally enable GMAC ping.
By default, GMAC ping is disabled.
After GMAC ping is enabled on the device, the device can ping the remote device
and respond to the received GMAC ping packets.
Step 3 Run the commit command to commit the configuration.
Step 4 Run the ping mac mac-address vlan vlan-id [ interface interface-type interface-
number | -c count | -s packetsize | -t timeout ] * command to perform GMAC ping
to check connectivity of the link between the local device and the remote device.
----End
Context
Similar to IP traceroute, GMAC trace efficiently detects and locates Ethernet faults
and monitors the link quality.
NOTE
Procedure
Step 1 Configure the devices at both ends of a link and an intermediate device.
Perform the following operations on the devices at both ends of the link to be
tested and intermediate device.
1. Run the system-view command to enter the system view.
2. Run the trace mac enable command to globally enable GMAC trace.
By default, GMAC trace is disabled.
After GMAC ping is enabled on the device, the device can ping the remote
device and respond to received GMAC ping packets.
3. Run the commit command to commit the configuration.
Step 2 Perform GMAC trace.
Perform the following operations on the device at one end of the link to be tested.
1. Run the system-view command to enter the system view.
2. Run the trace mac mac-address vlan vlan-id [ interface interface-type
interface-number | -t timeout ]* command to locate a connectivity fault
between the local device and the remote device.
----End
Networking Requirements
In Figure 5-22, multiple user terminals are connected to switches in a data center.
Users who use the same service all access the network using different devices.
Configure the switch with port-based VLAN assignment and add ports connected
to users who use the same service to the same VLAN. This way, users who use the
same services can directly communicate, but users using different services cannot
communicate over Layer 2.
Configuration Roadmap
1. Create VLANs and add ports connected to users using different services to
different VLANs to isolate Layer 2 traffic.
2. Configure the type of link between SwitchA and SwitchB and VLANs to allow
users who use the same service to communicate.
Procedure
Step 1 Create VLAN2 and VLAN3 on SwitchA, and add ports connecting to user terminals
to different VLANs. Configuration of SwitchB is the same as that of SwitchA.
<HUAWEI> system-view
[~HUAWEI] sysname SwitchA
[*HUAWEI] commit
[~SwitchA] vlan batch 2 3
[*SwitchA] interface 10ge 1/0/1
[*SwitchA-10GE1/0/1] port default vlan 2
[*SwitchA-10GE1/0/1] quit
[*SwitchA] interface 10ge 1/0/2
[*SwitchA-10GE1/0/2] port default vlan 3
[*SwitchA-10GE1/0/2] quit
[*SwitchA] commit
Step 2 Configure the type of the port connected to SwitchB on SwitchA and the allowed
VLANs. The configuration of SwitchB is the same as that of SwitchA.
Add User1 and User2 to the same IP address segment, for example,
192.168.100.0/24. Add User3 and User4 to the same IP address segment, for
example, 192.168.200.0/24.
Only User1's and User2's terminals can ping each other. Only User3's and User4's
terminals can ping each other.
----End
Configuration Files
● Configuration file of SwitchA
#
sysname SwitchA
#
vlan batch 2 to 3
#
interface 10GE1/0/1
port default vlan 2
#
interface 10GE1/0/2
port default vlan 3
#
interface 10GE1/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 3
#
return
Figure 5-23 Networking diagram for assigning VLANs based on MAC addresses
Enterprise
network
10GE1/0/1
Switch
Configuration Roadmap
1. Create VLANs and determine which VLAN the users of employees belong to.
2. Add Ethernet interfaces to VLANs so that packets from the VLANs can pass
through the interfaces.
3. Associate MAC addresses of User1, User2, and User3 with the specified VLAN
so that the VLAN of the packet can be determined based on the source MAC
address.
Procedure
Step 1 Configure the Switch.
# Create VLANs.
<HUAWEI> system-view
[~HUAWEI] sysname Switch
[*HUAWEI] commit
[~Switch] vlan batch 10
[*Switch] commit
# Associate MAC addresses of User1, User2, and User3 with VLAN 10.
[~Switch] vlan 10
[~Switch-vlan10] mac-vlan mac-address 22-22-22
[*Switch-vlan10] mac-vlan mac-address 33-33-33
[*Switch-vlan10] mac-vlan mac-address 44-44-44
[*Switch-vlan10] quit
[*Switch] commit
----End
Configuration Files
Configuration file of the Switch
#
sysname Switch
#
vlan batch 10
#
vlan 10
mac-vlan mac-address 0022-0022-0022
mac-vlan mac-address 0033-0033-0033
mac-vlan mac-address 0044-0044-0044
#
interface 10GE1/0/1
port link-type hybrid
port hybrid tagged vlan 10
#
interface 10GE1/0/2
port link-type hybrid
port hybrid untagged vlan 10
mac-vlan enable
#
interface 10GE1/0/3
port link-type hybrid
port hybrid untagged vlan 10
mac-vlan enable
#
interface 10GE1/0/4
port link-type hybrid
port hybrid untagged vlan 10
mac-vlan enable
#
return
NOTE
Production
Campus center Disaster
office recovery
network center
RouterB
RouterA 10GE1/0/3 RouterC
10GE1/0/2 10GE1/0/4
Switch
10GE1/0/5 10GE1/0/7
10GE1/0/6
Configuration Roadmap
1. Create VLANs and determine which VLAN each service belongs to.
2. Associate IP subnets with VLANs so that VLANs of packets can be determined
based on the source IP addresses or specified network segments.
3. Add interfaces to VLANs so that packets of the IP subnet-based VLANs can
pass through the interfaces.
4. Enable IP subnet-based VLAN assignment.
Procedure
Step 1 Create VLANs.
# Create VLAN 100, VLAN 200, and VLAN 300 on the Switch.
<HUAWEI> system-view
[~HUAWEI] sysname Switch
[*HUAWEI] commit
[~Switch] vlan batch 100 200 300
[*Switch] commit
# Set the link type of 10GE1/0/5, 10GE1/0/6, and 10GE1/0/7 to hybrid and add it
to VLAN 100, VLAN 200, and VLAN 300 respectively in untagged mode. And
enable IP subnet-based VLAN assignment on 10GE1/0/5, 10GE1/0/6, and
10GE1/0/7.
[~Switch] interface 10ge 1/0/5
[~Switch-10GE1/0/5] port link-type hybrid
[*Switch-10GE1/0/5] port hybrid untagged vlan 100
[*Switch-10GE1/0/5] ip-subnet-vlan enable
[*Switch-10GE1/0/5] quit
[*Switch] interface 10ge 1/0/6
[*Switch-10GE1/0/6] port link-type hybrid
[*Switch-10GE1/0/6] port hybrid untagged vlan 200
[*Switch-10GE1/0/6] ip-subnet-vlan enable
[*Switch-10GE1/0/6] quit
[*Switch] interface 10ge 1/0/7
[*Switch-10GE1/0/7] port link-type hybrid
[*Switch-10GE1/0/7] port hybrid untagged vlan 300
[*Switch-10GE1/0/7] ip-subnet-vlan enable
[*Switch-10GE1/0/7] quit
[*Switch] commit
The product service, office service, and disaster recovery service can only be
transmitted in the production center, campus office network, and disaster recovery
data center respectively.
----End
Configuration Files
Configuration file of the Switch
#
sysname Switch
#
vlan batch 100 200 300
#
vlan 100
ip-subnet-vlan 1 ip 192.168.1.2 255.255.255.0
#
vlan 200
ip-subnet-vlan 1 ip 192.168.2.2 255.255.255.0
#
vlan 300
ip-subnet-vlan 1 ip 192.168.3.2 255.255.255.0
#
interface 10GE1/0/2
port link-type trunk
port trunk allow-pass vlan 100
device transceiver 10GBASE-COPPER
#
interface 10GE1/0/3
port link-type trunk
port trunk allow-pass vlan 200
device transceiver 10GBASE-COPPER
#
interface 10GE1/0/4
port link-type trunk
port trunk allow-pass vlan 300
device transceiver 10GBASE-COPPER
#
interface 10GE1/0/5
port link-type hybrid
port hybrid untagged vlan 100
ip-subnet-vlan enable
device transceiver 10GBASE-COPPER
#
interface 10GE1/0/6
port link-type hybrid
port hybrid untagged vlan 200
ip-subnet-vlan enable
device transceiver 10GBASE-COPPER
#
interface 10GE1/0/7
port link-type hybrid
port hybrid untagged vlan 300
ip-subnet-vlan enable
device transceiver 10GBASE-COPPER
#
return
Networking Requirements
Users in a company use different services and locate at different network
segments. Users who use the same service belong to different VLANs and they
want to communicate with each other.
In Figure 5-25, User 1 and User 2 use the same service and need to communicate,
but belong to different VLANs and are located on different network segments.
10GE1/0/1 10GE1/0/2
VLANIF10 VLANIF20
10.10.10.2/24 10.10.20.2/24
VLAN 10 VLAN 20
User1 User2
10.10.10.3/24 10.10.20.3/24
Configuration Roadmap
1. Create VLANs on the switches for different users.
2. Add interfaces to VLANs so that packets of the VLANs can pass through the
interfaces.
3. Create VLANIF interfaces and configure IP addresses for the VLANIF interfaces
to implement Layer 3 communication.
NOTE
To implement communication between VLANs, hosts in each VLAN must use the IP address
of the corresponding VLANIF interface as the gateway address.
Procedure
Step 1 Configure the Switch.
# Create VLANs.
<HUAWEI> system-view
[~HUAWEI] sysname Switch
[*HUAWEI] commit
[~Switch] vlan batch 10 20
[*Switch] commit
----End
Configuration Files
Configuration file of the Switch
#
sysname Switch
#
vlan batch 10 20
#
interface Vlanif10
ip address 10.10.10.2 255.255.255.0
#
interface Vlanif20
ip address 10.10.20.2 255.255.255.0
#
interface 10GE1/0/1
port default vlan 10
#
interface 10GE1/0/2
port default vlan 20
#
return
Networking Requirements
A company has many departments that reside on the same network segment. For
security purposes, the company adds different departments to different VLANs.
Users in different departments need to communicate with each other.
Internet
Router
10GE1/0/1 VLAN 10
SwitchB Super-VLAN 4
VLANIF 4:10.1.1.1/24
10GE1/0/5
10GE1/0/5
SwitchA
10GE1/0/1 10GE1/0/3
10GE1/0/2 10GE1/0/4
VLAN2 VLAN3
VLAN 2 VLAN 3
Configuration Roadmap
You can configure VLAN aggregation on SwitchB and add VLANs of different
departments to the super-VLAN so that users in different departments can access
the Internet using the super-VLAN. Proxy ARP can be configured in the super-
VLAN so that users in different departments can communicate with each other.
The configuration roadmap is as follows:
Procedure
Step 1 Configure VLANs and interfaces on SwitchA and SwitchB, add users of different
departments to different VLANs, and configure an interface to transparently
transmit packets to SwitchB.
1. Configure SwitchA.
# Configure 10GE1/0/1 as an access interface. The configurations of
10GE1/0/2 to 10GE1/0/4 are similar to the configuration of 10GE1/0/1, and
are not mentioned here.
<HUAWEI> system-view
[~HUAWEI] sysname SwitchA
[*HUAWEI] commit
[~SwitchA] interface 10ge 1/0/1
[~SwitchA-10GE1/0/1] port link-type access
[*SwitchA-10GE1/0/1] quit
[*SwitchA] commit
# Create VLAN 2 and VLAN 3, add 10GE1/0/1 and 10GE1/0/2 to VLAN 2, and
add 10GE1/0/3 and 10GE1/0/4 to VLAN 3.
[~SwitchA] vlan batch 2 3
[*SwitchA] vlan 2
[*SwitchA-vlan2] port 10ge 1/0/1 1/0/2
[*SwitchA-vlan2] quit
[*SwitchA] vlan 3
[*SwitchA-vlan3] port 10ge 1/0/3 1/0/4
[*SwitchA-vlan3] quit
[*SwitchA] commit
# Configure the interface of SwitchA connected to SwitchB to transparently
transmit packets from VLAN 2 and VLAN 3 to SwitchB.
[~SwitchA] interface 10ge 1/0/5
[~SwitchA-10GE1/0/5] port link-type trunk
[*SwitchA-10GE1/0/5] port trunk allow-pass vlan 2 3
[*SwitchA-10GE1/0/5] quit
[*SwitchA] commit
2. Configure SwitchB.
# Create VLAN 2, VLAN 3, VLAN 4, and VLAN 10, and configure the interface
of SwitchB connected to SwitchA to transparently transmit packets from VLAN
2 and VLAN 3 to SwitchB.
<HUAWEI> system-view
[~HUAWEI] sysname SwitchB
[*HUAWEI] commit
[~SwitchB] vlan batch 2 3 4 10
[*SwitchB] interface 10ge 1/0/5
[*SwitchB-10GE1/0/5] port link-type trunk
[*SwitchB-10GE1/0/5] port trunk allow-pass vlan 2 3
[*SwitchB-10GE1/0/5] quit
[*SwitchB] commit
[~SwitchB] vlan 4
[~SwitchB-vlan4] aggregate-vlan
[*SwitchB-vlan4] access-vlan 2 to 3
[*SwitchB-vlan4] quit
[*SwitchB] commit
# Create and configure VLANIF 4 so that users in different departments can access
the Internet using super-VLAN 4.
[~SwitchB] interface vlanif 4
[*SwitchB-Vlanif4] ip address 10.1.1.1 24
[*SwitchB-Vlanif4] quit
[*SwitchB] commit
# Create and configure VLANIF 10 and specify its IP address of VLANIF 10 as the
IP address for connecting SwitchB and the router.
[~SwitchB] interface vlanif 10
[*SwitchB-Vlanif10] ip address 10.10.1.1 24
[*SwitchB-Vlanif10] quit
[*SwitchB] commit
# On SwitchB, configure a static route to the router so that users can access the
Internet.
[~SwitchB] ip route-static 0.0.0.0 0.0.0.0 10.10.1.2
[*SwitchB] commit
NOTE
Configure the router interface connected to SwitchB and assign to it the IP address of
10.10.1.2. For details, see the router configuration manual.
Configure an IP address for each server. Ensure that the servers reside on the same
network segment as VLAN 4.
After the preceding steps are complete, servers in each department can access the
Internet. However, servers in VLAN 2 and VLAN 3 cannot ping each other. Proxy
ARP needs to be configured on SwitchB.
After the configuration is complete, users in VLAN 2 and VLAN 3 can ping each
other and access the Internet.
----End
Configuration Files
● SwitchA configuration file
#
sysname SwitchA
#
vlan batch 2 to 3
#
interface 10GE1/0/1
port default vlan 2
#
interface 10GE1/0/2
port default vlan 2
#
interface 10GE1/0/3
port default vlan 3
#
interface 10GE1/0/4
port default vlan 3
#
interface 10GE1/0/5
port link-type trunk
port trunk allow-pass vlan 2 to 3
#
return
Networking Requirements
In Figure 5-27, office service servers ServerB, ServerC, ServerD, and ServerE are
deployed on a data center network. All servers can connect to the campus office
network. The data center administrator requires that ServerB should communicate
with ServerC and ServerD should be isolated from ServerE.
To solve the problem, deploy the MUX VLAN on the switch connected to servers,
and connect the principal port to the office network, separate port to servers that
do not need to communicate, and group port to servers that need to
communicate. This saves VLAN IDs on the network and facilitates network
management.
NOTE
Campus
office
network
VLAN2
10GE1/0/1 (Principal VLAN)
Switch
10GE1/0/2 10GE1/0/5
10GE1/0/3 10GE1/0/4
Configuration Roadmap
1. Configure the principal VLAN.
2. Configure the group VLAN.
3. Configure the separate VLAN.
4. Add interfaces to the VLANs and enable the MUX VLAN function.
Procedure
Step 1 Configure a MUX VLAN.
# Create VLAN 2, VLAN 3, and VLAN 4.
<HUAWEI> system-view
[~HUAWEI] sysname Switch
[*HUAWEI] commit
[~Switch] vlan batch 2 3 4
[*Switch] commit
# Configure the Group VLAN and Separate VLAN in the MUX VLAN.
[~Switch] vlan 2
[~Switch-vlan2] mux-vlan
[*Switch-vlan2] subordinate group 3
[*Switch-vlan2] subordinate separate 4
[*Switch-vlan2] quit
[*Switch] commit
# Add interfaces to the VLANs and enable the MUX VLAN function on the
interfaces.
[~Switch] interface 10ge 1/0/1
[~Switch-10GE1/0/1] port default vlan 2
[*Switch-10GE1/0/1] port mux-vlan enable vlan 2
[*Switch-10GE1/0/1] quit
[*Switch] interface 10ge 1/0/2
[*Switch-10GE1/0/2] port default vlan 3
[*Switch-10GE1/0/2] port mux-vlan enable vlan 3
[*Switch-10GE1/0/2] quit
[*Switch] interface 10ge 1/0/3
[*Switch-10GE1/0/3] port default vlan 3
[*Switch-10GE1/0/3] port mux-vlan enable vlan 3
[*Switch-10GE1/0/3] quit
[*Switch] interface 10ge 1/0/4
[*Switch-10GE1/0/4] port default vlan 4
[*Switch-10GE1/0/4] port mux-vlan enable vlan 4
[*Switch-10GE1/0/4] quit
[*Switch] interface 10ge 1/0/5
[*Switch-10GE1/0/5] port default vlan 4
[*Switch-10GE1/0/5] port mux-vlan enable vlan 4
[*Switch-10GE1/0/5] quit
[*Switch] commit
----End
Configuration File
Configuration file of the Switch
#
sysname Switch
#
vlan batch 2 to 4
#
vlan 2
mux-vlan
subordinate separate 4
subordinate group 3
#
interface 10GE1/0/1
port default vlan 2
port mux-vlan enable vlan 2
#
interface 10GE1/0/2
port default vlan 3
port mux-vlan enable vlan 3
#
interface 10GE1/0/3
port default vlan 3
port mux-vlan enable vlan 3
#
interface 10GE1/0/4
port default vlan 4
NOTE
CE5880EI and CE6880EI switches do not support the MUX VLAN function. CE6810LI
switches do not support VLANIF interfaces corresponding to the principal VLAN and sub-
VLAN. They are not applicable to the preceding scenario.
Campus
office
network
Gateway VLANIF2
10GE1/0/1 IP:10.10.10.1/24
10GE1/0/1
VLAN2
Switch1 (Principal VLAN)
10
2 GE
1 /0/ 1/0
1 0 GE /3
1 /0/ 1 10
GE
GE 1/0
10 /1
Switch2 Switch3
10GE1/0/2 10GE1/0/3 10GE1/0/2 10GE1/0/3
Configuration Roadmap
1. Create VLAN 2 to VLAN 4 on Switch1 to Switch3, configure VLAN 2 as the
principal VLAN, VLAN 3 as the subordinate group VLAN, and VLAN 4 as the
subordinate separate VLAN.
2. Connect the gateway to Switch1 through 10GE1/0/1, create VLANIF 2 on the
gateway, configure the IP address 10.10.10.1/24 as the gateway address of
downstream servers.
3. Configure 10GE1/0/1 on Switch2 and Switch3 to allow packets from VLAN 2
to VLAN 4, enable MUX VLAN on the downlink interface, and add the
downlink interface to the VLAN that servers belong to.
Procedure
Step 1 Configure MUX VLAN.
# Create VLAN 2 to VLAN 4 on Switch1, Switch2, and Switch3, and configure
VLAN 2 as the principal VLAN, VLAN 3 as the subordinate group VLAN, and VLAN
4 as the subordinate separate VLAN. Switch1 is used as an example. The
configurations of Switch2 and Switch3 are the same as that of Switch1.
<HUAWEI> system-view
[~HUAWEI] sysname Switch1
[*HUAWEI] commit
[~Switch1] vlan batch 2 3 4
[*Switch1] vlan 2
[*Switch1-vlan2] mux-vlan
[*Switch1-vlan2] subordinate group 3
[*Switch1-vlan2] subordinate separate 4
[*Switch1-vlan2] quit
[*Switch1] commit
# Add 10GE1/0/1 on Switch1 to VLAN 2 and enable MUX VLAN on it, and
configure 10GE1/0/2 and 10GE1/0/3 to allow packets from VLAN 2 to VLAN 4.
[~Switch1] interface 10ge 1/0/1
[~Switch1-10GE1/0/1] port link-type trunk
[*Switch1-10GE1/0/1] port trunk allow-pass vlan 2
[*Switch1-10GE1/0/1] port mux-vlan enable vlan 2
[*Switch1-10GE1/0/1] quit
[*Switch1] interface 10ge 1/0/2
[*Switch1-10GE1/0/2] port link-type trunk
[*Switch1-10GE1/0/2] port trunk allow-pass vlan 2 to 4
[*Switch1-10GE1/0/2] quit
[*Switch1] interface 10ge 1/0/3
[*Switch1-10GE1/0/3] port link-type trunk
[*Switch1-10GE1/0/3] port trunk allow-pass vlan 2 to 4
[*Switch1-10GE1/0/3] quit
[*Switch1] commit
Step 2 Create VLANIF 2 on 10GE1/0/1 connecting the gateway to Switch1, and configure
the IP address 10.10.10.1/24 as the gateway address of downstream servers.
<HUAWEI> system-view
[~HUAWEI] sysname Gateway
[*HUAWEI] commit
[~Gateway] vlan batch 2
[*Gateway] interface 10ge 1/0/1
[*Gateway-10GE1/0/1] port link-type trunk
[*Gateway-10GE1/0/1] port trunk allow-pass vlan 2
[*Gateway-10GE1/0/1] quit
[*Gateway] interface vlanif 2
[*Gateway-Vlanif2] ip address 10.10.10.1 24
[*Gateway-Vlanif2] quit
[*Gateway] commit
NOTE
If the MUX VLAN contains multiple group VLANs and devices in group VLANs need to
communicate, run the arp proxy intra-vlan enable command on the VLANIF interface of
the gateway to configure intra-VLAN proxy ARP.
Step 3 Configure 10GE1/0/1 on Switch2 and Switch3 to allow packets from VLAN 2 to
VLAN 4, enable MUX VLAN on 10GE1/0/2 and 10GE1/0/3, and add the downlink
interfaces to the VLAN that servers belong to. Switch2 is used as an example. The
configuration of Switch3 is the same as that of Switch2.
# Configure 10GE1/0/1 as a trunk interface and configure it to allow packets from
VLAN 2 to VLAN 4.
[~Switch2] interface 10ge 1/0/1
[~Switch2-10GE1/0/1] port link-type trunk
[*Switch2-10GE1/0/1] port trunk allow-pass vlan 2 to 4
[*Switch2-10GE1/0/1] quit
[*Switch2] commit
# Enable MUX VLAN on 10GE1/0/2 and 10GE1/0/3, and add them to the VLAN to
which servers belong.
[~Switch2] interface 10ge 1/0/2
[~Switch2-10GE1/0/2] port default vlan 3
[*Switch2-10GE1/0/2] port mux-vlan enable vlan 3
[*Switch2-10GE1/0/2] quit
[*Switch2] commit
[~Switch2] interface 10ge 1/0/3
[~Switch2-10GE1/0/3] port default vlan 3
[*Switch2-10GE1/0/3] port mux-vlan enable vlan 3
[*Switch2-10GE1/0/3] quit
[*Switch2] commit
----End
Configuration Files
● Gateway configuration file
#
sysname Gateway
#
vlan batch 2
#
interface Vlanif2
ip address 10.10.10.1 255.255.255.0
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 2
#
return
● Switch1 configuration file
#
sysname Switch1
#
vlan batch 2 to 4
#
vlan 2
mux-vlan
subordinate separate 4
subordinate group 3
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 2
port mux-vlan enable vlan 2
#
interface 10GE1/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 4
#
interface 10GE1/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 4
#
return
● Switch2 configuration file
#
sysname Switch2
#
vlan batch 2 to 4
#
vlan 2
mux-vlan
subordinate separate 4
subordinate group 3
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 4
#
interface 10GE1/0/2
port default vlan 3
port mux-vlan enable vlan 3
#
interface 10GE1/0/3
port default vlan 3
port mux-vlan enable vlan 3
#
return
Internet
10GE1/0/2
SwitchB
10GE1/0/1
10GE1/0/3
SwitchA
10GE1/0/1 10GE1/0/2
ServerA ServerB
VLAN10
Configuration Roadmap
1. Allocate the downlink interfaces of SwitchA connected to office servers to
VLAN 10.
2. Enable transparent transmission of protocol packets in a VLAN on SwitchB.
When protocol packets from a specified VLAN reach SwitchB, SwitchB directly
forwards the protocol packets without sending them to the CPU.
Procedure
Step 1 Add the downlink interfaces on SwitchA to VLAN 10 and configure the uplink
interfaces to allow VLAN 10.
<HUAWEI> system-view
[~HUAWEI] sysname SwitchA
[*HUAWEI] commit
[~SwitchA] vlan 10
[*SwitchA-vlan10] quit
[*SwitchA] interface 10ge 1/0/1
[*SwitchA-10GE1/0/1] port default vlan 10
[*SwitchA-10GE1/0/1] quit
[*SwitchA] interface 10ge 1/0/2
[*SwitchA-10GE1/0/2] port default vlan 10
[*SwitchA-10GE1/0/2] quit
[*SwitchA] interface 10ge 1/0/3
[*SwitchA-10GE1/0/3] port link-type trunk
[*SwitchA-10GE1/0/3] port trunk allow-pass vlan 10
[*SwitchA-10GE1/0/3] quit
[*SwitchA] commit
----End
Configuration Files
Configuration file of SwitchA
#
sysname SwitchA
#
vlan batch 10
#
interface 10GE1/0/1
port default vlan 10
#
interface 10GE1/0/2
port default vlan 10
#
interface 10GE1/0/3
port link-type trunk
port trunk allow-pass vlan 10
#
return
#
vlan 10
protocol-transparent
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
interface 10GE1/0/2
port link-type trunk
port trunk allow-pass vlan 10
#
return
Procedure
Step 1 Check whether the interfaces connected to the user terminals are in Up state.
Run the display interface interface-type interface-number command in any view
to check the status of the interfaces.
● If the interface is Down, rectify the interface fault.
● If the interface is Up, go to Step 2.
Step 2 Check whether the IP addresses of user terminals are in the same network
segment.
● If they are in different network segments, change the IP addresses of the user
terminals.
● If they are in the same network segment, go to Step 3
Step 3 Check whether the MAC address entries on the Switch are correct.
Run the display mac-address command on the Switch to check whether the MAC
addresses, interfaces, and VLANs in the learned MAC address entries are correct. If
the learned MAC address entries are incorrect, run the undo mac-address mac-
address vlan vlan-id command on the system view to delete the current entries so
that the Switch can learn MAC address entries again.
After the MAC address table is updated, check the MAC address entries again.
● If the MAC address entries are incorrect, go to Step 4.
● If the MAC address entries are correct, go to Step 5.
Step 4 Check whether the VLAN is properly configured.
● Check the VLAN configuration according to the following table.
Whether the Run the display vlan vlan-id command in any view to
VLAN has been check whether the VLAN has been created. If not, run the
created vlan command in system view to create the VLAN.
Whether the Run the display vlan vlan-id command in any view to
interfaces are check whether the VLAN contains the interfaces. If not,
added to the add the interfaces to the VLAN.
VLAN NOTE
If the interfaces are located on different devices, add the
interfaces connecting the devices to the VLAN.
The default type of a Switch interface is Access. You can run the
port link-type command to change the interface type.
– Add an access interface to the VLAN using either of
the following methods:
1. Run the port default vlan command in the
interface view.
2. Run the port command in the VLAN view.
– Add a trunk interface to the VLAN.
Run the port trunk allow-pass vlan command in the
interface view.
– Add a hybrid interface to the VLAN using either of the
following methods:
1. Run the port hybrid tagged vlan command in the
interface view.
2. Run the port hybrid untagged vlan command in
the interface view.
After the preceding operations, if the MAC address entries are correct, go to
Step 5.
Step 5 Check whether Layer 2 port isolation is configured.
Run the interface interface-type interface-number command in the system view
to enter the interface view, and then run the display this command to check
whether Layer 2 port isolation is configured on the interface.
● If Layer 2 port isolation is not configured, go to Step 6.
● If Layer 2 port isolation is configured, run the undo port-isolate enable
command on the interface to disable port isolation. If the fault persists, go to
Step 6.
Step 6 Check whether the correct static Address Resolution Protocol (ARP) entries are
configured on the user terminals. If the static ARP entries are incorrect, modify
them.
----End
Table 5-11 Common causes and solutions for the VLANIF interface going down
Common Cause Solution
All interfaces added to the VLAN are Rectify the fault. A VLANIF interface is
physically Down. Up as long as an interface in the
corresponding VLAN is Up.
The VLANIF interface is shut down. Run the undo shutdown (interface
view) command in the view of the
VLANIF interface to enable the VLANIF
interface.