Professional Documents
Culture Documents
01-07 VLAN Mapping Configuration
01-07 VLAN Mapping Configuration
Switches
Configuration Guide - Ethernet Switching 7 VLAN Mapping Configuration
Definition
VLAN mapping technology changes VLAN tags in packets to implement the
mapping between different VLANs.
Purpose
In some scenarios, two Layer 2 user networks in the same VLAN are connected
through the backbone network. To implement Layer 2 connectivity between users
and deploy Layer 2 protocols such as MSTP uniformly, the two user networks need
to seamlessly interwork with each other. In this case, the backbone network needs
to transmit VLAN packets from the user networks. Generally, VLAN plan on the
backbone network and user network is different, so the backbone network cannot
directly transmit VLAN packets from a user network.
One method is to configure a Layer 2 tunneling technology such as QinQ or VPLS
to encapsulate VLAN packets into packets on the backbone network so that VLAN
packets are transparently transmitted. However, this method increases extra cost
because packets are encapsulated. In addition, Layer 2 tunneling technology may
not support transparent transmission of packets of some protocol packets. The
other method is to configure VLAN mapping. When VLAN packets from a user
network enter the backbone network, an edge device on the backbone network
changes the C-VLAN ID to the S-VLAN ID. After the packets are transmitted to the
other side, the edge device changes the S-VLAN ID to the C-VLAN ID. This method
implements seamless interworking between two user networks.
VLAN IDs in two directly connected Layer 2 networks are different because of
different plans. The user needs to manage the two networks as a single Layer 2
network. For example, Layer 2 connectivity and Layer 2 protocols need to be
deployed uniformly. VLAN mapping can be configured on the switch connecting
the two user networks to map VLAN IDs on the two user networks. This
implements Layer 2 connectivity and uniform management.
Basic Principles
After receiving a tagged packet, the switch determines to replace a single tag,
double tags, or the outer tag in double tags based on the VLAN mapping mode.
Then the switch learns the MAC addresses contained in the packet. Based on the
source MAC address and mapped VLAN ID, the switch updates the MAC address
entries in the VLAN mapping table. Based on the destination MAC address and the
mapped VLAN ID, the switch searches for the MAC address entries. If the
destination MAC address matches no entry, the switch broadcasts the packet in
the specified VLAN; if the destination MAC address matches an entry, the switch
forwards the packet through the corresponding outbound interface.
As shown in Figure 7-1, VLAN mapping between VLAN 2 and VLAN 3 is
configured on Interface1. Before sending packets from VLAN 2 to VLAN 3,
Interface1 replaces the VLAN tags with VLAN 3 tags. When receiving packets from
VLAN 3, Interface1 replaces the VLAN tags with VLAN 2 tags. Then packets are
forwarded according to the Layer 2 forwarding process. This implements
communication between devices in VLAN 2 and VLAN 3.
3
SwitchA SwitchB
2 3
2 3
172.16.0.1/16 172.16.0.7/16
NOTE
If devices in two VLANs need to communicate through VLAN mapping, the IP addresses of
these devices must be on the same network segment. If IP addresses of these devices are
on different network segments, communication between devices is implemented through
Layer 3 routes. In this case, VLAN mapping is invalid.
Implementation Modes
The device supports VLAN-based and MQC-based VLAN mapping. There are three
VLAN-based VLAN mapping modes:
● 1 to 1 VLAN mapping
When an interface configured with VLAN mapping receives a single-tagged
packet, the interface maps the VLAN tag in the packet to a new VLAN tag.
● 2 to 1 VLAN mapping
When an interface configured with VLAN mapping receives a double-tagged
packet, the interface maps the outer tag of the packet to a specified tag and
transparently transmits the inner tag as the data.
● 2 to 2 VLAN mapping
When an interface configured with VLAN mapping receives a double-tagged
packet, the interface maps the inner and outer VLAN tags in the packet to
new inner and outer VLAN tags.
Headqu
VLAN6
arters
Switch3
Switch2
Switch1
New branch
VLAN5
1 to 1 VLAN Mapping
● 2 to 1 VLAN mapping
As shown in Figure 7-3, on a data center network, the office server and
production server are deployed in the old branch, and the servers are
connected to the core network through the access and aggregation switches.
The network administrator deploys a new branch. To save VLAN resources
and isolate different services, configure QinQ on the aggregation switch. To
retain VLAN deployment of core switch Switch5, configure VLAN mapping on
Switch5.
Internet
IP 201 2
Switch3 Switch4
Aggregation Switch IP 201 3
Switch1 Switch2
Access Switch
● 2 to 2 VLAN mapping
As shown in Figure 7-4, two branches of a data center are deployed in
different positions. To save VLAN resources and plan private VLAN IDs in the
data center, QinQ is used. That is, packets from branches to the ISP network
carry double tags. Because VLAN IDs in packets from branches are different
from the VLAN IDs allocated by the ISP network, user packets are discarded.
As a result, communication between branches is interrupted. Configure 2 to 2
VLAN mapping on Switch2 and Switch3 to map double tags on the branch
network to double tags on the ISP network so that branches can
communicate.
ISP
Switch2 outside tag:50 Switch3
inner tag:60
Switch1 Switch4
Branch 1 Branch 2
outside tag:100 outside tag:200
inner tag:10 inner tag:20
2 to 2 VLAN Mapping
Video server
VLAN200
Enterprise backbone
network
Data server VLAN2 VLAN3
Silver user
Licensing Requirements
VLAN mapping 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-48S4Q-LI/CE6810-48S- V100R003C10
LI
CE6810-32T16S4Q-LI/ V100R005C10
CE6810-24S2Q-LI
CE6850EI V100R003C00
CE6850-48S6Q-HI V100R005C00
CE6850-48T6Q-HI/CE6850U-HI/ V100R005C10
CE6851HI
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
CE6881K V200R019C10
CE6881E V200R019C10
CE6863K V200R019C10
CE5810EI V100R003C00
CE5850EI V100R003C00
CE5850HI V100R003C00
CE5855EI V100R005C10
CE5880EI V200R005C10
CE5881 V200R020C00
NOTE
For details about the mapping between software versions and switch models, see the
Hardware Query Tool.
Feature Limitations
● VLAN-based VLAN mapping can only be configured on a trunk or hybrid
interface, and the interface must be added to the VLAN after mapping in
tagged mode.
● When an interface receives double-tagged packets, the TPID in the inner tag
must be 0x8100. Otherwise, mapping of the inner tag does not take effect.
● Before configuring VLAN-based VLAN mapping, do not enable TRILL on the
interface.
● If forwarding resources exceed the specifications, VLAN mapping can be
configured. However, after the device restarts, the invalid VLAN mapping
configuration may become valid and valid VLAN mapping configuration may
become invalid.
● If VLAN mapping is configured on an interface corresponding to the VLAN,
VBST negotiation for this VLAN will fail.
● For CE6870EI and CE6875EI, supports 1 to 1 VLAN mapping, and does not
support MQC-based VLAN Mapping.
● VLAN mapping cannot be used with IGMP or IGMP snooping.
● Starting from V200R003C00, for the CE6875EI and CE6870EI, when original
packets carry three VLAN tags and the device is configured with IPv6 VXLAN
and VLAN mapping, tags in forwarded packets are incorrect. Please deploy
VLAN mapping on the neighboring device.
● DHCP snooping can only be configured with 1-to-1 VLAN mapping.
● If a traffic classifier references an ACL rule that matches the outer VLAN ID
and the VLAN mapping function is configured:
– For the CE6870EI and CE6875EI: The translated VLAN ID after VLAN
mapping is matched in the inbound direction, and the original VLAN ID
before VLAN mapping is matched in the outbound direction.
– For other models: The translated VLAN ID after VLAN mapping is
matched in both the inbound and outbound directions.
● M-LAG cannot be configured together with VLAN Mapping or VLAN Stacking.
Context
VLAN mapping allows an interface to map the single VLAN tag, double VLAN
tags, or outer VLAN tag in double VLAN tags in received single-tagged or double-
tagged packets to the public VLAN tag or tags.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run interface interface-type interface-number
The interface view is displayed.
Step 3 Configure the link type of the interface as trunk or hybrid.
NOTE
● VLAN mapping can only be configured on a trunk or hybrid interface. The interface
must be added to the VLAN after mapping in tagged mode.
● When 2 to 1 or 2 to 2 VLAN mapping is configured, the VLAN ID allowed by the
interface enabled with VLAN mapping must be the outer VLAN ID.
● On the CE5810EI, if remark-8021p 8021p-value is specified, 7.5.2 Configuring MQC-
based VLAN Mapping is recommended. Do not configure 2 to 1 or 2 to 2 VLAN
mapping in this situation.
Step 4 Configure VLAN mapping. (CE6870EI and CE6875EI only support 1 to 1 VLAN
mapping.)
NOTE
If the trill enable command has been executed, delete the trill enable command
configuration before running the port vlan-mapping command.
● Configure 1 to 1 VLAN mapping.
Run port vlan-mapping vlan vlan-id1 map-vlan vlan-id3 [ remark-8021p
8021p-value ]
The interface is configured to map a single tag of packets to a specified tag.
● Configure 2 to 1 VLAN mapping.
Run port vlan-mapping vlan vlan-id1 inner-vlan vlan-id2 map-vlan vlan-id3
[ remark-8021p 8021p-value ]
The interface is configured to map the outer VLAN tag in double-tagged
packets to a specified tag and to transparently transmit the inner VLAN tag.
● Configure 2 to 2 VLAN mapping.
Run port vlan-mapping vlan vlan-id1 inner-vlan vlan-id2 map-vlan vlan-id3
map-inner-vlan vlan-id4 [ remark-8021p 8021p-value ]
The interface is configured to map double tags of packets to specified double
tags.
----End
Context
MQC-based VLAN mapping uses a traffic classifier to classify packets based on
VLAN IDs, associates the traffic classifier with a traffic behavior defining VLAN
mapping so that the device can re-mark the VLAN ID in packets matching the
traffic classifier.
NOTE
Procedure
1. Configure a traffic classifier.
a. Run system-view
The system view is displayed.
b. Run traffic classifier classifier-name [ type { and | or } ]
A traffic classifier is created and the traffic classifier view is displayed, or
the view of an existing traffic classifier is displayed.
and is the logical operator between rules in a traffic classifier, which
means that:
▪ If a traffic classifier does not contain any ACL rules, packets match
the traffic classifier only if they match all the rules in the classifier.
The logical operator or means that packets match a traffic classifier if
they match one or more rules in the classifier.
By default, the relationship between rules in a traffic classifier is or.
c. Run if-match
Matching rules are defined for the traffic classifier.
For details about matching rules in a traffic classifier, see "Configuring a
Traffic Classifier" in "MQC Configuration" of the CloudEngine 8800, 7800,
6800, and 5800 Series Switches Configuration Guide - QoS Configuration
Guide.
d. Run commit
The configuration is committed.
e. Run quit
Exit from the traffic behavior view.
2. Configure a traffic behavior.
a. Run traffic behavior behavior-name
A traffic behavior is created and the traffic behavior view is displayed, or
the view of an existing traffic behavior is displayed.
b. Run vlan-mapping vlan vlan-id
The interface is configured to replace the outer VLAN tag in packets.
c. (Optional) Run vlan-mapping inner-vlan inner-vlan-id
The interface is configured to replace the inner VLAN tag in packets.
d. Run commit
The configuration is committed.
e. Run quit
Exit from the traffic behavior view.
f. Run quit
Exit from the system view.
3. Configure a traffic policy.
a. Run system-view
The system view is displayed.
b. Run traffic policy policy-name
A traffic policy is created and the traffic policy view is displayed, or the
view of an existing traffic policy is displayed.
c. Run classifier classifier-name behavior behavior-name [ precedence
precedence-value ]
A traffic behavior is bound to a traffic classifier in the traffic policy.
d. Run commit
The configuration is committed.
e. Run quit
Exit from the traffic policy view.
f. Run quit
Exit from the system view.
4. Apply the traffic policy.
NOTE
Networking Requirements
As shown in Figure 7-6, on a data center network, as services increase, the
network administrator plans a new branch that belongs to VLAN 5. The
headquarters belongs to VLAN 6, and the headquarters and branch belong to the
same network segment. The new branch needs to communicate with the
headquarters.
Switch3
10GE1/0/1
10GE1/0/2
Switch2
10GE1/0/1
10GE1/0/3
Switch1
10GE1/0/1 10GE1/0/2
New branch
VLAN5
Server1 Server2
1 to 1 VLAN Mapping
Configuration Roadmap
The configuration roadmap is as follows:
1. Add the downlink interface on Switch1 connected to the new branch to VLAN
5.
2. Configure 1 to 1 VLAN mapping on Switch2 to implement communication
between the new branch and headquarters.
Procedure
Step 1 Add the downlink interface on Switch1 to VLAN 5 and configure the uplink
interfaces to allow the VLAN5.
<HUAWEI> system-view
[~HUAWEI] sysname Switch1
[*HUAWEI] commit
[~Switch1] vlan 5
[*Switch1-vlan5] quit
[*Switch1] interface 10ge 1/0/1
[*Switch1-10GE1/0/1] port default vlan 5
[*Switch1-10GE1/0/1] quit
[*Switch1] interface 10ge 1/0/2
[*Switch1-10GE1/0/2] port default vlan 5
[*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 5
[*Switch1-10GE1/0/3] quit
[*Switch1] commit
----End
Configuration Files
● Configuration file of Switch1
#
sysname Switch1
#
vlan batch 5
#
interface 10GE1/0/1
port default vlan 5
#
interface 10GE1/0/2
port default vlan 5
#
interface 10GE1/0/3
port link-type trunk
port trunk allow-pass vlan 5
#
return
● Configuration file of Switch2
#
sysname Switch2
#
vlan batch 6
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 6
port vlan-mapping vlan 5 map-vlan 6
#
interface 10GE1/0/2
port link-type trunk
port trunk allow-pass vlan 6
#
return
● Configuration file of Switch3
#
sysname Switch3
#
vlan batch 6
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 6
#
return
transmitting the same service on old and new branches are located on the same
network segment. To ensure that the same servers can communicate and different
servers are isolated, and save VLAN resources, configure QinQ on aggregation
switches. To retain VLAN deployment of core switch, configure VLAN mapping on
the core switch.
Internet
10GE1/0/3
Core Switch MAC 501 2
10GE1/0/2 10GE1/0/1 MAC 502 3
Switch5
10GE1/0/3 10GE1/0/3
Switch1 Switch2
Access Switch
2 to 1 VLAN Mapping
Configuration Roadmap
The configuration roadmap is as follows:
1. Add interfaces on Switch1 and Switch2 connected to servers to VLANs.
2. Deploy QinQ on Switch3 and Switch4 to save VLAN resources.
3. Configure 2 to 1 VLAN mapping on Switch5 so that the same service can be
transmitted and different services are isolated in old and new branches.
Procedure
Step 1 Add downlink interfaces on Switch1 and Switch2 to VLANs and configure the
uplink interfaces to allow the VLANs.
# Configure Switch1.
<HUAWEI> system-view
[~HUAWEI] sysname Switch1
[*HUAWEI] commit
[~Switch1] vlan batch 2 3
[*Switch1] interface 10ge 1/0/1
[*Switch1-10GE1/0/1] port default vlan 2
[*Switch1-10GE1/0/1] quit
[*Switch1] interface 10ge 1/0/2
[*Switch1-10GE1/0/2] port default vlan 3
[*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 3
[*Switch1-10GE1/0/3] quit
[*Switch1] commit
# Configure Switch2.
<HUAWEI> system-view
[~HUAWEI] sysname Switch2
[*HUAWEI] commit
[~Switch2] vlan batch 2 3
[*Switch2] interface 10ge 1/0/1
[*Switch2-10GE1/0/1] port default vlan 2
[*Switch2-10GE1/0/1] quit
[*Switch2] interface 10ge 1/0/2
[*Switch2-10GE1/0/2] port default vlan 3
[*Switch2-10GE1/0/2] quit
[*Switch2] interface 10ge 1/0/3
[*Switch2-10GE1/0/3] port link-type trunk
[*Switch2-10GE1/0/3] port trunk allow-pass vlan 2 3
[*Switch2-10GE1/0/3] quit
[*Switch2] commit
# Configure the type of 10GE1/0/1 on Switch4 as QinQ and the outer VLAN tag as
VLAN 201.
<HUAWEI> system-view
[~HUAWEI] sysname Switch4
[*HUAWEI] commit
[~Switch4] vlan batch 201
[*Switch4] interface 10ge 1/0/1
This example pings Server4 in the old branch from Server1 in the new branch.
<Server1> ping 172.16.1.2
Pinging 172.16.1.2 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
----End
Configuration Files
● Configuration file of Switch1
#
sysname Switch1
#
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
Branch1 Branch2
Server1 Server2
VLAN 10 VLAN 30
2 to 2 VLAN Mapping
Configuration Roadmap
The configuration roadmap is as follows:
1. Add the downlink interface on Switch1 connected to branch 1 to VLAN 10 and
downlink interface on Switch6 connected to branch 2 to VLAN 30.
2. Configure QinQ on Switch2 and Switch5 so that packets sent to the ISP
network carry double tags.
3. Deploy 2 to 2 VLAN mapping on Switch3 and Switch4 to map inner and outer
VLAN IDs of packets to VLAN IDs allowed by the ISP network so that
branches can communicate.
Procedure
Step 1 Add downlink interfaces on Switch1 and Switch6 to VLANs and configure the
uplink interfaces to allow the VLANs.
# Configure Switch1.
<HUAWEI> system-view
[~HUAWEI] sysname Switch1
[*HUAWEI] commit
[~Switch1] vlan 10
[*Switch1-vlan10] quit
[*Switch1] interface 10ge 1/0/1
[*Switch1-10GE1/0/1] port default vlan 10
[*Switch1-10GE1/0/1] quit
[*Switch1] interface 10ge 1/0/2
# Configure Switch6.
<HUAWEI> system-view
[~HUAWEI] sysname Switch6
[*HUAWEI] commit
[~Switch6] vlan 30
[*Switch6-vlan30] quit
[*Switch6] interface 10ge 1/0/1
[*Switch6-10GE1/0/1] port default vlan 30
[*Switch6-10GE1/0/1] quit
[*Switch6] interface 10ge 1/0/2
[*Switch6-10GE1/0/2] port link-type trunk
[*Switch6-10GE1/0/2] port trunk allow-pass vlan 30
[*Switch6-10GE1/0/2] quit
[*Switch6] commit
Step 2 Configure QinQ on Switch2 and Switch5 so that packets sent to the ISP network
carry double tags.
# Configure the type of 10GE1/0/1 on Switch2 as QinQ and the outer VLAN tag as
VLAN 20.
<HUAWEI> system-view
[~HUAWEI] sysname Switch2
[*HUAWEI] commit
[~Switch2] vlan 20
[*Switch2-vlan20] quit
[*Switch2] interface 10ge 1/0/1
[*Switch2-10GE1/0/1] port link-type dot1q-tunnel
[*Switch2-10GE1/0/1] port default vlan 20
[*Switch2-10GE1/0/1] quit
[*Switch2] interface 10ge 1/0/2
[*Switch2-10GE1/0/2] port link-type trunk
[*Switch2-10GE1/0/2] port trunk allow-pass vlan 20
[*Switch2-10GE1/0/2] quit
[*Switch2] commit
# Configure the type of 10GE1/0/1 on Switch5 as QinQ and the outer VLAN tag as
VLAN 40.
<HUAWEI> system-view
[~HUAWEI] sysname Switch5
[*HUAWEI] commit
[~Switch5] vlan 40
[*Switch5-vlan40] quit
[*Switch5] interface 10ge 1/0/1
[*Switch5-10GE1/0/1] port link-type dot1q-tunnel
[*Switch5-10GE1/0/1] port default vlan 40
[*Switch5-10GE1/0/1] quit
[*Switch5] interface 10ge 1/0/2
[*Switch5-10GE1/0/2] port link-type trunk
[*Switch5-10GE1/0/2] port trunk allow-pass vlan 40
[*Switch5-10GE1/0/2] quit
[*Switch5] commit
# Configure Switch4.
<HUAWEI> system-view
[~HUAWEI] sysname Switch4
[*HUAWEI] commit
[~Switch4] vlan batch 50
[*Switch4] interface 10ge 1/0/1
[*Switch4-10GE1/0/1] port link-type trunk
[*Switch4-10GE1/0/1] port trunk allow-pass vlan 50
[*Switch4-10GE1/0/1] port vlan-mapping vlan 40 inner-vlan 30 map-vlan 50 map-inner-vlan 60
[*Switch4-10GE1/0/1] quit
[*Switch4] interface 10ge 1/0/2
[*Switch4-10GE1/0/2] port link-type trunk
[*Switch4-10GE1/0/2] port trunk allow-pass vlan 50
[*Switch4-10GE1/0/2] quit
[*Switch4] commit
----End
Configuration Files
● Configuration file of Switch1
#
sysname Switch1
#
vlan batch 10
#
interface 10GE1/0/1
port default vlan 10
#
interface 10GE1/0/2
port link-type trunk
port trunk allow-pass vlan 10
#
return
#
vlan batch 20
#
interface 10GE1/0/1
port link-type dot1q-tunnel
port default vlan 20
#
interface 10GE1/0/2
port link-type trunk
port trunk allow-pass vlan 20
#
return
interface 10GE1/0/1
port default vlan 30
#
interface 10GE1/0/2
port link-type trunk
port trunk allow-pass vlan 30
#
return
Networking Requirements
As shown in Figure 7-9, on a data center network, servers store video and data
information. Users are classified into gold and silver users, and gold and silver
users belong to VLAN 200 and VLAN 300 respectively and access servers through
the enterprise backbone network. The enterprise backbone network allocates
VLAN 2 to gold users and VLAN 3 to silver users. Switch2 and Switch3 are edge
devices of the enterprise backbone network. VLAN IDs planned by the video and
data servers and enterprise backbone network are different. To ensure that gold
users can access the video server and silver users can access the data server,
configure MQC-based VLAN mapping on Switch2 and Switch3.
Video server
VLAN200
10
/2 Gold user
G
GE
/0
1
network
VLAN2 VLAN3 10
Data server /3
/0 10GE1/0/1 10GE1/0/2 10GE1/0/2 10GE1/0/1 GE1/0/3
E1
10G Silver user
Configuration Roadmap
The configuration roadmap is as follows:
Procedure
Step 1 Create VLANs.
# Create VLAN 200 and VLAN 300 on Switch1 and add interfaces connected to
servers to VLANs.
<HUAWEI> system-view
[~HUAWEI] sysname Switch1
[*HUAWEI] commit
[~Switch1] vlan batch 200 300
[*Switch1] interface 10ge 1/0/2
[*Switch1-10GE1/0/2] port default vlan 200
[*Switch1-10GE1/0/2] quit
[*Switch1] interface 10ge 1/0/3
[*Switch1-10GE1/0/3] port default vlan 300
[*Switch1-10GE1/0/3] quit
[*Switch1] commit
# Create VLAN 200 and VLAN 300 on Switch4 and add interfaces connected to
users to VLAN 200 and VLAN 300. The configuration of Switch1 is similar to the
configuration of Switch4, and the configuration details are not mentioned here.
# On Switch2, create VLAN 2 and VLAN 3.
<HUAWEI> system-view
[~HUAWEI] sysname Switch2
[*HUAWEI] commit
[~Switch2] vlan batch 2 3
[*Switch2] commit
Step 2 Configure traffic classifiers, traffic behaviors, and traffic policies on Switch2 and
Switch3.
# Configure traffic classifiers, traffic behaviors, and traffic policies on Switch2.
[~Switch2] traffic classifier name1
[*Switch2-classifier-name1] if-match vlan 200
[*Switch2-classifier-name1] quit
[*Switch2] traffic behavior name1
[*Switch2-behavior-name1] vlan-mapping vlan 2
[*Switch2-behavior-name1] quit
[*Switch2] traffic classifier name2
[*Switch2-classifier-name2] if-match vlan 300
[*Switch2-classifier-name2] quit
[*Switch2] traffic behavior name2
[*Switch2-behavior-name2] vlan-mapping vlan 3
[*Switch2-behavior-name2] quit
[*Switch2] traffic policy name1
[*Switch2-trafficpolicy-name1] classifier name1 behavior name1
[*Switch2-trafficpolicy-name1] classifier name2 behavior name2
[*Switch2-trafficpolicy-name1] quit
[*Switch2] commit
# Add 10GE1/0/1 on Switch1 to VLAN 200 and VLAN 300. The configuration of
10GE1/0/1 on Switch4 is similar to the configuration of Switch1, and the
configuration details are not mentioned here.
[~Switch1] interface 10ge 1/0/1
[*Switch1-10GE1/0/1] port link-type trunk
[*Switch1-10GE1/0/1] port trunk allow-pass vlan 200 300
[*Switch1-10GE1/0/1] quit
[*Switch1] commit
After the preceding configuration is complete, gold users can access the video
server and silver users can access the data server.
----End
Configuration Files
● Configuration file of Switch1
#
sysname Switch1
#
vlan batch 200 300
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 200 300
#
interface 10GE1/0/2
port default vlan 200
#
interface 10GE1/0/3
port default vlan 300
#
return
● Configuration file of Switch2
#
sysname Switch2
#
vlan batch 2 to 3
#
traffic classifier name1 type or
if-match vlan 200
#
traffic classifier name2 type or
if-match vlan 300
#
traffic behavior name1
vlan-mapping vlan 2
#
traffic behavior name2
vlan-mapping vlan 3
#
traffic policy name1
classifier name1 behavior name1 precedence 5
classifier name2 behavior name2 precedence 10
#
interface 10GE1/0/1
traffic-policy name1 inbound
#
return
● Configuration file of Switch3
#
sysname Switch3
#
vlan batch 2 to 3
#
traffic classifier name1 type or
if-match vlan 2
#
traffic classifier name2 type or
if-match vlan 3
#
traffic behavior name1
vlan-mapping vlan 200
#
traffic behavior name2
vlan-mapping vlan 300
#
traffic policy name1
classifier name1 behavior name1 precedence 5
classifier name2 behavior name2 precedence 10
#
interface 10GE1/0/2
traffic-policy name1 inbound
#
return
● Configuration file of Switch4
#
sysname Switch4
#
vlan batch 200 300
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 200 300
#
interface 10GE1/0/2
port default vlan 200
#
interface 10GE1/0/3
port default vlan 300
#
return