01-04 VLAN Configuration
01-04 VLAN Configuration
Switches
Configuration Guide - Ethernet Switching 4 VLAN Configuration
4 VLAN Configuration
Definition
Virtual Local Area Networks (VLANs) are used to divide a physical LAN into
multiple broadcast domains to isolate services with the aim of improving the
security and management of the network.
Purpose
In the early stage, an Ethernet network implements data communication over
shared media based on Carrier Sense Multiple Access with 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.
Figure 4-1 shows a simple VLAN networking environment. Two switches are
deployed in different locations (for example, on different floors of a building).
Each switch is connected to two PCs belonging to different VLANs, which may
belong to different entities or companies.
Benefits
VLANs offer the following benefits:
● Limit the scope of broadcast domains: The scope of broadcast domains is
limited to conserve bandwidth and improve network efficiency.
● Enhance LAN security: Packets from different VLANs are transmitted
separately, preventing hosts in a VLAN from communicating directly with
hosts in another VLAN.
● Improve network robustness: A fault in one VLAN does not affect hosts in
other VLANs.
● Allow for flexible groups: By leveraging VLANs, it is possible to group hosts in
different geographical locations, simplifying network construction and
maintenance.
A VLAN tag contains four fields. Table 4-1 describes the fields.
PRI 3 bits Priority (PRI), indicating the The value is in the range from 0
frame 802.1p priority. to 7. A larger value indicates a
higher priority. If congestion
occurs, the switch sends packets
with higher priorities first.
CFI 1 bit Canonical Format Indicator The value 0 indicates that the
(CFI), indicating whether a MAC address is encapsulated in
MAC address is canonical format, and the value 1
encapsulated in canonical indicates that the MAC address is
format over different encapsulated in non-canonical
transmission media. CFI is format. The CFI field has a fixed
used to ensure compatibility value of 0 on Ethernet networks.
between Ethernet and
token ring networks.
host or another switch). Figure 4-3 shows the access interface, trunk interface,
and hybrid interface.
● Access interface
An access interface often connects to a user terminal such as a user host or
server that cannot identify VLAN tags, or is used when VLANs do not need to
be differentiated. In most cases, access interfaces can only receive and send
untagged frames, and can add only a unique VLAN tag to untagged frames.
The default VLAN must be configured so that access interfaces can add a
VLAN tag to data frames. The access interface is then added to the default
VLAN. If the VLAN ID (VID) and default port VLAN ID (PVID) are the same in
tagged frames, access interfaces can receive and process the tagged frames. If
a user connects a switch to a user-side interface without permission, the user-
side interface may receive tagged frames. To prevent unauthorized access
from such users, you can configure the user-side interface to discard tagged
frames.
● Trunk interface
A trunk interface often connects to a switch, a router, an AP, or a voice
terminal that can receive and send both tagged and untagged frames. It
allows tagged frames from multiple VLANs and untagged frames from only
one VLAN to pass through.
● Hybrid interface
● Trunk and hybrid interfaces allow multiple VLANs but have only one default
VLAN. Changing the allowed VLANs will not change the default VLAN.
NOTE
A QinQ interface adds an additional tag to a tagged frame. For details, see 9 QinQ
Configuration.
Access Interface
Figure 4-4 and Figure 4-5 show how an access interface adds and removes VLAN
tags.
Trunk Interface
Figure 4-6 and Figure 4-7 show how a trunk interface adds and removes VLAN
tags.
Hybrid Interface
Figure 4-8 and Figure 4-9 show how a hybrid interface adds and removes VLAN
tags.
Access Receives an untagged ● Accepts the tagged After the PVID tag
frame and adds a tag frame if the frame's is removed, 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.
Based on the preceding table, an access interface can send only untagged frames;
a trunk interface can send untagged frames of only one VLAN and send tagged
frames of other VLANs; a hybrid interface sends tagged or untagged frames,
depending on the VLAN configuration.
4.2.5 LNP
Definition
Link-type Negotiation Protocol (LNP) dynamically negotiates the link type of an
Ethernet interface. The negotiated link type affects the VLAN the interface joins,
which is described as follows:
● When the link type on an Ethernet interface is negotiated as access, the
interface joins VLAN 1 by default.
● When the link type on an Ethernet interface is negotiated as trunk, the
interface joins a VLAN in the range from VLAN 1 to VLAN 4094 by default.
Background
The switch supports the following link types on an Ethernet interface: access,
hybrid, trunk, and QinQ. The four link types are applicable to different network
deployments and are manually specified. When the network topology changes,
link types of Ethernet interfaces also need to be reconfigured. If this is done
manually, configuration is time-consuming and complex. To simplify configuration,
LNP supports auto-negotiation of the link types on Ethernet interfaces and allows
Ethernet interfaces to join VLANs through auto-negotiation. This eliminates the
need to manually configure link types of Ethernet interfaces, reducing the
workload.
Implementation
When Layer 2 devices on the network shown in Figure 4-10 are successfully
connected, the physical status of their interfaces becomes Up. After LNP
negotiation is complete, user-side interfaces on Switch4, Switch5, Switch6, and
Switch7 join VLAN 1 as access interfaces, and interfaces between switches become
trunk interfaces that allow all VLANs.
● If the two ends of an Eth-Trunk link have different numbers of member interfaces,
the LNP negotiation may fail.
● If the link type of the Layer 2 Ethernet interface is set to access, hybrid, trunk, or
QinQ, LNP negotiation does not take effect on the interface.
● If the negotiation fails, the link type of an interface will be set to access.
address. If the two IP addresses are on different network segments, the frame
needs to be forwarded by the gateway. The source host obtains the gateway's
MAC address, and uses it as the destination MAC address to send the frame
to the gateway.
● Ethernet switching in a switch
The following describes how the switch determines whether to forward a
received frame at Layer 2 or Layer 3 based on the information in the
destination MAC address, VLAN ID, and Layer 3 forwarding bit:
– If the destination MAC address and VLAN ID of the frame match a MAC
address entry of the switch and the Layer 3 forwarding bit is set, the
switch searches for a Layer 3 forwarding entry based on the destination
IP address. If no entry is found, the switch sends the frame to the CPU.
The CPU then searches for a route to forward the frame at Layer 3.
– If the destination MAC address and VLAN ID of the frame match a MAC
address entry but the Layer 3 forwarding bit is not set, the switch directly
forwards the frame from the outbound interface specified in the
matching MAC address entry.
– If the destination MAC address and VLAN ID of the frame do not match
any MAC address entry, the switch broadcasts the frame to all the
interfaces allowing the VLAN specified in the VID to obtain the MAC
address of the destination host.
For details about Layer 2 and Layer 3 switching, see 1.3.1 Layer 2 Switching
and 1.3.2 Layer 3 Switching.
● Adding and removing VLAN tags during the exchange between devices (for
example, between a switch and a user host, another switch, or another
network device)
The switch needs to add or remove VLAN tags according to the interface
setting to communicate with other network devices. For details on how VLAN
tags are added and removed on different types of interfaces, see 4.2.4 Adding
and Removing VLAN Tags.
After VLANs are assigned, broadcast packets are forwarded at Layer 2 in the same
VLAN. That is, users in the same VLAN can directly communicate at Layer 2. There
are two intra-VLAN communication scenarios depending on whether hosts in the
same VLAN connect to the same or multiple switches.
Among the interfaces that have been added to a VLAN, broadcast packets can be
sent to unauthenticated interfaces.
between the source MAC address, VLAN ID, and interface (1-1-1, 2, IF_1) to
its MAC address table.
3. The Switch detects that the packet is an ARP Request packet and the
destination IP address is the IP address of VLANIF 2. The Switch then
encapsulates VLANIF 2's MAC address of 3-3-3 into the ARP Reply packet
before sending it from IF_1. In addition, the Switch adds the mapping
between the IP address and MAC address of Host_1 in its ARP table.
4. After receiving the ARP Reply packet from the Switch, Host_1 adds the
mapping between the IP address and MAC address of VLANIF 2 on the Switch
to its ARP table and sends a packet to the Switch. The packet carries the
destination MAC address of 3-3-3 and destination IP address of 10.2.2.2
(Host_2's IP address).
5. After the packet reaches IF_1 on the Switch, the Switch tags the packet with
VLAN 2.
6. The Switch updates its MAC address table based on the source MAC address,
VLAN ID, and inbound interface of the packet, and compares the destination
MAC address of the packet with the MAC address of VLANIF 2. If they are the
same, the Switch determines that the packet should be forwarded at Layer 3
and searches for a Layer 3 forwarding entry based on the destination IP
address. If no entry is found, the Switch sends the packet to the CPU. The CPU
then searches for a routing entry to forward the packet.
7. The CPU looks up the routing table based on the destination IP address of the
packet and detects that the destination IP address matches a directly
connected network segment (network segment of VLANIF 3). The CPU
continues to look up its ARP table but finds no matching ARP entry. Therefore,
the Switch broadcasts an ARP Request packet with the destination address of
10.2.2.2 to all interfaces in VLAN 3. The ARP Request packet will be send from
IF_2.
8. After receiving the ARP Request packet, Host_2 detects that the IP address is
its own IP address and sends an ARP Reply packet with its own MAC address.
Additionally, Host_2 adds the mapping between the MAC address and IP
address of VLANIF 3 to its ARP table.
9. After IF_2 on the Switch receives the ARP Reply packet, IF_2 tags the packet
with VLAN 3 to the packet and adds the mapping between the MAC address
and IP address of Host_2 to its ARP table. Before forwarding the packet from
Host_1 to Host_2, the Switch removes the tag with VLAN 3 from the packet.
The Switch also adds the binding of Host_2's IP address, MAC address, VLAN
ID, and outbound interface in its Layer 3 forwarding table.
In this way, the packet sent from Host_1 then reaches Host_2. The packet
transmission process from Host_2 to Host_1 is similar. Subsequent packets
between Host_1 and Host_2 are first sent to the gateway (Switch), and the Switch
forwards the packets at Layer 3 based on its Layer 3 forwarding table.
Port Isolation
Port isolation can isolate interfaces in the same VLAN. You can add interfaces to a
port isolation group to disable Layer 2 packet transmission between the interfaces.
Interfaces in different port isolation groups or not in any port isolation groups can
exchange packets with each other normally. In addition, interfaces can also be
isolated unidirectionally, creating a more secure and flexible network.
MUX VLAN
Multiplex VLAN (MUX VLAN) controls network resources using VLANs. It can
implement inter-VLAN communication and intra-VLAN isolation.
For example, by deploying MUX VLAN, an enterprise can allow employees to
communicate with each other, but isolate customers from each other. At the same
time, both employees and customers can access enterprise servers.
For details about the MUX VLAN feature, see 6 MUX VLAN Configuration.
Traffic Policies
A traffic policy is configured by binding traffic classifiers to traffic behaviors. You
can define traffic classifiers on a switch to match packets with certain
characteristics and associate the traffic classifiers with the permit or deny behavior
in a traffic policy. The switch then permits or denies packets matching the traffic
classifiers, implementing intra-VLAN unidirectional or bidirectional isolation.
The switch supports intra-VLAN Layer 2 isolation based on MQC and ACL-based
simplified traffic policies. For details about MQC and ACL-based simplified traffic
policies, see MQC Configuration and ACL-based Simplified Traffic Policy
Configuration in the S300, S500, S2700, S5700, and S6700 V200R021C10
Configuration Guide - QoS.
NOTE
Only the S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6735-S, S6720-EI, S6720S-EI,
S6730-H, S6730S-H, S6730-S, and S6730S-S support this function.
To enable employees to access network resources such as servers after they move
between different office areas, configure MAC address-based VLAN assignment on
Switch_2 and Switch_3. As long as the MAC address of User_1 remains unchanged,
the VLAN of the user remains unchanged and they can still access the company's
network resources after changing the location.
Assign VLANs on the Layer 2 switches, and configure the Layer 2 switches to
transparently transmit VLAN packets to Layer 3 switches. Configure a VLANIF
interface for each user VLAN and interconnected VLANs on Switch_1 and
Switch_2, and configure VLANIF interfaces for interconnected VLANs on other
Layer 3 devices. In addition, configure static routes or a dynamic routing protocol
between Switch_1 and Switch_2 (a dynamic routing protocol is recommended
when devices are connected across more than two Layer 3 switches).
The central switch (Switch) is configured with VLANIF 10, VLANIF 20, VLANIF 30,
and VLANIF 100 and a route to the router, after which employees, visitors, and
servers can access the Internet and communicate with each other. To control
access rights of visitors, configure a traffic policy on the central switch and define
the following rules:
● ACL rule 1: denies any packets sent from the IP network segment of visitors to
the IP segment of employees.
● ACL rule 2: permits any packets from the IP network segment of visitors to
the IP address of Server_1, and denies any packets sent to the IP network
segment of servers.
● ACL rule 3: denies any packets from the IP network segment of employees to
the IP network segment of visitors.
● ACL rule 4: denies any packets from the IP network segment of servers to the
IP network segment of visitors.
Apply the traffic policy to the inbound and outbound directions of the switch
interface connected to the visitor area. Visitors can then only access Server_1 and
cannot communicate with employees.
To access the ISP network, the core Layer 3 switch and egress router need to
interwork at Layer 3. Most Layer 3 switches do not support or only support limited
routed interfaces. Generally, a VLANIF interface is used as a Layer 3 interface to
communicate with the Layer 3 sub-interface of the router. Then a static route or a
dynamic routing protocol is configured to implement Layer 3 connectivity between
the core switch and egress router.
Configuration Description
Task
Configure inter- After VLANs are assigned, users in different VLANs cannot
VLAN directly communicate with each other. If users in different
communication VLANs need to communicate with each other, configure
VLANIF interfaces to implement inter-VLAN Layer 3
communication.
Configure port After VLANs are assigned, users in the same VLAN can
isolation to directly communicate with each other. If some users in the
implement intra- same VLAN need to be isolated, configure port isolation to
VLAN Layer 2 implement intra-VLAN Layer 2 isolation.
isolation NOTE
You can also implement intra-VLAN Layer 2 isolation by
configuring MQC-based traffic policies and simplified traffic
policies. For details, see MQC Configuration and ACL-based
Simplified Traffic Policy Configuration in the S300, S500, S2700,
S5700, and S6700 V200R021C10 Configuration Guide - QoS.
Configuration Description
Task
Licensing Requirements
VLAN is a basic feature of a switch and is not under license control.
NOTE
To view detailed information about software mappings, visit Info-Finder, select a product
series or product model, and click Hardware Center.
The S5731-L and S5731S-L are remote units and do not support web-based management,
YANG, or commands. They can be configured only through configuration delivery by the
central device. For details, see "Simplified Architecture Configuration (the Solar System
Solution)" in the S300, S500, S2700, S5700, and S6700 V200R021C10 Configuration Guide -
Device Management.
Feature Limitations
● Table 4-6 describes the VLAN specifications of different switch models.
Maximum number of VLANs in the 4096 (VLAN 0 and VLAN 4095 are
system reserved)
Item Specification
● S2750-EI/S5700-LI/S5700S-LI: 1 in
versions earlier than V200R005
and 8 in V200R005 and later
versions
● S5710-EI/S6700-EI: 256 in
versions earlier than V200R005
and 1024 in V200R005
● In V200R020C10 and later versions, the resource allocation mode of the S500,
S5735-S, S300, S5735-L, S5735S-L, S5735-S-I, S5735S-L-M, S5735S-S, S5735-L-
I, S5735-L1,and S5735S-L1 can be set to enhanced-mac using the assign
resource-mode enhanced-mac global command. On a device of one of the
preceding models, if the enhanced-mac resource allocation mode is
configured, a maximum of eight VLANIF interfaces can be created. If the
device has already more than eight VLANIF interfaces configured, after the
enhanced-mac resource allocation mode is configured, only the eight VLANIF
interfaces with the smallest VLAN IDs are reserved.
Damping time 0s
for a VLANIF
interface in
Down state
Traffic Disabled
statistics
collection in a
VLAN
Traffic Disabled
statistics
collection on
a VLANIF
interface
Context
Interface-based VLAN assignment is the simplest and most effective method for
assigning VLANs. With interface-based VLAN assignment, an interface is added to
a VLAN, after which the interface can forward packets from the VLAN. Interface-
based VLAN assignment allows hosts in the same VLAN to communicate at Layer
2 and prevents hosts in different VLANs from communicating, limiting broadcast
packets to within a VLAN.
Ethernet interfaces are classified into access, trunk, and hybrid interfaces. The type
of interface determines the objects that can connect to the Ethernet interface and
number of VLANs from which untagged frames are permitted (for more details,
see 4.2.2 Interface Types). If the device connected to an Ethernet interface can
send and receive only untagged frames, you need to configure a default VLAN on
the interface to add VLAN tags to untagged frames on the interface.
On the S2720-EI, S5720I-SI, S5720-LI, S2730S-S, S5735-L-I, S5735-L1,S300, S5735-
L, S5735S-L, S5735S-L1, S5735S-L-M, S5720S-LI, S5735-S, S500, S5735S-S, S5735-
S-I, S5735S-H, S5736-S, the type of an interface is negotiation-auto by default. On
other models, the type of an interface is negotiation-desirable by default.
Procedure
● Configuring the default VLAN for an access interface
a. Run system-view
The system view is displayed.
b. 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.
c. Run quit
Return to the system view.
d. Run interface interface-type interface-number
The view of the Ethernet interface to be added to the VLAN is displayed.
e. Run port link-type access
The Ethernet interface is configured as an access interface.
f. Run port default vlan vlan-id
The default VLAN is configured for the interface and the interface is
added to the specified VLAN.
NOTE
If the VLAN allowed by an interface is the default VLAN of the interface, packets from
the VLAN are forwarded as untagged.
● Configuring the default VLAN for a hybrid interface
a. Run system-view
The system view is displayed.
b. 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.
c. Run quit
Return to the system view.
d. Run interface interface-type interface-number
The view of the Ethernet interface to be added to the VLAN is displayed.
e. Run port link-type hybrid
The Ethernet interface is configured as a hybrid interface.
f. Run the following commands as required.
----End
Configuration Example
In Figure 4-23, interfaces connecting to PC1 and PC3 are assigned to VLAN 10,
and the interface connecting to PC2 is assigned to VLAN 20. PC2 cannot directly
communicate with PC1 and PC3 at Layer 2, but PC1 and PC3 can directly
communicate with each other.
<HUAWEI> system-view
[HUAWEI] sysname Switch
[Switch] vlan batch 10 20
[Switch] interface gigabitethernet 0/0/1
[Switch-GigabitEthernet0/0/1] port link-type access
[Switch-GigabitEthernet0/0/1] port default vlan 10
[Switch-GigabitEthernet0/0/1] quit
[Switch] interface gigabitethernet 0/0/2
[Switch-GigabitEthernet0/0/2] port link-type access
[Switch-GigabitEthernet0/0/2] port default vlan 20
[Switch-GigabitEthernet0/0/2] quit
[Switch] interface gigabitethernet 0/0/3
[Switch-GigabitEthernet0/0/3] port link-type access
[Switch-GigabitEthernet0/0/3] port default vlan 10
[Switch-GigabitEthernet0/0/3] quit
[Switch] interface gigabitethernet 0/0/4
[Switch-GigabitEthernet0/0/4] port link-type hybrid
[Switch-GigabitEthernet0/0/4] port hybrid tagged vlan 10 20
Add PC1 and PC3 to the same IP address segment, for example, 192.168.100.0/24;
add PC2 to another IP address segment, for example, 192.168.200.0/24. PC1 and
PC3 can ping each other but cannot ping PC2.
Switch configuration file
#
sysname Switch
#
vlan batch 10 20
#
interface gigabitethernet 0/0/1
port link-type access
port default vlan 10
#
interface gigabitethernet 0/0/2
port link-type access
port default vlan 20
#
interface gigabitethernet 0/0/3
port link-type access
port default vlan 10
#
interface gigabitethernet 0/0/4
port link-type hybrid
port hybrid tagged vlan 10 20
#
return
Configuration Tips
Configuring a name for a VLAN
When multiple VLANs are created on the device, you can configure names for the
VLANs to facilitate management. After a name is configured for a VLAN, you can
directly enter the VLAN view using the name.
# Set the name of VLAN 10 to huawei.
<HUAWEI> system-view
[HUAWEI] vlan 10
[HUAWEI-vlan10] huawei
[HUAWEI-vlan10] quit
# After a name is configured for a VLAN, you can directly enter the VLAN view
using the name.
[HUAWEI] vlan vlan-name huawei
[HUAWEI-vlan10] quit
If the VLAN planning of an interface is changed, you need to delete the original
VLAN configuration of the interface. If many non-contiguous VLANs are
configured on the interface, you need to perform the delete operation multiple
times. To reduce the workload, you can restore the default VLAN configuration of
the interface. For details, see 4.8.7 Restoring the Default VLAN Configuration of
an Interface.
When the interface planning changes or the current interface type is different
from the configured one, the interface type needs to be changed. For details, see
4.11.4 How Do I Change the Link Type of an Interface?.
Deleting a VLAN
If a VLAN is not in use, you are advised to delete it to save VLAN resources and
reduce packets on a network. For details, see 4.8.8 Deleting a VLAN.
Context
The switch supports the following link types on an Ethernet interface: access,
hybrid, trunk, and QinQ. The four link types are applicable to different network
deployments and are manually specified. When the network topology changes,
link types of Ethernet interfaces also need to be reconfigured. If this is done
manually, configuration is time-consuming and complex. To simplify configuration,
LNP supports auto-negotiation of link types on Ethernet interfaces and allows
Ethernet interfaces to join VLANs through auto-negotiation. Typically, when LNP is
deployed, the VLAN Central Management Protocol (VCMP) also needs to be
deployed so that VLANs can be centrally created and deleted and user
configurations are simplified. For details about VCMP, see 12 VCMP
Configuration.
Procedure
Step 1 Run system-view
NOTE
When performing this step, ensure that the interface is a Layer 2 interface. If the interface
is not a Layer 2 interface, run the portswitch command to configure the interface as a
Layer 2 interface.
When an LNP-capable device is used with an LNP-incapable device, the LNP-capable device
continuously sends LNP packets, which wastes bandwidth. You can run the port
negotiation disable command in the Layer 2 Ethernet interface view to disable LNP.
To ensure successful negotiation, ensure that LNP is enabled both globally and in the
interface view.
----End
Configuration Example
In Figure 4-24, to simplify configurations, switches are connected through the
trunk link, and switches and user terminals are connected through access links
and added to VLANs. By default, LNP is enabled globally and on all interfaces.
Configure Switch3.
<HUAWEI> system-view
[HUAWEI] sysname Switch3
[Switch3] vlan batch 10 20
[Switch3] interface GigabitEthernet 0/0/1
[Switch3-GigabitEthernet0/0/1] port trunk allow-pass only-vlan 10 20
[Switch3-GigabitEthernet0/0/1] quit
[Switch3] interface GigabitEthernet 0/0/2
[Switch3-GigabitEthernet0/0/2] port trunk allow-pass only-vlan 10 20
[Switch3-GigabitEthernet0/0/2] quit
<HUAWEI> system-view
[HUAWEI] sysname Switch1
[Switch1] vlan batch 10 20
[Switch1] interface GigabitEthernet 0/0/1
[Switch1-GigabitEthernet0/0/1] port default vlan 10
[Switch1-GigabitEthernet0/0/1] quit
[Switch1] interface GigabitEthernet 0/0/2
[Switch1-GigabitEthernet0/0/2] port trunk allow-pass only-vlan 10 20
[Switch1-GigabitEthernet0/0/2] quit
[Switch1] interface GigabitEthernet 0/0/3
[Switch1-GigabitEthernet0/0/3] port default vlan 20
[Switch1-GigabitEthernet0/0/3] quit
Context
In MAC address-based VLAN assignment mode, you do not need to reconfigure
VLANs for users when their physical locations change. This improves security and
access flexibility on a network.
When MAC address-based VLAN assignment is enabled, only untagged frames are
processed, and tagged frames are treated in the same manner as interface-based
VLAN assignment.
When receiving an untagged frame, the interface matches the source MAC
address of the frame against the MAC-VLAN table:
● If an entry is matched, the interface forwards the frame based on the VLAN
ID and priority in the entry.
● If no entry is matched, the interface matches the frame according to other
matching rules.
The total number of MAC-VLAN entries is the number of configured MAC-VLAN
entries multiplied by the number of interfaces where MAC-VLAN entries are
delivered. On different models, the number of MAC-VLAN entries is different:
● The S5720I-SI, S5735-S, S5735S-S, S5735-S-I, S5731-H, S5731-S, S5731S-H,
S5731S-S, S5732-H, S6735-S, S6720-EI, S6720S-EI, S6730-H, S6730S-H, S6730-
S, and S6730S-S support a maximum of 1024 MAC-VLAN entries and a
maximum of 64 MAC-VLAN entries with the mask.
● The S2720-EI, , S500S5720S-LI, S5735S-H, S5736-S, S5720-LI, S2730S-S,
S5735-L-I, S5735-L1,S300, S5735-L, S5735S-L, S5735S-L1, and S5735S-L-M
support a maximum of 512 MAC-VLAN entries and a maximum of 64 MAC-
VLAN entries with the mask.
● Other models support a maximum of 512 MAC-VLAN entries and a maximum
of 32 MAC-VLAN entries with the mask.
Procedure
Step 1 Run system-view
NOTE
The vlan configuration command completes the VLAN configurations before the VLAN is
created. The vlan configuration command only enters the VLAN configuration view.
Neither the corresponding VLAN nor configurations in the VLAN take effect. To make
configurations in the VLAN take effect, create the VLAN using the vlan command.
NOTE
When the mac-vlan mac-address command with the same MAC address specified is
executed multiple times, MAC-VLAN entries take effect according to the longest match
principle. On the S6735-S, S6720-EI and S6720S-EI, MAC-VLAN entries take effect according
to the longest match principle only when the subnet mask has 47 bits or less than 47 bits.
A MAC-VLAN entry with a 48-bit subnet mask has the lowest priority.
● The MAC address is input in an H-H-H format, where each H is a hexadecimal
number composed of 1 to 4 alphanumeric characters, such as 00e0 and fc01.
If you enter less than four alphanumeric characters, 0s are added before the
input digits. For example, if e0 is entered, 00e0 is displayed. The MAC address
cannot be all Fs, all 0s, or a multicast MAC address.
● If a MAC-VLAN entry with a mask is specified (excluding a 48-bit mask or
mask with all Fs), the priority cannot be changed normally. To change the
priority, run the undo mac-vlan mac-address command to delete the MAC-
VLAN entry and then run the mac-vlan mac-address command to change
the priority.
● priority specifies the 802.1p priority of a MAC address-based VLAN. The value
is in the range from 0 to 7. A larger value indicates a higher priority. The
default value is 0. After the 802.1p priority of a MAC address-based VLAN is
specified, the switch forwards high-priority frames first during network
congestion.
Step 4 Run quit
Return to the system view.
Step 5 Configure attributes for the Ethernet interface.
1. Run interface interface-type interface-number
The view of the interface that allows the MAC address-based VLAN is
displayed.
2. Run port link-type hybrid
The interface is configured as a hybrid interface.
On access and trunk interfaces, MAC address-based VLAN assignment can be
used only when the MAC address-based VLAN is the same as the PVID. It is
recommended that MAC address-based VLAN assignment be configured on
hybrid interfaces.
Only the S5720I-SI, S5735-S, S5735S-S, S5735-S-I, S5735S-H, S5736-S, S6735-S, S6720-EI,
S6720S-EI support the vlan precedence command.
S5720I-SI, S5735-S, S5735S-S, S5735-S-I, S5735S-H, S5736-S support the vlan precedence
command only in the system view. Other switches support the vlan precedence command only
in the interface view.
On the S6735-S, S6720-EI and S6720S-EI, if both a subnet VLAN and MAC VLAN with a mask
are configured, the MAC VLAN with a mask is matched first regardless of whether the vlan
precedence command is used.
NOTE
MAC address-based VLAN assignment cannot be used with the MUX VLAN and MAC
address authentication on the same interface.
On the S2720-EI, S5720I-SI, S5720-LI, S2730S-S, S5735-L-I, S5735-L1,S300, S5735-L,
S5735S-L, S5735S-L1, S5735S-L-M, S5720S-LI, S5735-S, S5735S-S, S5735-S-I, S5735S-H,
S5736-S, S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6730-H, S6730S-H, S6730-S,
and S6730S-S, MAC address-based VLAN assignment is invalid for packets with a VLAN ID
of 0, regardless of whether the mask of the MAC VLAN is specified. On other models, MAC
address-based VLAN assignment is invalid for packets with the VLAN ID of 0 only when the
mask of the MAC VLAN is specified.
----End
<HUAWEI> system-view
[HUAWEI] sysname Switch
[Switch] vlan batch 10
[Switch] interface gigabitethernet 0/0/1
[Switch-GigabitEthernet0/0/1] port link-type hybrid
[Switch-GigabitEthernet0/0/1] port hybrid tagged vlan 10
[Switch-GigabitEthernet0/0/1] quit
[Switch] interface gigabitethernet 0/0/2
[Switch-GigabitEthernet0/0/2] port link-type hybrid
[Switch-GigabitEthernet0/0/2] port hybrid untagged vlan 10
[Switch-GigabitEthernet0/0/2] quit
[Switch] interface gigabitethernet 0/0/3
[Switch-GigabitEthernet0/0/3] port link-type hybrid
[Switch-GigabitEthernet0/0/3] port hybrid untagged vlan 10
[Switch-GigabitEthernet0/0/3] quit
[Switch] interface gigabitethernet 0/0/4
[Switch-GigabitEthernet0/0/4] port link-type hybrid
[Switch-GigabitEthernet0/0/4] port hybrid untagged vlan 10
[Switch-GigabitEthernet0/0/4] quit
[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] interface gigabitethernet 0/0/2
[Switch-GigabitEthernet0/0/2] mac-vlan enable
[Switch-GigabitEthernet0/0/2] quit
[Switch] interface gigabitethernet 0/0/3
[Switch-GigabitEthernet0/0/3] mac-vlan enable
[Switch-GigabitEthernet0/0/3] quit
[Switch] interface gigabitethernet 0/0/4
[Switch-GigabitEthernet0/0/4] mac-vlan enable
[Switch-GigabitEthernet0/0/4] quit
<HUAWEI> system-view
[HUAWEI] sysname Switch1
[Switch1] vlan batch 10 20
[Switch1] vlan 10
[Switch1-vlan10] mac-vlan mac-address 11-11-11
[Switch1-vlan10] mac-vlan mac-address 22-22-22
[Switch1-vlan10] quit
[Switch1] vlan 20
[Switch1-vlan20] mac-vlan mac-address 33-33-33
[Switch1-vlan20] mac-vlan mac-address 44-44-44
[Switch1-vlan20] quit
[Switch1] interface gigabitethernet 0/0/1
[Switch1-GigabitEthernet0/0/1] mac-vlan enable
[Switch1-GigabitEthernet0/0/1] quit
[Switch1] interface gigabitethernet 0/0/1
[Switch1-GigabitEthernet0/0/1] port link-type hybrid
[Switch1-GigabitEthernet0/0/1] port hybrid untagged vlan 10 20
[Switch1-GigabitEthernet0/0/1] quit
[Switch1] interface gigabitethernet 0/0/2
[Switch1-GigabitEthernet0/0/2] port link-type trunk
[Switch1-GigabitEthernet0/0/2] port trunk allow-pass vlan 10 20
[Switch1-GigabitEthernet0/0/2] quit
Context
IP subnet-based and protocol-based VLAN assignments are types of network
layer-based VLAN assignment. They reduce manual VLAN configuration workload
and allow users to easily join a VLAN, transfer from one VLAN to another, and exit
from a VLAN. IP subnet-based VLAN assignment applies to scenarios where there
are high requirements for mobility and simplified management and low
requirements for security. For example, when a PC configured with multiple IP
addresses needs to access servers on different network segments or when a switch
adds PCs to other VLANs when the PCs' IP addresses change.
After receiving untagged frames from an interface, the switch determines the
VLANs that the frames belong to using the source IP addresses or network
segments, and then transmits the frames to the specified VLANs.
Procedure
Step 1 Run system-view
A VLAN is created and the VLAN view is displayed. If the specified VLAN has been
created, the VLAN view is directly displayed.
NOTE
The vlan configuration command completes the VLAN configurations before the VLAN is
created. The vlan configuration command only enters the VLAN configuration view.
Neither the corresponding VLAN nor configurations in the VLAN take effect. To make
configurations in the VLAN take effect, create the VLAN using the vlan command.
NOTE
Only the S5720I-SI, S5735-S, S5735S-S, S5735-S-I, S5735S-H, S5736-S, S6735-S, S6720-EI,
S6720S-EI support the vlan precedence command.
S5720I-SI, S5735-S, S5735S-S, S5735-S-I, S5735S-H, S5736-S support the vlan precedence
command only in the system view. Other switches support the vlan precedence command only
in the interface view.
On the S6735-S, S6720-EI and S6720S-EI, if both a subnet VLAN and MAC VLAN with a mask
are configured, the MAC VLAN with a mask is matched first regardless of whether the vlan
precedence command is used.
NOTE
----End
Configuration Example
In Figure 4-27, PC1, PC2, and PC3 are located on different network segments and
are added to VLAN 100, VLAN 200, and VLAN 300, respectively.
<HUAWEI> system-view
[HUAWEI] sysname Switch
[Switch] vlan batch 100 200 300
[Switch] interface gigabitethernet 0/0/1
[Switch-GigabitEthernet0/0/1] port link-type hybrid
[Switch-GigabitEthernet0/0/1] port hybrid untagged vlan 100 200 300
[Switch-GigabitEthernet0/0/1] ip-subnet-vlan enable
[Switch-GigabitEthernet0/0/1] quit
[Switch] interface gigabitethernet 0/0/2
[Switch-GigabitEthernet0/0/2] port link-type trunk
[Switch-GigabitEthernet0/0/2] port trunk allow-pass vlan 100 200 300
[Switch-GigabitEthernet0/0/2] quit
[Switch] vlan 100
[Switch-vlan100] ip-subnet-vlan 1 ip 192.168.1.2 24 priority 2
[Switch-vlan100] quit
[Switch] vlan 200
[Switch-vlan200] ip-subnet-vlan 1 ip 192.168.2.2 24 priority 3
[Switch-vlan200] quit
[Switch] vlan 300
[Switch-vlan300] ip-subnet-vlan 1 ip 192.168.3.2 24 priority 4
[Switch-vlan300] quit
Context
IP subnet-based assignment and protocol-based VLAN assignment are types of
network layer-based VLAN assignment. They reduce manual VLAN configuration
workload and allow users to easily join a VLAN, transfer from one VLAN to
another, and exit from a VLAN. A switch that has protocol-based VLAN
assignment enabled processes only untagged frames, and treats tagged frames in
the same manner as interface-based VLAN assignment.
When receiving an untagged frame from an interface, the switch identifies the
protocol profile of the frame and then determines the VLAN that the frame
belongs to.
● If protocol-based VLANs are configured on the interface and the protocol
profile of the frame matches a protocol-based VLAN, the switch adds the
VLAN tag to the frame.
● If protocol-based VLANs are configured on the interface and the protocol
profile of the frame matches no protocol-based VLAN, the switch adds the
PVID of the interface to the frame.
Procedure
Step 1 Run system-view
A VLAN is created and the VLAN view is displayed. If the specified VLAN has been
created, the VLAN view is directly displayed.
NOTE
The vlan configuration command completes the VLAN configurations before the VLAN is
created. The vlan configuration command only enters the VLAN configuration view.
Neither the corresponding VLAN nor configurations in the VLAN take effect. To make
configurations in the VLAN take effect, create the VLAN using the vlan command.
Step 3 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 } }
Protocol-based VLAN assignment is invalid for packets with the VLAN ID of 0 on the S5731-
H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6730-H, S6730S-H, S6730-S, and S6730S-S.
----End
Configuration Example
In Figure 4-28, users in VLAN 10 use IPv4 to communicate with remote users, and
users in VLAN 20 use IPv6 to communicate with remote servers. To implement
this, you need to use protocol-based VLAN assignment.
<HUAWEI> system-view
[HUAWEI] sysname Switch
[Switch] vlan batch 10 20
[Switch] vlan 10
[Switch-vlan10] protocol-vlan ipv4
[Switch-vlan10] quit
[Switch] vlan 20
[Switch-vlan20] protocol-vlan ipv6
[Switch-vlan20] quit
[Switch] interface gigabitethernet 0/0/2
[Switch-GigabitEthernet0/0/2] protocol-vlan vlan 10 all priority 5
[Switch-GigabitEthernet0/0/2] port link-type hybrid
[Switch-GigabitEthernet0/0/2] port hybrid untagged vlan 10
[Switch-GigabitEthernet0/0/2] quit
[Switch] interface gigabitethernet 0/0/3
[Switch-GigabitEthernet0/0/3] protocol-vlan vlan 20 all priority 6
[Switch-GigabitEthernet0/0/3] port link-type hybrid
[Switch-GigabitEthernet0/0/3] port hybrid untagged vlan 20
[Switch-GigabitEthernet0/0/3] quit
[Switch] interface gigabitethernet 0/0/1
[Switch-GigabitEthernet0/0/1] port link-type trunk
[Switch-GigabitEthernet0/0/1] port trunk allow-pass vlan 10 20
[Switch-GigabitEthernet0/0/1] quit
Context
Policy-based VLAN assignment allows plug-and-play of user terminals and
provides secure data isolation for terminal users.
The switch provides policy-based VLAN assignment based on just MAC and IP
addresses or based on both MAC and IP addresses and interfaces.
Policy-based VLAN assignment uses a policy to bind a terminal's MAC address and
IP address, or its interface, to a specific VLAN. If the IP or MAC addresses of
terminals added to a VLAN are changed, they will exit from the VLAN.
The switch that has policy-based VLAN assignment enabled processes only
untagged frames, and treat tagged frames in the same manner as VLANs
configured based on ports.
When receiving an untagged frame, the switch determines the VLAN according to
the policy matching both MAC and IP addresses of the frame, and then transmits
the frame in the 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.
NOTE
The vlan configuration command completes the VLAN configurations before the VLAN is
created. The vlan configuration command only enters the VLAN configuration view.
Neither the corresponding VLAN nor configurations in the VLAN take effect. To make
configurations in the VLAN take effect, create the VLAN using the vlan command.
NOTE
----End
Context
VLANIF interfaces are simple to configure and are one of the most commonly
used technologies for inter-VLAN communication.
If a VLAN goes Down because all interfaces in the VLAN went Down, the system
immediately reports the VLAN Down event to the corresponding VLANIF interface,
instructing the VLANIF interface to go Down. To avoid network flapping from the
VLANIF interface status change, enable VLAN damping on the VLANIF interface.
With VLAN damping, after the last interface in Up state in a VLAN goes Down, the
device starts a delay timer. It will only inform the corresponding VLANIF interface
of the VLAN Down event after the timer expires. In this way, if an interface in the
VLAN goes Up during the delay, the VLANIF interface remains Up.
After configuring bandwidth for a VLANIF interface, you can use the NMS to query
the bandwidth to facilitate traffic monitoring.
Pre-configuration Tasks
Before configuring inter-VLAN communication, complete the following tasks:
● Assign VLANs.
● Configure the default gateway address of hosts as the IP address of the
VLANIF interface.
Procedure
Step 1 Run system-view
A VLANIF interface goes Up only when at least one physical interface in the
corresponding VLAN is in Up state.
NOTE
NOTE
● After using the mtu command to change the MTU of an interface, restart the interface
to make the new MTU take effect. To restart the interface, run the shutdown command
and then the undo shutdown command, or run the restart command in the interface
view.
● The MTU plus the Layer 2 frame header of a VLANIF interface must be smaller than the
maximum frame length of the remote interface set by the jumboframe command;
otherwise, some frames may be discarded.
----End
Only the VLANIF interface in Up state can forward packets at Layer 3. If the VLANIF
interface goes Down, rectify the fault according to 4.10.2 A VLANIF Interface Goes
Down.
Figure 4-29 shows a port isolation usage scenario. PC1, PC2, and PC3 belong to
VLAN 10. After GE0/0/1 connecting to PC1 and GE0/0/2 connecting to PC2 are
added to a port isolation group, PC1 and PC2 cannot communicate with each
other in VLAN 10, but they can communicate with PC3.
Procedure
● Configure a port isolation group.
a. Run system-view
The system view is displayed.
b. (Optional) Run port-isolate mode { l2 | all }
The port isolation mode is configured.
The default port isolation mode is Layer 2 isolation and Layer 3
interworking.
c. Run interface interface-type interface-number
The Ethernet interface view is displayed.
d. Run port-isolate enable [ group group-id ]
Port isolation is enabled.
By default, port isolation is disabled.
Port isolation takes effect only for interfaces on the same device.
Interfaces in a port isolation group are isolated from each other, but
interfaces in different port isolation groups can communicate. If group-id
is not specified, interfaces are added to port isolation group 1 by default.
● Configure unidirectional isolation.
a. Run system-view
The system view is displayed.
NOTE
----End
Configuration Example
In Figure 4-31, PC3 needs to communicate with PC1 and PC2 but PC1 and PC2
cannot communicate with each other.
<HUAWEI> system-view
[HUAWEI] sysname Switch
[Switch] vlan 10
[Switch-vlan10] quit
[Switch] interface gigabitethernet 0/0/1
[Switch-GigabitEthernet0/0/1] port link-type access
[Switch-GigabitEthernet0/0/1] port default vlan 10
[Switch-GigabitEthernet0/0/1] port-isolate enable //By default, the interface is added to port isolation
group 1 and the port isolation mode is Layer 2 isolation and Layer 3 interworking. You can run the port-
isolate mode all command to set the port isolation mode to Layer 2 and Layer 3 isolation.
[Switch-GigabitEthernet0/0/1] quit
[Switch] interface gigabitethernet 0/0/2
[Switch-GigabitEthernet0/0/2] port link-type access
[Switch-GigabitEthernet0/0/2] port default vlan 10
[Switch-GigabitEthernet0/0/2] port-isolate enable //By default, the interface is added to port isolation
group 1 and the port isolation mode is Layer 2 isolation and Layer 3 interworking. You can run the port-
isolate mode all command to set the port isolation mode to Layer 2 and Layer 3 isolation.
[Switch-GigabitEthernet0/0/2] quit
[Switch] interface gigabitethernet 0/0/3
[Switch-GigabitEthernet0/0/3] port link-type access
[Switch-GigabitEthernet0/0/3] port default vlan 10
[Switch-GigabitEthernet0/0/3] quit
Follow-up Procedure
After configuring port isolation, you can perform the following tasks:
● To reduce the maintenance workload and operation complexity, run the clear
configuration port-isolate command in the system view to clear all the port
isolation configurations on the device.
● To exclude a VLAN when configuring port isolation, run the port-isolate
exclude vlan command in the system view. This configuration ensures that
port isolation does not take effect in the excluded VLAN, and users in the
VLAN can communicate with each other.
Context
You can configure unknown packet isolation in a VLAN to isolate broadcast
packets, unknown unicast packets, and unknown multicast packets, without
affecting packets sending to the CPU. This function applies to large- and medium-
sized campus networks where aggregation and access switches go online through
Option 148.
NOTE
This function is supported only on the following models: S5731-H, S5731-S, S5731S-H,
S5731S-S, S5732-H, S6730-H, S6730S-H, S6730-S, and S6730S-S.
Procedure
● Configure unknown packet isolation in a VLAN.
1. Run system-view
The system view is displayed.
2. Run vlan vlan-id
A VLAN is created and the VLAN view is displayed, or the view of an existing
VLAN is displayed.
3. Run unknown-flow drop
Unknown packet isolation is configured in the VLAN.
Context
The management VLAN allows you to use the VLANIF interface to log in to the
management switch to centrally manage devices.
Usually, a VLANIF interface needs to be configured with only one management IP
address. However, in some situations, for example, when users in the same
management VLAN belong to multiple different network segments, you need to
configure a primary management IP address and multiple secondary management
IP addresses.
You can log in to both local and remote devices using a VLANIF interface of a
management VLAN. When logging in to the remote device using the VLANIF
interface of a management VLAN, you need to configure VLANIF interfaces on
both local and remote devices and assign IP addresses on the same network
segment to them.
Pre-configuration Tasks
Before configuring a management VLAN, perform the task of assigning VLANs.
NOTE
Only trunk and hybrid interfaces can join the management VLAN.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run vlan vlan-id
The VLAN view is displayed.
Step 3 Run management-vlan
The VLAN is configured as the management VLAN.
----End
Follow-up Procedure
Log in to the switch to implement centralized management through the NMS.
Then, select one of the following login modes:
● To manage local devices, log in to the local switch using Telnet, STelnet,
HTTPS. For details, see Configuring Telnet Login, Configuring STelnet Login, or
Web System Login in the S300, S500, S2700, S5700, and S6700 V200R021C10
Configuration Guide - Basic Configurations.
● To manage remote devices, log in to the local device using Telnet or STelnet.
Then log in to the remote devices using Telnet or STelnet from the local
device. For details, see Example for Configuring the Device as the Telnet Client
to Log In to Another Device in "Configuring Telnet Login", or Example for
Configuring the Device as the STelnet Client to Log In to Another Devicein
"Configuring STelnet Login" in the S300, S500, S2700, S5700, and S6700
V200R021C10 Configuration Guide - Basic Configurations.
The login IP address is the IP address of the VLANIF interface of the management
VLAN.
Context
Transparent transmission of protocol packets in a VLAN allows the switch to
transparently transmit protocol packets in a specified VLAN without sending the
protocol packets to the CPU, improving forwarding efficiency.
NOTE
Only the S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6735-S, S6720-EI, S6720S-EI,
S6730-H, S6730S-H, S6730-S, and S6730S-S support this function.
Procedure
● Configure transparent transmission of protocol packets in a VLAN.
a. Run system-view
The system view is displayed.
b. 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.
c. Run protocol-transparent
Transparent transmission of protocol packets in a VLAN is configured.
By default, transparent transmission of protocol packets in a VLAN is
disabled.
● Configure transparent transmission of protocol packets in multiple VLANs.
a. Run system-view
The system view is displayed.
b. Run vlan batch { vlan-id1 [ to vlan-id2 ] } &<1-10>
One or more VLANs are created.
c. Run vlan range { vlan-id1 [ to vlan-id2 ] } &<1-10>
A temporary VLAN range is created and its view is displayed. If the VLAN
range has been created, this command directly displays the VLAN-Range
view.
Uncreated VLANs cannot be added to a temporary VLAN range.
d. Run protocol-transparent
Transparent transmission of protocol packets in VLANs is configured.
By default, transparent transmission of protocol packets is disabled in
VLANs of a temporary VLAN range.
NOTE
● The vlan range command configuration is not saved in the configuration file. After
services are configured in the VLAN-Range view, the service configurations of all the
VLANs in the VLAN range will be saved in the configuration file.
● After transparent transmission of protocol packets is configured in a VLAN, the VLAN
cannot be configured as a multicast VLAN or control VLAN.
● Before running this command, ensure that IGMP or MLD snooping has been disabled in
the VLAN. Otherwise, the configuration may fail.
Context
You can enable traffic statistics collection on a VLAN or on a VLANIF interface to
monitor VLAN traffic.
Procedure
● Check VLAN traffic statistics.
a. (Optional) Run the vlan statistics interval command in the system view
to set the VLAN traffic statistics collection interval.
b. (Optional) Run the vlan statistics { by-packets | by-bytes } command in
the system view to set the VLAN traffic statistics collection mode. You can
configure the switch to collect VLAN traffic statistics based on packets or
bytes.
NOTE
Only the S2720-EI, S5720I-SI, S5720-LI, S5720S-LI, S5735S-H, S5736-S support this
configuration.
c. Run the statistic enable command in the VLAN view to enable VLAN
traffic statistics collection.
d. Run the display vlan vlan-id statistics command in any view to check
traffic statistics about a specified VLAN.
● Check traffic statistics about a VLANIF interface.
a. Run the statistic enable command in the VLANIF interface view to
enable traffic statistics collection.
NOTE
----End
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
The cleared VLAN traffic statistics cannot be restored. Exercise caution when you
use the reset vlan command.
To clear VLAN traffic statistics, run the reset vlan statistics command in the user
view.
Procedure
● Run the reset vlan vlan-id statistics command to clear the traffic statistics of
the specified VLAN.
----End
Context
If you want to collect the packet statistics for a specified time on a VLANIF
interface, you must first clear existing packet statistics on the VLANIF interface.
NOTICE
The cleared statistics cannot be restored. Exercise caution when you run the reset
command.
Procedure
● Run the reset counters interface [ interface-type [ interface-number ] ]
command to clear the packet statistics on the specified VLANIF interface.
----End
If you want to re-collect statistics on LNP packets for a specified time, you must
first clear existing statistics.
Context
NOTICE
The cleared LNP packet statistics cannot be restored. Exercise caution when you
run the reset lnp statistics command.
Procedure
● Run the reset lnp statistics [ interface interface-type interface-number ]
command in the user view to clear the LNP packet statistics.
----End
Context
Similar to IP ping, GMAC ping efficiently detects and locates Ethernet faults and
monitors link quality.
GMAC ping is applicable to networks where MD, MA, or MEP is not configured.
Procedure
Step 1 Run the system-view command to enter the system view.
Step 2 Run the ping mac enable command to enable GMAC ping globally.
After GMAC ping is enabled on the device, the device can ping the remote device
and respond to received GMAC ping packets.
Step 3 Run the ping mac mac-address vlan vlan-id [ interface interface-type interface-
number | -c count | -s packetsize | -t timeout | -p priority-value ] * command to
perform GMAC ping to check the connectivity of the link between the local and
remote devices.
A MEP is not required to initiate GMAC ping, but the destination node cannot be a
MEP or MIP. You can perform GMAC ping without configuring the MD, MA, or
MEP on the source device, intermediate device, and destination device.
The two devices must be configured with IEEE 802.1ag of the same version.
Otherwise, you cannot use the ping mac command. For example, if the local
device is configured with IEEE 802.1ag Draft 7 and the remote device is configured
with IEEE Standard 802.1ag-2007, the local device cannot ping the remote device.
----End
Context
Similar to IP traceroute, GMAC trace efficiently detects and locates Ethernet faults
and monitors the link quality.
GMAC trace is applicable to the network where MD, MA, or MEP is not configured.
Procedure
Step 1 Configure the devices on both ends of a link and the intermediate device.
Perform the following operations on the devices at both ends of the link to be
tested and the intermediate device.
1. Run the system-view command to enter the system view.
2. Run the trace mac enable command to enable GMAC trace globally.
By default, GMAC trace is disabled (except the S5731-H, S5731-S, S5731S-H,
S5731S-S, S5732-H, S6730-H, S6730S-H, S6730-S, and S6730S-S).
After GMAC trace is enabled on the device, GMAC trace operations can be
performed on the device. The device can respond to received GMAC trace
packets.
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 | -h ]* command to configure the device to
locate connectivity faults between the local and remote devices.
A MEP is not required to initiate GMAC trace, but the destination node cannot
be a MEP or MIP. GMAC trace can be used without configuring the MD, MA,
or MEP on the source device, intermediate device, or destination device. All
the intermediate devices can respond with an LTR.
The two devices must be configured with IEEE 802.1ag of the same version.
Otherwise, you cannot use the trace mac command. For example, if the local
device is configured with IEEE 802.1ag Draft 7 and the remote device is
configured with IEEE Standard 802.1ag-2007, the connectivity fault cannot be
located.
----End
Context
It is good practice to delete unused VLANs to conserve VLAN resources and reduce
packets on the network. You can delete a single VLAN or VLANs in a batch.
NOTE
VLAN 1 is the default VLAN. It does not need to be created and cannot be deleted.
Procedure
● Deleting a single VLAN
a. Run system-view
The system view is displayed.
b. Run undo vlan vlan-id
The VLAN is deleted.
● Deleting multiple VLANs
a. Run system-view
The system view is displayed.
b. Run undo vlan batch { vlan-id1 [ to vlan-id2 ] } &<1-10>
----End
Networking Requirements
Different user hosts of a company transmit the same service, and are located on
different network segments. User hosts transmitting the same service belong to
different VLANs and need to communicate.
In Figure 4-32, User1 and User2 use the same service and need to communicate,
but belong to different VLANs and are located on different network segments.
User1 and User2 need to communicate.
Configuration Roadmap
1. Create VLANs and determine which VLANs users belong to.
2. Add interfaces to VLANs and configure the interfaces to allow the VLANs of
the users.
3. Create VLANIF interfaces and configure IP addresses for the VLANIF interfaces
to implement Layer 3 connectivity.
NOTE
To implement inter-VLAN communication, 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
[Switch] vlan batch 10 20
----End
Configuration Files
Switch configuration file
#
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 GigabitEthernet0/0/1
port link-type access
port default vlan 10
#
interface GigabitEthernet0/0/2
port link-type access
port default vlan 20
#
return
Related Content
Videos
Networking Requirements
In Figure 4-33, Switch_1 and Switch_2 are connected to Layer 2 networks that
VLAN 10 belongs to. Switch_1 communicates with Switch_2 through a Layer 3
network with OSPF enabled.
PCs of the two Layer 2 networks need to be isolated at Layer 2 and interwork at
Layer 3.
Configuration Roadmap
1. Add interfaces to VLANs and configure the interfaces to allow the VLANs.
2. Configure IP addresses for VLANIF interfaces to implement Layer 3
connectivity.
3. Configure basic OSPF functions to implement Layer 3 interworking.
Procedure
Step 1 Configure Switch_1.
<HUAWEI> system-view
[HUAWEI] sysname Switch_1
[Switch_1] vlan batch 10 30
----End
Configuration Files
● Switch_1 configuration file
#
sysname Switch_1
#
router id 1.1.1.1
#
vlan batch 10 30
#
interface Vlanif10
ip address 10.10.10.1 255.255.255.0
#
interface Vlanif30
ip address 10.10.30.1 255.255.255.0
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 30
#
ospf 1
area 0.0.0.0
network 10.10.10.0 0.0.0.255
network 10.10.30.0 0.0.0.255
#
return
#
sysname Switch_2
#
router id 2.2.2.2
#
vlan batch 10 30
#
interface Vlanif10
ip address 10.10.20.1 255.255.255.0
#
interface Vlanif30
ip address 10.10.30.2 255.255.255.0
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 30
#
ospf 1
area 0.0.0.0
network 10.10.20.0 0.0.0.255
network 10.10.30.0 0.0.0.255
#
return
Related Content
Videos
Deploying a Layer 3 Switch on a LAN
Networking Requirements
On the enterprise network shown in Figure 4-34, hosts in the same VLAN belong
to network segments of 10.1.1.1/24 and 10.1.2.1/24. Hosts on the two network
segments need to access the Internet through the Switch and still communicate.
Configuration Roadmap
If only one IP address is configured for the VLANIF interface on the Switch, only
hosts on one network segment can access the Internet through the Switch. To
enable all hosts on the LAN to access the Internet through the Switch, configure a
secondary IP address for the VLANIF interface. To enable hosts on the two
network segments to communicate, the hosts on the two network segments need
to use the primary and secondary IP addresses of the VLANIF interface as default
gateway addresses.
Procedure
Step 1 Create VLANs and add interfaces to the VLANs.
# Create VLAN 10 and VLAN 20.
<HUAWEI> system-view
[HUAWEI] sysname Switch
[Switch] vlan batch 10 20
NOTE
----End
Configuration Files
Switch configuration file
#
sysname Switch
#
vlan batch 10 20
#
interface Vlanif10
ip address 10.1.1.1 255.255.255.0
ip address 10.1.2.1 255.255.255.0 sub
#
interface Vlanif20
ip address 10.10.10.1 255.255.255.0
#
interface GigabitEthernet0/0/1
port link-type access
port default vlan 10
#
interface GigabitEthernet0/0/2
port link-type access
port default vlan 10
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 20
#
ospf 1
area 0.0.0.0
network 10.1.1.0 0.0.0.255
network 10.1.2.0 0.0.0.255
network 10.10.10.0 0.0.0.255
#
return
Related Content
Videos
Deploying a Layer 3 Switch on a LAN
● Visitors can access only the Internet. They cannot access servers or
communicate with users in any other VLANs.
● Employee A can access all resources in the server area, and employee B can
access only port 21 (FTP service) of server A.
Configuration Roadmap
The configuration roadmap is as follows. If Layer 2 isolation and Layer 3
connectivity have been implemented, start from step 4.
1. Create VLANs and add interfaces to the VLANs to implement Layer 2 isolation
of visitors, employees, and servers.
2. Configure VLANIF interfaces and assign IP addresses to them to implement
Layer 3 connectivity between employees, servers, and visitors.
3. Configure a routing protocol so that visitors, employees, and servers can
access the Internet through Switch_4.
4. Configure an advanced ACL and an ACL-based traffic classifier.
– Visitors can access only the Internet, but cannot communicate with
employees or access servers.
– Employee A can access the Internet and all resources in the server area.
– Employee B can access only the Internet and port 21 of server A.
5. Configure a traffic behavior.
6. Configure and apply a traffic policy for the ACL and traffic behavior to take
effect.
Procedure
Step 1 Create VLANs and add interfaces to the VLANs to implement Layer 2 isolation of
visitors, employees, and servers.
# Create VLAN 10 on Switch_1, and add GE0/0/1 to VLAN 10 in untagged mode
and GE0/0/2 to VLAN 10 in tagged mode. The configurations of Switch_2 and
Switch_3 are similar to the configuration of Switch_1.
<HUAWEI> system-view
[HUAWEI] sysname Switch_1
[Switch_1] vlan batch 10
[Switch_1] interface gigabitethernet 0/0/1
[Switch_1-GigabitEthernet0/0/1] port link-type access
[Switch_1-GigabitEthernet0/0/1] port default vlan 10
[Switch_1-GigabitEthernet0/0/1] quit
[Switch_1] interface gigabitethernet 0/0/2
[Switch_1-GigabitEthernet0/0/2] port link-type trunk
[Switch_1-GigabitEthernet0/0/2] port trunk allow-pass vlan 10
[Switch_1-GigabitEthernet0/0/2] quit
# Create VLAN 10, VLAN 20, VLAN 30, and VLAN 100 on Switch_4, and add
GE0/0/1 to GE0/0/4 to VLAN 10, VLAN 20, VLAN 30, and VLAN 100 in tagged
mode, respectively.
<HUAWEI> system-view
[HUAWEI] sysname Switch_4
[Switch_4] vlan batch 10 20 30 100
[Switch_4] interface gigabitethernet 0/0/1
[Switch_4-GigabitEthernet0/0/1] port link-type trunk
[Switch_4-GigabitEthernet0/0/1] port trunk allow-pass vlan 10
[Switch_4-GigabitEthernet0/0/1] quit
[Switch_4] interface gigabitethernet 0/0/2
[Switch_4-GigabitEthernet0/0/2] port link-type trunk
[Switch_4-GigabitEthernet0/0/2] port trunk allow-pass vlan 20
[Switch_4-GigabitEthernet0/0/2] quit
[Switch_4] interface gigabitethernet 0/0/3
[Switch_4-GigabitEthernet0/0/3] port link-type trunk
[Switch_4-GigabitEthernet0/0/3] port trunk allow-pass vlan 30
[Switch_4-GigabitEthernet0/0/3] quit
[Switch_4] interface gigabitethernet 0/0/4
[Switch_4-GigabitEthernet0/0/4] port link-type trunk
[Switch_4-GigabitEthernet0/0/4] port trunk allow-pass vlan 100
[Switch_4-GigabitEthernet0/0/4] quit
Step 2 Configure VLANIF interfaces and assign IP addresses to them to implement Layer
3 connectivity between employees, servers, and visitors.
# On Switch_4, create VLANIF 10, VLANIF 20, VLANIF 30, and VLANIF 100 and
assign IP addresses 10.1.1.1/24, 10.1.2.1/24, 10.1.3.1/24, and 10.1.100.1/24 to them
respectively.
[Switch_4] interface vlanif 10
[Switch_4-Vlanif10] ip address 10.1.1.1 24
[Switch_4-Vlanif10] quit
[Switch_4] interface vlanif 20
[Switch_4-Vlanif20] ip address 10.1.2.1 24
[Switch_4-Vlanif20] quit
[Switch_4] interface vlanif 30
[Switch_4-Vlanif30] ip address 10.1.3.1 24
[Switch_4-Vlanif30] quit
[Switch_4] interface vlanif 100
[Switch_4-Vlanif100] ip address 10.1.100.1 24
[Switch_4-Vlanif100] quit
Step 3 Configure a routing protocol so that visitors, employees, and servers can access
the Internet through Switch_4.
NOTE
Step 4 Configure and apply a traffic policy to control access between employees, visitors,
and servers.
1. Configure an ACL rule.
# Configure ACL 3000 on Switch_4 to prevent visitors from accessing the
employee area and server area.
[Switch_4] acl 3000
[Switch_4-acl-adv-3000] rule deny ip destination 10.1.2.1 0.0.0.255
[Switch_4-acl-adv-3000] rule deny ip destination 10.1.3.1 0.0.0.255
[Switch_4-acl-adv-3000] quit
# Configure ACL 3001 on Switch_4 so that employee A can access all
resources in the server area and employee B can access only port 21 of server
A.
[Switch_4] acl 3001
[Switch_4-acl-adv-3001] rule permit ip source 10.1.2.2 0 destination 10.1.3.1 0.0.0.255
[Switch_4-acl-adv-3001] rule permit tcp destination 10.1.3.2 0 destination-port eq 21
[Switch_4-acl-adv-3001] rule deny ip destination 10.1.3.1 0.0.0.255
[Switch_4-acl-adv-3001] quit
2. Configure traffic classifiers.
# Configure traffic classifiers c_custom and c_staff on Switch_4 and reference
ACLs 3000, and 3001 in the traffic classifiers, respectively.
[Switch_4] traffic classifier c_custom
[Switch_4-classifier-c_custom] if-match acl 3000
[Switch_4-classifier-c_custom] quit
[Switch_4] traffic classifier c_staff
[Switch_4-classifier-c_staff] if-match acl 3001
[Switch_4-classifier-c_staff] quit
3. Configure a traffic behavior.
# Create a traffic behavior b1 on Switch_4 and configure the permit action.
For the relationship between permit/deny rules in an ACL and permit/deny
rules in a traffic behavior, see What Is the Relationship Between the permit/
deny Rules in an ACL and Those in the Traffic Behavior of a Traffic Policy?.
[Switch_4] traffic behavior b1
[Switch_4-behavior-b1] permit
[Switch_4-behavior-b1] quit
4. Configure traffic policies and associate traffic classifiers with the traffic
behavior in the traffic policies.
5. Apply the traffic policies to control access between employees, visitors, and
servers.
# On Switch_4, apply traffic policies p_custom and p_staff in the inbound
direction of VLAN 10 and VLAN 20, respectively.
[Switch_4] vlan 10
[Switch_4-vlan10] traffic-policy p_custom inbound
[Switch_4-vlan10] quit
[Switch_4] vlan 20
[Switch_4-vlan20] traffic-policy p_staff inbound
[Switch_4-vlan20] quit
----End
Configuration File
● Switch_1 configuration file
#
sysname Switch_1
#
vlan batch 10
#
interface GigabitEthernet0/0/1
port link-type access
port default vlan 10
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 10
#
return
Networking Requirements
In Figure 4-36, users need to securely log in to the Switch for remote
management. There is no idle management interface on the Switch.
Configuration Roadmap
A management interface or VLANIF interface of a management VLAN can be used
to log in to the device for remote management. The device has no idle
management interface, so the management VLAN is used. STelnet is used to
ensure login security. The configuration roadmap is as follows:
NOTE
● The user PC needs to be configured with software for logging in to the SSH server, key
pair generation software, and public key conversion software.
● To ensure device security, change the password frequently.
Procedure
Step 1 Configure a management VLAN and add an interface to the management VLAN.
# Create VLAN 10 on the Switch, configure VLAN 10 as the management VLAN,
and add GE0/0/1 to VLAN 10 in tagged mode.
<HUAWEI> system-view
[HUAWEI] sysname Switch
[Switch] vlan 10
[Switch-vlan10] management-vlan
[Switch-vlan10] quit
[Switch] interface gigabitethernet 0/0/1
[Switch-GigabitEthernet0/0/1] port link-type trunk
[Switch-GigabitEthernet0/0/1] port trunk allow-pass vlan 10
[Switch-GigabitEthernet0/0/1] quit
Step 2 Configure a VLANIF interface and assign an IP address to the VLANIF interface.
# Create VLANIF 10 on the Switch and configure the IP address of 10.10.10.2/24
for it.
[Switch] interface vlanif 10
[Switch-Vlanif10] ip address 10.10.10.2 24
[Switch-Vlanif10] quit
# Create an SSH user named client001 on the Switch and configure password
authentication.
[Switch] aaa
[Switch-aaa] local-user client001 password irreversible-cipher huawei@123
[Switch-aaa] local-user client001 privilege level 3
[Switch-aaa] local-user client001 service-type ssh
[Switch-aaa] quit
[Switch] ssh user client001 authentication-type password
NOTE
The PC connects to the switch through the intermediate device. The intermediate device
needs to be able to transparently transmit packets from management VLAN 10 and have a
route from 10.1.1.1/24 to 10.10.10.2/24.
# Click Open. On the page that is displayed on the Switch, enter the user name
and password, and press Enter.
login as: client001
SSH server: User Authentication
Using keyboard-interactive authentication.
Password:
Info: The max number of VTY users is 10, and the number
of current VTY users on line is 1.
The current login time is 2014-02-25 05:45:41+00:00.
<Switch>
The user can successfully log in to the Switch for remote management.
----End
Configuration Files
Switch configuration file
#
sysname Switch
#
vlan batch 10
#
vlan 10
management-vlan
#
aaa
local-user client001 password irreversible-cipher $1a$EqZEVTq=/@T2XM0q0W{Ec[Fs2@&4YII@-
=(lbr[K>4Dq76]3#BgqMOAxu^%$$
local-user client001 privilege level 3
local-user client001 service-type ssh
#
interface Vlanif10
ip address 10.10.10.2 255.255.255.0
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
stelnet server enable
ssh user client001
ssh user client001 authentication-type password
ssh user client001 service-type stelnet
#
user-interface vty 0 14
authentication-mode aaa
#
return
Only the S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6735-S, S6720-EI, S6720S-EI,
S6730-H, S6730S-H, S6730-S, and S6730S-S support this function.
Configuration Roadmap
1. Create VLANs.
2. Enable transparent transmission of protocol packets in a VLAN.
3. Add Ethernet interfaces to VLANs.
Procedure
Step 1 Configure the Switch.
# Create VLANs.
<HUAWEI> system-view
[HUAWEI] sysname Switch
[Switch] vlan batch 10 20
[Switch] vlan 20
[Switch-vlan20] protocol-transparent
[Switch-vlan20] quit
Step 2 Configure SwitchA and SwitchB. Add upstream interfaces on SwitchA and SwitchB
to VLAN 10 and VLAN 20 in tagged mode, and add downstream interfaces to
VLAN 10 and VLAN 20 in default mode.
# After the configuration is complete, run the display this command on VLAN 20.
The command output shows that transparent transmission of protocol packets in a
VLAN is enabled.
[Switch] vlan 20
[Switch-vlan20] display this
#
vlan 20
protocol-transparent
#
return
----End
Configuration Files
Switch configuration file
#
sysname Switch
#
vlan batch 10 20
#
vlan 20
protocol-transparent
#
interface GigabitEthernet0/0/1
port link-type hybrid
port hybrid tagged vlan 10
#
interface GigabitEthernet0/0/2
port link-type hybrid
port hybrid tagged vlan 10 20
#
interface GigabitEthernet0/0/3
port link-type hybrid
port hybrid tagged vlan 20
#
return
Fault Symptom
When a user attempts to create a VLANIF interface, the system displays an error
message. As a result, the VLANIF interface fails to be created.
Procedure
Step 1 Check the error message during VLANIF interface creation.
Rectify the fault according to the error message. See Table 4-8 for a list of error
messages.
Error: Can not create this The number of created Run the undo
interface because the VLANIF interfaces on interface vlanif vlan-
interface number of this the device has reached id command to delete
type has reached its the limit. unnecessary VLANIF
maximum. Run the display interfaces, and then
interface brief create the new VLANIF
command to check the interface.
number of VLANIF
interfaces, and check
whether the number of
VLANIF interfaces has
reached the limits
shown in Table 4-6.
Step 2 If the fault persists, collect alarms and logs and contact technical support
personnel.
----End
Fault Symptom
A VLANIF interface goes Down.
Table 4-9 Common causes and solutions for the VLANIF interface going down
The physical status of all interfaces A VLANIF interface only goes Up when
added to the VLAN is Down. at least one interface in the VLAN is
Up.
The VLANIF interface is shut down. Run the undo shutdown command in
the VLANIF interface view to start the
VLANIF interface.
Procedure
Step 1 Check whether the interfaces connected to user terminals are in Up state.
Step 2 Check whether the IP addresses of user terminals are on the same network
segment. If they are on different network segments, change the IP addresses of
the user terminals to be on the same network segment. If the fault persists, go to
Step 3.
Run the display mac-address command on the Switch to check whether 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 in the system view to delete MAC address entries
so that the Switch can learn the correct MAC address entries.
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.
Whether the Run the display vlan vlan-id command in any view to check
VLAN has been whether the VLAN has been created. If not, run the vlan
created command in the system view to create the VLAN.
Whether the Run the display vlan vlan-id command in any view to check
interfaces are whether the VLAN contains the interfaces. If not, add the
added to the interfaces to the VLAN.
VLAN NOTE
If the interfaces are located on different switches, add the interfaces
connecting the switches to the VLAN.
The default type of an interface is Negotiation. You can run the port
link-type command to change the link type of an interface.
● Add an access interface to the VLAN by using either of
the following methods. Run the port default vlan
command in the interface view, or 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 by using either of the
following methods. Run the port hybrid tagged vlan
command in the interface view, or 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 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 port isolation is configured on the interface.
● If port isolation is not configured, go to Step 6.
● If 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. Otherwise, go to Step 7.
Step 7 Collect logs and alarms and contact technical support personnel.
----End
Fault Symptom
In Figure 4-39, the IP address of VLANIF 10 on Switch_2 cannot be pinged from
Switch_1. Similarly, the IP address of VLANIF 10 on Switch_1 cannot be pinged
from Switch_2.
Procedure
Step 1 Check whether the VLANIF interface is Up.
Run the display interface vlanif vlan-id command on Switch_1 and Switch_2 and
check the current state and Line protocol current state fields.
● If the value of any one of the two fields is DOWN, the VLANIF interface is
Down. Rectify this fault according to 4.10.2 A VLANIF Interface Goes Down.
● If the values of the two fields are UP, the VLANIF interface is Up. Go to Step
2.
Step 2 Check whether the connected Ethernet interfaces between switches joined the
VLAN.
Run the display vlan vlan-id command on Switch_1 and Switch_2 and check the
Ports field. Check whether the connected Ethernet interfaces exist in the VLAN.
● If the connected Ethernet interfaces do not exist in the VLAN, add the
connected Ethernet interfaces to the VLAN.
● If the connected Ethernet interfaces exist in the VLAN and at least one of
them joined the VLAN in untagged mode (UT is displayed before the
interface), change it from untagged mode to tagged mode.
● If the connected Ethernet interfaces exist in the VLAN but the interfaces are
Down (D is displayed after the interface), rectify the fault according to An
Ethernet Interface Is Physically Down in "Ethernet Interface Configuration" in
the S300, S500, S2700, S5700, and S6700 V200R021C10 Configuration Guide -
Interface Management.
● If none of the preceding rectifies the fault, go to Step 3.
Step 3 Check whether the PVID values on the connected Ethernet interface between
switches are the same.
Step 4 Collect logs and alarms and contact technical support personnel.
----End
GigabitEthernet0/0/15 hybrid 1 -
GigabitEthernet0/0/16 hybrid 1 -
GigabitEthernet0/0/17 hybrid 1 -
GigabitEthernet0/0/18 hybrid 1 -
GigabitEthernet0/0/19 hybrid 1 -
GigabitEthernet0/0/20 hybrid 1 -
GigabitEthernet0/0/21 hybrid 1 -
GigabitEthernet0/0/22 hybrid 1 -
GigabitEthernet0/0/23 hybrid 1 -
GigabitEthernet0/0/24 hybrid 1 -
The Link Type field indicates the link type of an interface, the PVID field indicates
the default VLAN, and the Trunk VLAN List field indicates the list of VLANs
allowed by a trunk interface. If the interface did not join any VLAN, the Trunk
VLAN List field is displayed as -. If the link type of an interface is negotiation-
desirable or negotiation-auto, the Trunk VLAN List field is displayed as 1 to
4094.
Hosts on multiple network segments in the same VLAN can communicate after
the primary and secondary IP addresses for a VLANIF interface are configured.
Figure 4-40 Communication for hosts on multiple network segments in the same
VLAN
After the preceding configurations are performed, Host_1 and Host_2 can
communicate.
Context
When the VLANIF interface is enabled with traffic statistics, the switch counts
Layer 3 traffic in the VLAN corresponding to the VLANIF interface. That is,
statistics on all traffic passing the VLANIF interface are collected.
When you change the link type of an interface that does not use the default
VLAN configuration, the system displays the message "Error: Please renew the
default configurations."
You need to restore the default configuration of the interface, and then
change the link type of the interface.
– Restore the default VLAN configuration of an access or Dot1q-tunnel
interface.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet0/0/1
[HUAWEI-GigabitEthernet0/0/1] undo port default vlan