Professional Documents
Culture Documents
Switches
Configuration Guide - Ethernet Switching 10 QinQ Configuration
10 QinQ Configuration
Definition
QinQ expands VLAN space by adding an additional 802.1Q tag to 802.1Q tagged
packets. It allows services in a private VLAN to be transparently transmitted over a
public network. A packet transmitted on the backbone network carries two 802.1Q
tags: a public VLAN tag and a private VLAN tag.
Purpose
Ethernet is widely used on ISP networks, but 802.1Q VLANs are unable to identify
and isolate large numbers of users on metro Ethernet networks because the 12-bit
VLAN tag field defined in IEEE 802.1Q only identifies a maximum of 4096 VLANs.
QinQ was developed to expand VLAN space beyond 4096 VLANs so that a larger
number of users can be identified on a metro Ethernet network.
In addition to expanding VLAN space, QinQ is applied in other scenarios with the
development of metro Ethernet networks and carriers' requirements on refined
service operation. The outer and inner VLAN tags can be used to differentiate
packets based on users and services. For example, the inner tag represents a user,
while the outer tag represents a service. Moreover, QinQ is used as a simple and
practical VPN technology because inner tags of QinQ packets are transparently
transmitted over a public network. It extends core MPLS VPN services to metro
Ethernet networks to establish an end-to-end VPN.
Since QinQ technology is easy to use, it has been widely applied in Internet
Service Provider (ISP) networks. For example, QinQ is combined with multiple
services in metro Ethernet solutions. Selective QinQ (VLAN stacking) makes QinQ
more popular among ISPs. As the metro Ethernet develops, equipment vendors
have developed their own metro Ethernet solutions, in which the simple and
flexible QinQ technology plays an important role.
Benefits
QinQ offers the following benefits:
● Extends the VLAN space to isolate and identify more users.
● Facilitates service deployment by allowing the inner and outer tags to
represent different information. For example, the inner tag identifies a user
and the outer tag identifies a service.
● Allows ISPs to implement refined service operation by providing diversified
encapsulation and termination modes.
VLAN 4 VLAN 3
Customer Customer
network A network B
CE1 CE2
NOTE
Because a QinQ packet has 4 more bytes than an 802.1Q packet, the maximum frame
length allowed by each interface on the carrier network should be at least 1504 bytes. The
default frame length allowed by interfaces of a switch is larger than 1504 bytes, so you do
not need to adjust it. For details on how to configure the frame length allowed by an
interface, see Setting the Jumbo Frame Length Allowed on an Interface in "Ethernet
Interface Configuration" in the S1720, S2700, S5700, and S6720 V200R011C10
Configuration Guide - Interface Management.
QinQ Encapsulation
QinQ Implementation
QinQ can be implemented in either of the following ways:
1. Basic QinQ
Basic QinQ is implemented based on interfaces. After basic QinQ is
configured on an interface, the device adds the default VLAN tag of this
interface to all packets regardless of whether the packets carry VLAN tags.
– If a single-tagged packet is received, the packet becomes a double-
tagged packet.
– If an untagged packet is received, the packet is tagged with the default
VLAN ID of the local interface.
2. Selective QinQ
Selective QinQ is implemented based on interfaces and VLAN IDs. That is, an
interface can forward packets based on a single VLAN tag or double VLAN
tags. In addition, the device processes packets received on an interface as
follows based on their VLAN IDs:
– Adds different outer VLAN tags to packets carrying different inner VLAN
IDs.
– Marks outer 802.1p fields and adds different outer VLAN tags to packets
according to the 802.1p fields in inner VLAN tags.
In addition to separating carrier and customer networks, selective QinQ
provides extensive service features and allows flexible networking.
QinQ Encapsulation
QinQ encapsulation changes a single-tagged packet into a double-tagged packet,
and is usually performed on underlayer provider edge (UPE) interfaces connected
to customer networks.
Depending on the data encapsulated, QinQ encapsulation is applied as interface-
based or flow-based QinQ encapsulation. Additionally, QinQ encapsulation can be
performed on routed sub-interfaces.
● Interface-based QinQ encapsulation
…… Port3 ……
PE1 Port4
VLAN1000 VLAN4094 VLAN500 VLAN2500
Port1 Port2
Port3
…… ……
……
Table 10-1 shows the outer VLAN tag plan for Department 1 and Department 2.
Department 1 2 to 500 10
QinQ tunneling is configured on PE1 and PE2 in the following way to implement
communication within each department and isolate the two departments:
● Configure PE1 to add the outer VLAN 10 to packets received on Port1 and
Port2 and outer VLAN 20 to packets received on Port3.
● Configure PE2 to add the outer VLAN 20 to packets received on Port1 and
Port2.
● Configure Port4 on PE1 and Port3 on PE2 to allow packets of VLAN 20 to
pass.
Selective QinQ is an extension of basic QinQ and is more flexible. The difference is
as follows:
● Basic QinQ: adds the same outer VLAN tag to all packets arriving at a Layer 2
interface.
● Selective QinQ: adds different outer VLAN tags to packets arriving at a Layer
2 interface based on inner VLAN tags.
…… Port3 ……
PE1 Port3
……
……
……
VLAN100 VLAN500
Department 1
VLAN2 VLAN500 VLAN1000 VLAN2000
Department 1 Department 2
Internet
DeviceA
IP 10 Management VLAN 10
Interface VLANIF 10
user2
user1
VLAN 10
To log in to DeviceB and manage VLANs from DeviceA, you can configure VLAN
stacking on the VLANIF interface corresponding to the management VLAN on
DeviceB.
● If the double-tagged packets sent to the ISP network have the same outer
VLAN tags as the S-VLAN tags, the packets can be transparently transmitted
to DeviceB over the ISP network.
DeviceB enabled with QinQ stacking compares the VLAN tag of the received
packets with the VLAN tag on the VLANIF interface. If the packets have the
same outer tag as that on the VLANIF interface, DeviceB removes the outer
VLAN tag and sends the packet to the IP layer for processing.
● The VLANIF interface enabled with QinQ stacking on DeviceB adds outer
VLAN tags to received data packets. The outer VLAN tag is the same as the S-
VLAN tag. In this case, the double-tagged packets can be transparently
transmitted to DeviceA over the ISP network. After receiving the packets,
DeviceA removes the outer VLAN tag and forwards the packets to local users.
10.2.5 TPID
The Tag Protocol Identifier (TPID) specifies the protocol type of a VLAN tag. The
TPID value defined in IEEE 802.1Q is 0x8100.
Figure 10-6 shows the Ethernet packet format defined in IEEE 802.1Q. An IEEE
802.1Q tag, containing the TPID, lies between the Source Address field and the
Length/Type field. A device checks the TPID value in a received packet to
determine whether the VLAN tag is an S-VLAN tag or C-VLAN tag. The device
compares the configured TPID value with the TPID value in the packet. For
example, if a frame carries the VLAN tag with TPID 0x8100 but the TPID
configured for a customer network on a device is 0x8200, the device considers the
frame untagged.
Carrier's systems may use different TPID values in outer VLAN tags. When a
Huawei device needs to interoperate with such a carrier system, set the TPID value
to the value used by the carrier so that QinQ packets sent from the Huawei device
can be transmitted across the carrier network. To prevent errors in packet
forwarding and processing, do not set the TPID to any of values listed in Table
10-3.
ARP 0x0806
RARP 0x8035
IP 0x0800
IPv6 0x86DD
PPPoE 0x8863/0x8864
MPLS 0x8847/0x8848
IPX/SPX 0x8137
LACP 0x8809
802.1x 0x888E
HGMP 0x88A7
Reserved 0xFFFD/0xFFFE/0xFFFF
Implementation
QinQ mapping is performed after packets are received on the inbound interface
and before packets are forwarded through the outbound interface.
● Before sending a packet from a local VLAN, a sub-interface replaces the VLAN
tag of the packet sent with a specified VLAN tag.
● After receiving a packet, a sub-interface replaces the VLAN tag of packet with
a local VLAN tag.
In real-world applications, QinQ mapping can map customer VLAN (C-VLAN) tags
to a service VLAN (S-VLAN) tag to shield different customer VLANs.
GE0/0/1.1 GE0/0/1.1
QinQ Mapping
IP 20 IP 40
Device1 Device4
PC1 PC2
172.16.0.1/24 172.16.0.7/24
Core Network
NPE NPE
VLAN 1001 VLAN 1XX
VLAN 2001 VLAN 3XX
VLAN 1000 VLAN 1XX VRRP VLAN 3001 VLAN 5XX
VLAN 2000 VLAN 3XX Metro
VLAN 3000 VLAN 5XX Ethernet
UPE
VLAN 101 VLAN 101
VLAN 301 VLAN 301
VLAN 501 VLAN 501
PVC101
PVC301
PVC501
As shown in Figure 10-8, the digital subscriber line access multiplexers (DSLAMs)
support multiple permanent virtual channels (PVCs) so that a same user can use
multiple services, such as High-Speed Internet (HSI), Internet Protocol Television
(IPTV), and voice over IP (VoIP).
The carrier assigns different PVCs and VLAN ranges to HSI, IPTV, and VoIP services,
as described in Table 10-5.
A user accesses the VoIP service. When a VoIP packet reaches a DSLAM through a
specified PVC, the DSLAM marks the packet with a VLAN in the VLAN range
mapped to the PVC, such as 301. When the VoIP packet reaches the UPE, the UPE
tags the packets with an outer VLAN ID mapping the VoIP VLAN ID range, such as
2000. The inner VLAN ID represents user information and the outer VLAN ID
represents service information and the location of the DSLAM (packets from
different DSLAMs are tagged with different outer VLAN IDs). When the packet
reaches the NPE indicated by the outer VLAN tag, the VLAN tag is terminated on
the QinQ termination sub-interface. According to the core network configuration,
the packet is forwarded on the IP network or enters the corresponding VPN.
HSI and IPTV services are processed in the same manner, except that VLAN tags of
HSI services are terminated on a broadband remote access server (BRAS).
The NPE can perform HQoS scheduling based on double tags and generate a
DHCP binding table to avoid network attacks. In addition, the NPE can implement
DHCP authentication based on double tags or other information. You can also
configure VRRP on QinQ termination sub-interfaces to ensure service reliability.
ME MPLS/IP ME
UPE NPE NPE UPE
VLAN 100 VLAN 100 VLAN 100
VLAN 200 VLAN 200 VLAN 200
VLAN 300 VLAN 300 VLAN 300
Others
Others
Finance Finance VLAN 300
VLAN 300
VLAN 100 VLAN 100
Marketing Marketing
VLAN 200 VLAN 200
The carrier uses VPLS technology on the MPLS/IP core network and QinQ
technology on the metro Ethernet network. Each site is assigned three VLANs 100,
200 and 300, which represent Finance, Marketing, and Others departments
respectively. The UPEs at two ends tag received packets with outer VLAN 1000
(different outer VLAN tags are allowed on two ends), and the same VSI is
configured on the NPEs. This configuration ensures that only users of the same
VLAN in different sites can communicate with each other.
Set the TPID value in an This configuration allows 10.8 Configuring the
outer VLAN tag a Huawei device to TPID Value in an Outer
communicate with a VLAN Tag
non-Huawei device.
Licensing Requirements
QinQ configuration commands are available only after the S1720GW, S1720GWR,
and S1720X have the license (WEB management to full management Electronic
RTU License) loaded and activated and the switches are restarted. QinQ
configuration commands on other models are not under license control.
For details about how to apply for a license, see S Series Switch License Use
Guide.
Version Requirements
S5710-C-LI V200R001C00
S5730SI V200R011C10
S5730S-EI V200R011C10
NOTE
To know details about software mappings, see Hardware Query Tool.
Feature Limitations
● For the points of attention when configuring QinQ on a sub-interface, see 8.4
Licensing Requirements and Limitations for VLAN Termination.
● The devices listed in Table 10-8 can add double tags to untagged packets.
Table 10-8 Products and versions supporting the function of adding double
tags to untagged packets
S5730SI V200R011C10
S5730S-EI V200R011C10
● The switch forwards packets based only on their outer VLAN tags and learns
MAC address entries based on the outer VLAN tags.
● Selective QinQ is recommended to be enabled on a hybrid interface and the
qinq vlan-translation enable command must have been executed to enable
VLAN translation. Selective QinQ can only take effect on the interface in the
inbound direction.
● When an interface configured with VLAN stacking needs to remove the outer
tag from outgoing frames, the interface must join the VLAN specified by
stack-vlan in untagged mode. If the outer VLAN does not need to be
removed, the interface must join the VLAN specified by stack-vlan in tagged
mode.
● The device configured with selective QinQ can only add an outer VLAN tag to
a frame with an inner VLAN tag on an interface, and the outer VLAN ID must
exist. Otherwise, the services where selective QinQ is configured are
unavailable.
● A VLAN bound to a BD cannot be specified as the value of stack-vlan (that is,
the outer VLAN ID added to frames) in VLAN stacking commands. Similarly, a
VLAN specified as the value of stack-vlan in VLAN stacking commands cannot
be bound to a BD.
● If only single-tagged packets from a VLAN need to be transparently
transmitted, do not specify the VLAN as the inner VLAN for selective QinQ.
After selective QinQ is configured on the S3700EI, S3700SI, or S5700EI, VLAN
mapping, for example, port vlan-mapping vlan 20 map-vlan 20, must be
configured to map the VLAN to itself from which single-tagged packets need
to be transparently transmitted.
● When VLAN stacking is configured, do not configure stack-vlan to the VLAN
corresponding to the VLANIF interface.
● VLAN-based flow mirroring allows the device to identify only outer VLAN tags
of QinQ packets.
● The globally configured traffic-limit command that takes effect for all
interfaces in the inbound direction is invalid for QinQ packets.
● ND snooping and adding double tags to untagged packets can be configured
together on the S5720EI, S5720HI, S6720EI and S6720S-EI.
● SAVI and adding double tags to untagged packets can be configured together
on the S5720EI, S5720HI, S6720EI and S6720S-EI.
● If the PW-side interface is a Layer 3 interface switched by the undo
portswitch command, the AC-side interface cannot be a Layer 3 interface or
subinterface belonging to a Layer 3 interface; otherwise, traffic forwarding is
abnormal. This rule applies to S5720EI, S6720EI, and S6720S-EI.
Background
Basic QinQ enables the device to add a public tag to incoming packets so that
user packets can be forwarded on the public network. To separate private
networks from public networks and conserve VLAN resources, configure double
802.1Q tags on QinQ interfaces of the device. Private VLAN tags are used on
private networks such as enterprise networks, and public VLAN tags are used on
external networks such as ISP networks. QinQ expands VLAN space to 4094x4094
and allows packets on different private networks with the same VLAN IDs to be
transparently transmitted.
Procedure
Step 1 Run system-view
S6720SI, S6720S-SI, S5720SI, and S5720S-SI is negotiation-auto, and the link type
of an interface on other models is negotiation-desirable.
Dot1q-tunnel interfaces do not support Layer 2 multicast.
Step 6 Run port default vlan vlan-id
The VLAN ID of the public VLAN tag, that is, the default VLAN of the interface, is
configured.
By default, VLAN 1 is the default VLAN of all interfaces.
----End
Pre-configuration Tasks
Before configuring selective QinQ, create the outer VLAN.
Context
VLAN ID-based selective QinQ allows an interface to add outer VLAN tags to
packets based on VLAN IDs of the packets.
NOTE
● Selective QinQ is recommended to be enabled on a hybrid interface and the qinq vlan-
translation enable command must have been executed to enable VLAN translation.
Selective QinQ can only take effect on the interface in the inbound direction.
● The device configured with selective QinQ can only add an outer VLAN tag to a frame with
an inner VLAN tag on an interface, and the outer VLAN ID must exist. Otherwise, the
services where selective QinQ is configured are unavailable.
● When an interface configured with VLAN stacking needs to remove the outer tag from
outgoing frames, the interface must join the VLAN specified by stack-vlan in untagged
mode. If the outer VLAN does not need to be removed, the interface must join the VLAN
specified by stack-vlan in tagged mode.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run interface interface-type interface-number
The interface view is displayed.
When map-vlan vlan-id4 is configured to perform VLAN stacking and VLAN mapping
concurrently, on switches other than the S5720EI, S5720HI, S6720EI, and S6720S-EI,
the same outer VLAN tag cannot be added to packets from different user VLANs. On
the S5720EI, S5720HI, S6720EI, and S6720S-EI, the same outer VLAN tag cannot be
added to packets from different user VLANs, and different inner VLAN tags in packets
from different user VLANs cannot be matched to the same VLAN tag. For example, if
packets containing VLAN IDs 10 and 20 respectively are received on an interface, the
port vlan-stacking vlan 10 stack-vlan 100 map-vlan 200 and port vlan-stacking
vlan 20 stack-vlan 100 map-vlan 200 commands cannot be configured together.
----End
Configuration Tips
Deleting QinQ configuration
Use either of the following methods to delete the selective QinQ configuration on
an interface:
● Run the undo port vlan-stacking vlan vlan-id1 [ to vlan-id2 ] [ stack-vlan
vlan-id3 ] command in the interface view to delete a selective QinQ entry on
the interface.
● Run the undo port vlan-stacking all command in the interface view to
delete all the selective QinQ entries on the interface.
NOTE
Only the S1720X, S1720X-E, S5730SI, S5730S-EI, S6720LI, S6720S-LI, S6720SI, and S6720S-
SI support this configuration.
Procedure
1. Configure a traffic classifier.
a. Run system-view
The system view is displayed.
b. Run traffic classifier classifier-name [ operator { and | or } ]
A traffic classifier is created and the traffic classifier view is displayed, or
the existing traffic classifier view is displayed.
and is the logical operator between the rules in the traffic classifier,
which means that:
▪ If the traffic classifier contains ACL rules, packets match the traffic
classifier only when they match one ACL rule and all the non-ACL
rules.
▪ If the traffic classifier does not contain any ACL rules, packets match
the traffic classifier only when they match all the rules in the
classifier.
The logical operator or means that packets match the traffic classifier as
long as they match one of rules in the classifier.
By default, the relationship between rules in a traffic classifier is OR.
c. Configure matching rules according to the following table.
Matchin Command Remarks
g Rule
d. Run quit
Exit from the traffic classifier view.
2. Configure a traffic behavior.
a. Run traffic behavior behavior-name
A traffic behavior is created and the traffic behavior view is displayed.
b. Run add-tag vlan-id vlan-id
The outer VLAN ID is specified in the traffic behavior.
You must specify an existing VLAN ID on the device in this command. You
do not need to create a VLAN specified by the original VLAN tag of a
received packet.
c. Run quit
Exit from the traffic behavior view.
d. 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.
After a traffic policy is applied, you cannot use the traffic policy
command to modify the matching order of traffic classifiers in the traffic
policy. To modify the matching order, delete the traffic policy, create a
traffic policy, and specify the matching order.
When creating a traffic policy, you can specify the matching order of its
matching rules. The matching order can be either automatic order or
configuration order:
If more than 128 ACL rules defining CAR are configured, a traffic policy must be
applied to an interface, a VLAN, and the system in sequence in the outbound
direction. In the preceding situation, if you need to update ACL rules, delete the
traffic policy from the interface, VLAN, and system and reconfigure it in
sequence.
c. Run classifier classifier-name behavior behavior-name
A traffic behavior is bound to a traffic classifier in the traffic policy.
d. Run quit
Exit from the traffic policy view.
e. Run quit
Exit from the system view.
4. Apply the traffic policy.
– Applying a traffic policy to an interface
i. Run system-view
The system view is displayed.
ii. Run interface interface-type interface-number
The interface view is displayed.
iii. Run traffic-policy policy-name { inbound | outbound }
A traffic policy is applied to the interface.
A traffic policy can be applied to only one direction on an interface,
but a traffic policy can be applied to different directions on different
interfaces. After a traffic policy is applied to an interface, the system
performs traffic policing for all the incoming or outgoing packets
that match traffic classification rules on the interface.
– Applying a traffic policy to a VLAN
i. Run system-view
The system view is displayed.
ii. Run vlan vlan-id
The VLAN view is displayed.
Context
Devices from different vendors or in different network plans may use different
TPID values in VLAN tags of VLAN packets. To adapt to an existing network plan,
the switch supports TPID value configuration. You can set the TPID value on the
switch to be the same as the TPID value in the network plan to ensure
compatibility with the current network.
NOTE
● To implement interoperability with a non-Huawei device, ensure that the protocol type
in the outer VLAN tag added by the switch can be identified by the non-Huawei device.
● The qinq protocol command identifies incoming packets, and adds or changes the TPID
value of outgoing packets.
● The protocol ID configured on an interface by the qinq protocol command must be
different from other commonly used protocol IDs; otherwise, the interface cannot
distinguish packets of these protocols. For example, protocol-id cannot be set to 0x0806,
which is the ARP protocol ID.
Procedure
Step 1 Run system-view
----End
Context
To log in to a remote device from the local device to manage the remote device,
configure QinQ stacking on the VLANIF interface corresponding to the
management VLAN on the remote device. As shown in Figure 10-10, SwitchA is
connected to SwitchB through a third-party network. The management VLAN on
SwitchB is the same as the VLAN for users connected to SwitchA and is different
from the VLAN provided by the carrier.
Internet
SwitchA
10 IP Management VLAN 10
Interface VLANIF 10
user2
user1
VLAN 10
To log in to SwitchB from SwitchA, you can configure QinQ stacking on the
VLANIF interface corresponding to the management VLAN on SwitchB.
● Packet sent from SwitchA to SwitchB
The user-side interface on SwitchA configured with QinQ sends double-tagged
packets to the ISP network. The outer VLAN tag is the same as the VLAN tag
provided by the carrier so that the packets can be transparently transmitted to
SwitchB over the ISP network.
When SwitchB receives a double-tagged packet, it compares the VLAN tag of
the packet with the VLAN tag configured on the VLANIF interface. If the outer
tag of the packet is the same as the VLAN tag configured on the VLANIF
interface, SwitchB removes the outer tag and sends the packet to the IP layer
for processing.
● Packet sent from SwitchB to SwitchA
When the VLANIF interface of SwitchB receives a data packet, SwitchB adds a
VLAN tag to the packet according to the QinQ stacking configuration. The
new outer VLAN tag is the same as the VLAN tag provided by the carrier so
that the double-tagged data packet can be transparently transmitted to
SwitchA over the ISP network. SwitchA removes the outer VLAN tag of the
packet and forwards the packet.
Pre-configuration Tasks
Before configuring QinQ stacking on a VLANIF interface, complete the following
tasks:
● Create a VLAN.
● Configure a management VLAN.
Procedure
Step 1 Run system-view
Before running this command, ensure that the management VLAN exists.
NOTE
● When configuring QinQ stacking on a VLANIF interface, ensure that the VLANIF
interface corresponds to the management VLAN. VLANIF interfaces corresponding to
other VLANs do not support QinQ stacking.
● Before changing the configured outer VLAN, run the undo qinq stacking vlan
command to delete the original QinQ stacking.
● The qinq stacking vlan and icmp host-unreachable send commands cannot be used
together, so you must run the undo icmp host-unreachable send command before
using the qinq stacking vlan command.
● The outer VLAN added to packets must be an existing VLAN with no VLANIF interface
configured.
----End
Follow-up Procedure
● Run the display vlan [ vlan-id [ verbose ] ] command to check the
management VLAN.
● Run the display this command in the VLANIF interface view to check the
QinQ stacking configuration.
Context
Generally, two devices are required to add double tags to packets. Configuring one
device to add double VLAN tags to untagged packets can simplify configuration.
In addition, a Layer 2 interface can add double tags to untagged packets to
differentiate services or users.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run vlan vlan-id
The outer VLAN is created.
Step 3 Run quit
Return to the system view.
Step 4 Run interface interface-type interface-number
The interface view is displayed.
Step 5 Run port link-type hybrid
The link type of the interface is set to hybrid.
By default, the link type of an interface on the S1720GFR, S1720GW, S1720GWR,
S1720X, S1720GW-E, S1720GWR-E, S1720X-E, S2750EI, S2720EI, S5700LI, S5700S-
LI, S5720LI, S5720S-LI, S6720LI, S6720S-LI, S5710-X-LI, S5730SI, S5730S-EI,
S6720SI, S6720S-SI, S5720SI, and S5720S-SI is negotiation-auto, and the link type
of an interface on other models is negotiation-desirable.
Step 6 Run qinq vlan-translation enable
VLAN translation is enabled on the interface.
Step 7 Run port hybrid untagged vlan vlan-id
The interface is added to the outer VLAN.
Step 8 Run port vlan-stacking untagged stack-vlan vlan-id1 stack-inner-vlan vlan-id2
The interface is configured to add double VLAN tags to untagged packets.
NOTE
To enable an interface to add double VLAN tags to an untagged packet, you must set the
link type of the interface to hybrid and add the interface to the outer VLAN specified by
stack-vlan on the S1720GFR, S1720GW, S1720GWR, S1720X, S1720GW-E, S1720GWR-E,
S1720X-E, S2720EI, S2750EI, S5700LI, S5700S-LI, S5720LI, S5720S-LI, S6720LI, S6720S-LI,
S5710-X-LI, S6720SI, S6720S-SI, S5730SI, S5730S-EI, S5720SI, and S5720S-SI. On other
devices, you need to set the link type of the interface to hybrid or trunk, and add the
interface to the outer VLAN specified by stack-vlan .
If the PVID of an interface is not VLAN 1, restore the PVID to VLAN 1 before running the
port vlan-stacking untagged command.
The port vlan-stacking untagged command actually configures a VLAN assignment mode.
On the S1720GFR, S1720GW, S1720GWR, S1720X, S1720GW-E, S1720GWR-E, S1720X-E,
S2750EI, S2720EI, S5700LI, S5700S-LI, S5720LI, S5720S-LI, S6720LI, S6720S-LI, S5710-X-LI,
S5730SI, S5730S-EI, S6720SI, S6720S-SI, S5720SI, and S5720S-SI, different VLAN assignment
modes are in the following order of priority: interface-based VLAN assignment > voice
VLAN include-untagged > MAC address-based VLAN assignment > IP subnet-based VLAN
assignment > port vlan-stacking untagged > protocol-based VLAN assignment >
interface-based VLAN assignment. On other models, different VLAN assignment modes are
in the following order of priority: policy-based VLAN assignment > voice VLAN include-
untagged > MAC address-based VLAN assignment > IP subnet-based VLAN assignment >
protocol-based VLAN assignment > interface-based VLAN assignment.
----End
Pre-configuration Tasks
Before configuring QinQ mapping, complete the following tasks:
● Connect the device correctly.
● Configure the VLANs that users belong to so that user packets carry one or
double VLAN tags.
● Ensure that the device is not a VCMP client.
Context
1-to-1 QinQ mapping allows a sub-interface to map a tag in a received single-
tagged packet to a specified tag.
Procedure
Step 1 Run system-view
Step 6 Run qinq mapping vid vlan-id1 [ to vlan-id2 ] map-vlan vid vlan-id3
The original VLAN IDs of single-tagged packets specified in the command must be
different from the outer VLAN IDs specified on all the other sub-interfaces.
NOTE
● QinQ mapping cannot be used with stacking, QinQ termination, and Dot1q termination
commands on the same sub-interface.
● If the PW-side interface is a Layer 3 interface switched by the undo portswitch
command, the AC-side interface cannot be a Layer 3 interface or subinterface belonging
to a Layer 3 interface; otherwise, traffic forwarding is abnormal. This rule applies to
S5720EI, S6720EI, and S6720S-EI.
----End
Context
2-to-1 QinQ mapping allows a sub-interface to map an outer tag in a received
double-tagged packet to a specified tag and retain the inner VLAN tag.
Procedure
Step 1 Run system-view
Step 6 Run qinq mapping pe-vid vlan-id1 ce-vid vlan-id2 [ to vlan-id3 ] map-vlan vid
vlan-id4
The original outer tag of double-tagged packets specified in the command must
be different from outer tags specified on all the other sub-interfaces.
NOTE
● QinQ mapping cannot be used with stacking, QinQ termination, and Dot1q termination
commands on the same sub-interface.
● If the PW-side interface is a Layer 3 interface switched by the undo portswitch
command, the AC-side interface cannot be a Layer 3 interface or subinterface belonging
to a Layer 3 interface; otherwise, traffic forwarding is abnormal. This rule applies to
S5720EI, S6720EI, and S6720S-EI.
----End
Context
During QinQ configuration (excluding basic QinQ configuration), VLAN translation
resources may be insufficient. You can run commands to view the total number of
inbound/outbound VLAN translation resources, the number of used VLAN
translation resources, and the number of remaining VLAN translation resources.
The command output helps you locate faults.
Procedure
Step 1 Run the display vlan-translation resource [ slot slot-number ] command in any
view to view VLAN translation resource usage.
NOTE
Only the S5720HI, S5720EI, S6720EI, and S6720S-EI support this command.
Step 2 Run the display spare-bucket resource [ slot slot-number ] command in any
view to view the usage of backup resources when VLAN translation resources
conflict.
NOTE
Only the S5720HI supports this command.
----End
Networking Requirements
As shown in Figure 10-11, there are two enterprises on the network, Enterprise 1
and Enterprise 2. Both of them have two office locations, which connect to
SwitchA and SwitchB of the ISP network. A non-Huawei device on the ISP network
uses the TPID value of 0x9100.
ISP
VLAN 100,200
TPID=0x9100
GE0/0/3 GE0/0/3
Switch A Switch B
GE0/0/1 GE0/0/2 GE0/0/1 GE0/0/2
Configuration Roadmap
The configuration roadmap is as follows:
1. Create VLAN 100 and VLAN 200 on SwitchA and SwitchB. Configure interfaces
connected to the two enterprises as QinQ interfaces and add them to VLAN
100 and VLAN 200 respectively, so that packets from the two enterprises are
tagged with different outer VLAN tags.
2. Add interfaces of SwitchA and SwitchB connected to the ISP network to VLAN
100 and VLAN 200 so that packets from the two VLANs are allowed to pass
through.
3. On the interfaces of SwitchA and SwitchB connected to the ISP network, set
the TPID in outer VLAN tags to the value used on the non-Huawei device so
that SwitchA and SwitchB can interwork with the non-Huawei device.
Procedure
Step 1 Create VLANs.
# Configure GE0/0/1 and GE0/0/2 on SwitchA as QinQ interfaces, and set the
default VLAN of GE0/0/1 to VLAN 100 and the default VLAN of GE0/0/2 to VLAN
200. The configuration of SwitchB is similar to the configuration of SwitchA, and is
not mentioned here.
[SwitchA] interface gigabitethernet 0/0/1
[SwitchA-GigabitEthernet0/0/1] port link-type dot1q-tunnel
[SwitchA-GigabitEthernet0/0/1] port default vlan 100
[SwitchA-GigabitEthernet0/0/1] quit
[SwitchA] interface gigabitethernet 0/0/2
[SwitchA-GigabitEthernet0/0/2] port link-type dot1q-tunnel
[SwitchA-GigabitEthernet0/0/2] port default vlan 200
[SwitchA-GigabitEthernet0/0/2] quit
Step 3 Configure the interfaces of SwitchA and SwitchB connected to the ISP network.
# Add GE0/0/3 of SwitchA to VLAN 100 and VLAN 200. The configuration of
SwitchB is similar to the configuration of SwitchA, and is not mentioned here.
[SwitchA] interface gigabitethernet 0/0/3
[SwitchA-GigabitEthernet0/0/3] port link-type trunk
[SwitchA-GigabitEthernet0/0/3] port trunk allow-pass vlan 100 200
[SwitchA-GigabitEthernet0/0/3] quit
----End
Configuration Files
● SwitchA configuration file
#
sysname SwitchA
#
vlan batch 100 200
#
interface GigabitEthernet0/0/1
port link-type dot1q-tunnel
port default vlan 100
#
interface GigabitEthernet0/0/2
port link-type dot1q-tunnel
port default vlan 200
#
interface GigabitEthernet0/0/3
qinq protocol 9100
port link-type trunk
port trunk allow-pass vlan 100 200
#
return
Related Content
Videos
Configuring QinQ
Networking Requirements
As shown in Figure 10-12, Internet access users (using PCs) and VoIP users (using
VoIP terminals) connect to the ISP network through SwitchA and SwitchB and
communicate with each other through the ISP network.
The enterprise assigns VLAN 100 to PCs and VLAN 300 to VoIP terminals. Packets
from PCs and VoIP terminals need to be transmitted over the ISP network in VLAN
2 and VLAN 3 respectively.
SwitchA SwitchB
GE0/0/2 Carrier GE0/0/2
network
GE0/0/1 GE0/0/1
PC VoIP VoIP PC
Configuration Roadmap
The configuration roadmap is as follows:
1. Create VLANs on SwitchA and SwitchB.
2. Configure link types of interfaces on SwitchA and SwitchB and add the
interfaces to VLANs.
3. Configure selective QinQ on interfaces of SwitchA and SwitchB.
Procedure
Step 1 Create VLANs.
# On SwitchA, create VLAN 2 and VLAN 3, that is, VLAN IDs in the outer VLAN
tags to be added.
<HUAWEI> system-view
[HUAWEI] sysname SwitchA
[SwitchA] vlan batch 2 3
# On SwitchB, create VLAN 2 and VLAN 3, that is, VLAN IDs in the outer VLAN
tags to be added.
<HUAWEI> system-view
[HUAWEI] sysname SwitchB
[SwitchB] vlan batch 2 3
----End
Configuration Files
● SwitchA configuration file
#
sysname SwitchA
#
vlan batch 2 to 3
#
interface GigabitEthernet0/0/1
port link-type hybrid
qinq vlan-translation enable
port hybrid untagged vlan 2 to 3
port vlan-stacking vlan 100 stack-vlan 2
port vlan-stacking vlan 300 stack-vlan 3
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 3
#
return
Figure 10-13 Networking diagram for configuring selective QinQ and VLAN
mapping
ME60
Internet
Corridor
switch
…… …… …… ……
Home
gateway
Configuration Roadmap
The configuration roadmap is as follows:
Procedure
Step 1 Configure SwitchA.
# Create VLANs.
<HUAWEI> system-view
[HUAWEI] sysname SwitchA
[SwitchA] vlan batch 21 to 70 1101 to 1103
----End
Configuration Files
● SwitchA configuration file
#
sysname SwitchA
#
vlan batch 21 to 70 1101 to 1103
#
interface GigabitEthernet0/0/1
port link-type hybrid
qinq vlan-translation enable
port hybrid tagged vlan 1101 to 1103
port hybrid untagged vlan 21
port vlan-stacking vlan 101 to 150 stack-vlan 21
#
return
interface GigabitEthernet0/0/1
port link-type hybrid
qinq vlan-translation enable
port hybrid tagged vlan 101 1000 to 1103
port vlan-mapping vlan 1000 to 1100 map-vlan 101
#
interface GigabitEthernet0/0/2
port link-type hybrid
port hybrid tagged vlan 101 to 150 1101 to 1103
#
return
Networking Requirements
As shown in Figure 10-14, Internet access users (using PCs) and VoIP users (using
VoIP terminals) connect to the ISP network through SwitchA and SwitchB. These
users communicate with each other through the ISP network.
Packets from PCs and VoIP terminals need to be transmitted over the ISP network
in VLAN 2 and VLAN 3 respectively.
You can configure a traffic policy to implement selective QinQ on the Switch.
NOTE
Only the S1720X, S1720X-E, S5730SI, S5730S-EI, S6720LI, S6720S-LI, S6720SI, and S6720S-
SI support this example.
SwitchA SwitchB
GE0/0/2 Carrier GE0/0/2
network
GE0/0/1 GE0/0/1
PC VoIP VoIP PC
Configuration Roadmap
The configuration roadmap is as follows:
Procedure
Step 1 Create VLANs.
# On SwitchA, create VLAN 2 and VLAN 3, that is, VLAN IDs in the outer VLAN
tags to be added.
<HUAWEI> system-view
[HUAWEI] sysname SwitchA
[SwitchA] vlan batch 2 3
# On SwitchB, create VLAN 2 and VLAN 3, that is, VLAN IDs in the outer VLAN
tags to be added.
<HUAWEI> system-view
[HUAWEI] sysname SwitchB
[SwitchB] vlan batch 2 3
Step 3 Apply the traffic policy to interfaces of SwitchA and SwitchB to implement
selective QinQ.
# Configure GE 0/0/1 on SwitchA.
[SwitchA] interface gigabitethernet 0/0/1
[SwitchA-GigabitEthernet0/0/1] port link-type hybrid
[SwitchA-GigabitEthernet0/0/1] port hybrid untagged vlan 2 3
[SwitchA-GigabitEthernet0/0/1] traffic-policy name1 inbound
[SwitchA-GigabitEthernet0/0/1] quit
----End
Configuration Files
● SwitchA configuration file
#
sysname SwitchA
#
vlan batch 2 to 3
#
traffic classifier name1 operator or
if-match vlan-id 100 to 200
traffic classifier name2 operator or
if-match vlan-id 300 to 400
#
traffic behavior name1
add-tag vlan-id 2
traffic behavior name2
add-tag vlan-id 3
#
traffic policy name1
classifier name1 behavior name1
classifier name2 behavior name2
#
interface GigabitEthernet0/0/1
port link-type hybrid
port hybrid untagged vlan 2 to 3
traffic-policy name1 inbound
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 3
#
return
NOTE
● Only the S5720EI, S5720HI, S6720EI, and S6720S-EI support this example.
● VLAN termination sub-interfaces cannot be created on a VCMP client.
GE0/0/2 GE0/0/1
PE1 PE2
GE0/0/2 GE0/0/1
GE0/0/1 P GE0/0/2
CE1 CE2
- Loopback1 - 1.1.1.1/32
- GigabitEthernet0/0 GigabitEthernet0/0 -
/2 /2.1
- Loopback1 - 3.3.3.3/32
- Loopback1 - 2.2.2.2/32
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure a routing protocol on PE and P devices of the backbone network to
implement interworking, and enable MPLS.
2. Use the default tunnel policy to create an LSP for data transmission.
3. Enable MPLS L2VPN and create VC connections on PEs.
4. Create a sub-interface on the interface of PE1 connected to CE1, configure
VLAN mapping of a single tag on the sub-interface, and create a VC to
connect the sub-interface to the VLL network.
5. Configure a Dot1q sub-interface on the interface of PE2 connected to CE2,
and create a VC to connect the sub-interface to the VLL network.
Procedure
Step 1 Add interfaces of CEs, PEs, and P to VLANs and configure IP addresses for the
VLANIF interfaces according to Figure 10-15.
# Configure CE1 to ensure that packets sent from CE1 to PE1 carry a VLAN tag.
<HUAWEI> system-view
[HUAWEI] sysname CE1
[CE1] vlan batch 10
[CE1] interface gigabitethernet 0/0/1
[CE1-GigabitEthernet0/0/1] port link-type trunk
[CE1-GigabitEthernet0/0/1] port trunk allow-pass vlan 10
[CE1-GigabitEthernet0/0/1] quit
[CE1] interface vlanif 10
[CE1-Vlanif10] ip address 10.10.10.1 24
[CE1-Vlanif10] quit
# Configure CE2 to ensure that packets sent from CE2 to PE2 carry a VLAN tag.
<HUAWEI> system-view
[HUAWEI] sysname CE2
[CE2] vlan batch 20
[CE2] interface gigabitethernet 0/0/1
[CE2-GigabitEthernet0/0/1] port link-type trunk
[CE2-GigabitEthernet0/0/1] port trunk allow-pass vlan 20
[CE2-GigabitEthernet0/0/1] quit
[CE2] interface vlanif 20
[CE2-Vlanif20] ip address 10.10.10.2 24
[CE2-Vlanif20] quit
# Configure PE1.
<HUAWEI> system-view
[HUAWEI] sysname PE1
[PE1] vlan batch 20
[PE1] interface gigabitethernet 0/0/2
[PE1-GigabitEthernet0/0/2] port link-type hybrid
[PE1-GigabitEthernet0/0/2] port hybrid pvid vlan 20
[PE1-GigabitEthernet0/0/2] port hybrid tagged vlan 20
[PE1-GigabitEthernet0/0/2] quit
[PE1] interface vlanif 20
[PE1-Vlanif20] ip address 10.1.1.1 24
[PE1-Vlanif20] quit
# Configure P.
<HUAWEI> system-view
[HUAWEI] sysname P
[P] vlan batch 20 30
[P] interface gigabitethernet 0/0/1
[P-GigabitEthernet0/0/1] port link-type hybrid
[P-GigabitEthernet0/0/1] port hybrid pvid vlan 30
[P-GigabitEthernet0/0/1] port hybrid tagged vlan 30
[P-GigabitEthernet0/0/1] quit
[P] interface gigabitethernet 0/0/2
[P-GigabitEthernet0/0/2] port link-type hybrid
[P-GigabitEthernet0/0/2] port hybrid pvid vlan 20
[P-GigabitEthernet0/0/2] port hybrid tagged vlan 20
[P-GigabitEthernet0/0/2] quit
[P] interface vlanif 20
[P-Vlanif20] ip address 10.1.1.2 24
[P-Vlanif20] quit
[P] interface vlanif 30
[P-Vlanif30] ip address 10.2.2.2 24
[P-Vlanif30] quit
# Configure PE2.
<HUAWEI> system-view
[HUAWEI] sysname PE2
[PE2] vlan batch 30
[PE2] interface gigabitethernet 0/0/1
[PE2-GigabitEthernet0/0/1] port link-type hybrid
[PE2-GigabitEthernet0/0/1] port hybrid pvid vlan 30
[PE2-GigabitEthernet0/0/1] port hybrid tagged vlan 30
[PE2-GigabitEthernet0/0/1] quit
[PE2] interface vlanif 30
[PE2-Vlanif30] ip address 10.2.2.1 24
[PE2-Vlanif30] quit
Step 2 Configure an IGP on the MPLS backbone network. OSPF is used in this example.
Configure PE1, P, and PE2 to advertise 32-bit loopback interface addresses as the
LSR IDs.
# Configure PE1.
[PE1] router id 1.1.1.1
[PE1] interface loopback 1
[PE1-LoopBack1] ip address 1.1.1.1 32
[PE1-LoopBack1] quit
[PE1] ospf 1
[PE1-ospf-1] area 0
[PE1-ospf-1-area-0.0.0.0] network 1.1.1.1 0.0.0.0
[PE1-ospf-1-area-0.0.0.0] network 10.1.1.1 0.0.0.255
[PE1-ospf-1-area-0.0.0.0] quit
[PE1-ospf-1] quit
# Configure P.
[P] router id 2.2.2.2
[P] interface loopback 1
[P-LoopBack1] ip address 2.2.2.2 32
[P-LoopBack1] quit
[P] ospf 1
[P-ospf-1] area 0
[P-ospf-1-area-0.0.0.0] network 2.2.2.2 0.0.0.0
[P-ospf-1-area-0.0.0.0] network 10.1.1.2 0.0.0.255
# Configure PE2.
[PE2] router id 3.3.3.3
[PE2] interface loopback 1
[PE2-LoopBack1] ip address 3.3.3.3 32
[PE2-LoopBack1] quit
[PE2] ospf 1
[PE2-ospf-1] area 0
[PE2-ospf-1-area-0.0.0.0] network 3.3.3.3 0.0.0.0
[PE2-ospf-1-area-0.0.0.0] network 10.2.2.1 0.0.0.255
[PE2-ospf-1-area-0.0.0.0] quit
[PE2-ospf-1] quit
# After the configuration is complete, PE1, P, and PE2 can establish OSPF neighbor
relationships. Run the display ospf peer command to verify that the OSPF
neighbor relationship status is Full. Run the display ip routing-table command to
verify that the PEs learn the route to the Loopback1 interface of each other. The
following is the display on PE1:
[PE1] display ospf peer
Step 3 Enable basic MPLS functions and MPLS LDP on the MPLS network.
# Configure PE1.
[PE1] mpls lsr-id 1.1.1.1
[PE1] mpls
[PE1-mpls] quit
[PE1] mpls ldp
[PE1-mpls-ldp] quit
[PE1] interface vlanif 20
[PE1-Vlanif20] mpls
[PE1-Vlanif20] mpls ldp
[PE1-Vlanif20] quit
# Configure P.
# Configure PE2.
[PE2] mpls lsr-id 3.3.3.3
[PE2] mpls
[PE2-mpls] quit
[PE2] mpls ldp
[PE2-mpls-ldp] quit
[PE2] interface vlanif 30
[PE2-Vlanif30] mpls
[PE2-Vlanif30] mpls ldp
[PE2-Vlanif30] quit
# Configure PE2.
[PE2] mpls ldp remote-peer 1.1.1.1
[PE2-mpls-ldp-remote-1.1.1.1] remote-ip 1.1.1.1
[PE2-mpls-ldp-remote-1.1.1.1] quit
After the configuration is complete, run the display mpls ldp session command
on PE1 to view the LDP session setup. You can see that an LDP session has been
set up between PE1 and PE2.
The output on PE1 is used as an example:
[PE1] display mpls ldp session
LDP Session(s) in Public Network
Codes: LAM(Label Advertisement Mode), SsnAge Unit(DDDD:HH:MM)
A '*' before a session means the session is being deleted.
------------------------------------------------------------------------------
PeerID Status LAM SsnRole SsnAge KASent/Rcv
------------------------------------------------------------------------------
2.2.2.2:0 Operational DU Passive 0000:15:29 3717/3717
3.3.3.3:0 Operational DU Passive 0000:00:00 2/2
------------------------------------------------------------------------------
TOTAL: 2 session(s) Found.
On PEs, check the L2VPN connections. You can see that an L2VC connection has
been set up and is in Up state.
----End
Configuration Files
● CE1 configuration file
#
sysname CE1
#
vlan batch 10
#
interface Vlanif10
ip address 10.10.10.1 255.255.255.0
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
return
remote-ip 3.3.3.3
#
interface Vlanif20
ip address 10.1.1.1 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet0/0/1
port link-type hybrid
#
interface GigabitEthernet0/0/1.1
qinq mapping vid 10 map-vlan vid 20
mpls l2vc 3.3.3.3 101
#
interface GigabitEthernet0/0/2
port link-type hybrid
port hybrid pvid vlan 20
port hybrid tagged vlan 20
#
interface LoopBack1
ip address 1.1.1.1 255.255.255.255
#
ospf 1
area 0.0.0.0
network 1.1.1.1 0.0.0.0
network 10.1.1.0 0.0.0.255
#
return
● P configuration file
#
sysname P
#
router id 2.2.2.2
#
vlan batch 20 30
#
mpls lsr-id 2.2.2.2
mpls
#
mpls ldp
#
interface Vlanif20
ip address 10.1.1.2 255.255.255.0
mpls
mpls ldp
#
interface Vlanif30
ip address 10.2.2.2 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet0/0/1
port link-type hybrid
port hybrid pvid vlan 30
port hybrid tagged vlan 30
#
interface GigabitEthernet0/0/2
port link-type hybrid
port hybrid pvid vlan 20
port hybrid tagged vlan 20
#
interface LoopBack1
ip address 2.2.2.2 255.255.255.255
#
ospf 1
area 0.0.0.0
network 2.2.2.2 0.0.0.0
network 10.1.1.0 0.0.0.255
network 10.2.2.0 0.0.0.255
#
return
Networking Requirements
As shown in Figure 10-16, CE1 and CE2 are connected to PE1 and PE2 respectively
through VLANs.
When Switch1 and Switch2 add different VLAN tags to packets, configure double-
tag VLAN mapping on PE sub-interfaces and connect the sub-interfaces to the VLL
network so that CE1 and CE2 can communicate with each other.
When a Switch is connected to multiple CEs, the Switch can add the same outer
VLAN tag to packets with different VLAN tags from different CEs, thereby saving
VLAN IDs on the public network.
NOTE
● Only the S5720EI, S5720HI, S6720EI, and S6720S-EI support this example.
● VLAN termination sub-interfaces cannot be created on a VCMP client.
GE0/0/2 GE0/0/1
PE1 PE2
GE0/0/2 GE0/0/1
GE0/0/1 P GE0/0/2
GE0/0/2 GE0/0/2
Switch1 Switch2
GE0/0/1 GE0/0/1
GE0/0/1 GE0/0/1
CE1 CE2
- Loopback1 - 1.1.1.1/32
- GigabitEthernet0/0 GigabitEthernet0/0 -
/2 /2.1
- Loopback1 - 3.3.3.3/32
- Loopback1 - 2.2.2.2/32
Configuration Roadmap
The configuration roadmap is as follows:
Procedure
Step 1 Configure the VLANs on the CE, PE, and P devices, add interfaces to the VLANs,
and assign IP addresses to the corresponding VLANIF interfaces according to
Figure 10-16.
# Configure CE1 to ensure that each packet sent from CE1 to Switch1 carries one
VLAN tag.
<HUAWEI> system-view
[HUAWEI] sysname CE1
[CE1] vlan batch 10
[CE1] interface gigabitethernet 0/0/1
[CE1-GigabitEthernet0/0/1] port link-type trunk
[CE1-GigabitEthernet0/0/1] port trunk allow-pass vlan 10
[CE1-GigabitEthernet0/0/1] quit
[CE1] interface vlanif 10
[CE1-Vlanif10] ip address 10.10.10.1 24
[CE1-Vlanif10] quit
# Configure CE2 to ensure that each packet sent from CE2 to Switch2 carries one
VLAN tag.
<HUAWEI> system-view
[HUAWEI] sysname CE2
[CE2] vlan batch 10
[CE2] interface gigabitethernet 0/0/1
[CE2-GigabitEthernet0/0/1] port link-type trunk
[CE2-GigabitEthernet0/0/1] port trunk allow-pass vlan 10
[CE2-GigabitEthernet0/0/1] quit
[CE2] interface vlanif 10
[CE2-Vlanif10] ip address 10.10.10.2 24
[CE2-Vlanif10] quit
# Configure PE1.
<HUAWEI> system-view
[HUAWEI] sysname PE1
[PE1] vlan batch 20
[PE1] interface gigabitethernet 0/0/2
[PE1-GigabitEthernet0/0/2] port link-type hybrid
[PE1-GigabitEthernet0/0/2] port hybrid pvid vlan 20
[PE1-GigabitEthernet0/0/2] port hybrid tagged vlan 20
[PE1-GigabitEthernet0/0/2] quit
[PE1] interface vlanif 20
[PE1-Vlanif20] ip address 10.1.1.1 24
[PE1-Vlanif20] quit
# Configure P.
<HUAWEI> system-view
[HUAWEI] sysname P
[P] vlan batch 20 30
[P] interface gigabitethernet 0/0/1
[P-GigabitEthernet0/0/1] port link-type hybrid
[P-GigabitEthernet0/0/1] port hybrid pvid vlan 30
[P-GigabitEthernet0/0/1] port hybrid tagged vlan 30
[P-GigabitEthernet0/0/1] quit
[P] interface gigabitethernet 0/0/2
[P-GigabitEthernet0/0/2] port link-type hybrid
[P-GigabitEthernet0/0/2] port hybrid pvid vlan 20
[P-GigabitEthernet0/0/2] port hybrid tagged vlan 20
[P-GigabitEthernet0/0/2] quit
[P] interface vlanif 20
[P-Vlanif20] ip address 10.1.1.2 24
[P-Vlanif20] quit
[P] interface vlanif 30
# Configure PE2.
<HUAWEI> system-view
[HUAWEI] sysname PE2
[PE2] vlan batch 30
[PE2] interface gigabitethernet 0/0/1
[PE2-GigabitEthernet0/0/1] port link-type hybrid
[PE2-GigabitEthernet0/0/1] port hybrid pvid vlan 30
[PE2-GigabitEthernet0/0/1] port hybrid tagged vlan 30
[PE2-GigabitEthernet0/0/1] quit
[PE2] interface vlanif 30
[PE2-Vlanif30] ip address 10.2.2.1 24
[PE2-Vlanif30] quit
Step 2 Configure selective QinQ on switch interfaces and specify the VLANs allowed by
the interfaces.
# Configure Switch1.
<HUAWEI> system-view
[HUAWEI] sysname Switch1
[Switch1] vlan 100
[Switch1-vlan100] quit
[Switch1] interface gigabitethernet0/0/2
[Switch1-GigabitEthernet0/0/2] port link-type hybrid
[Switch1-GigabitEthernet0/0/2] port hybrid tagged vlan 100
[Switch1-GigabitEthernet0/0/2] quit
[Switch1] interface gigabitethernet0/0/1
[Switch1-GigabitEthernet0/0/1] port link-type hybrid
[Switch1-GigabitEthernet0/0/1] port hybrid untagged vlan 100
[Switch1-GigabitEthernet0/0/1] qinq vlan-translation enable
[Switch1-GigabitEthernet0/0/1] port vlan-stacking vlan 10 stack-vlan 100
[Switch1-GigabitEthernet0/0/1] quit
# Configure Switch2.
<HUAWEI> system-view
[HUAWEI] sysname Switch2
[Switch2] vlan 200
[Switch2-vlan200] quit
[Switch2] interface gigabitethernet0/0/2
[Switch2-GigabitEthernet0/0/2] port link-type hybrid
[Switch2-GigabitEthernet0/0/2] port hybrid tagged vlan 200
[Switch2-GigabitEthernet0/0/2] quit
[Switch2] interface gigabitethernet0/0/1
[Switch2-GigabitEthernet0/0/1] port link-type hybrid
[Switch2-GigabitEthernet0/0/1] port hybrid untagged vlan 200
[Switch2-GigabitEthernet0/0/1] qinq vlan-translation enable
[Switch2-GigabitEthernet0/0/1] port vlan-stacking vlan 10 stack-vlan 200
[Switch2-GigabitEthernet0/0/1] quit
Step 3 Configure an IGP on the MPLS backbone network. OSPF is used in this example.
Configure PE1, P, and PE2 to advertise 32-bit loopback interface addresses as the
LSR IDs.
# Configure PE1.
[PE1] router id 1.1.1.1
[PE1] interface loopback 1
[PE1-LoopBack1] ip address 1.1.1.1 32
[PE1-LoopBack1] quit
[PE1] ospf 1
[PE1-ospf-1] area 0
[PE1-ospf-1-area-0.0.0.0] network 1.1.1.1 0.0.0.0
[PE1-ospf-1-area-0.0.0.0] network 10.1.1.1 0.0.0.255
[PE1-ospf-1-area-0.0.0.0] quit
[PE1-ospf-1] quit
# Configure P.
[P] router id 2.2.2.2
[P] interface loopback 1
[P-LoopBack1] ip address 2.2.2.2 32
[P-LoopBack1] quit
[P] ospf 1
[P-ospf-1] area 0
[P-ospf-1-area-0.0.0.0] network 2.2.2.2 0.0.0.0
[P-ospf-1-area-0.0.0.0] network 10.1.1.2 0.0.0.255
[P-ospf-1-area-0.0.0.0] network 10.2.2.2 0.0.0.255
[P-ospf-1-area-0.0.0.0] quit
[P-ospf-1] quit
# Configure PE2.
[PE2] router id 3.3.3.3
[PE2] interface loopback 1
[PE2-LoopBack1] ip address 3.3.3.3 32
[PE2-LoopBack1] quit
[PE2] ospf 1
[PE2-ospf-1] area 0
[PE2-ospf-1-area-0.0.0.0] network 3.3.3.3 0.0.0.0
[PE2-ospf-1-area-0.0.0.0] network 10.2.2.1 0.0.0.255
[PE2-ospf-1-area-0.0.0.0] quit
[PE2-ospf-1] quit
# After the configuration is complete, PE1, P, and PE2 can establish OSPF neighbor
relationships. Run the display ospf peer command to verify that the OSPF
neighbor relationship status is Full. Run the display ip routing-table command to
verify that the PEs learn the route to the Loopback1 interface of each other. The
following is the display on PE1:
[PE1] display ospf peer
Step 4 Enable basic MPLS functions and MPLS LDP on the MPLS network.
# Configure PE1.
# Configure P.
[P] mpls lsr-id 2.2.2.2
[P] mpls
[P-mpls] quit
[P] mpls ldp
[P-mpls-ldp] quit
[P] interface vlanif 20
[P-Vlanif20] mpls
[P-Vlanif20] mpls ldp
[P-Vlanif20] quit
[P] interface vlanif 30
[P-Vlanif30] mpls
[P-Vlanif30] mpls ldp
[P-Vlanif30] quit
# Configure PE2.
[PE2] mpls lsr-id 3.3.3.3
[PE2] mpls
[PE2-mpls] quit
[PE2] mpls ldp
[PE2-mpls-ldp] quit
[PE2] interface vlanif 30
[PE2-Vlanif30] mpls
[PE2-Vlanif30] mpls ldp
[PE2-Vlanif30] quit
# Configure PE2.
[PE2] mpls ldp remote-peer 1.1.1.1
[PE2-mpls-ldp-remote-1.1.1.1] remote-ip 1.1.1.1
[PE2-mpls-ldp-remote-1.1.1.1] quit
After the configuration is complete, run the display mpls ldp session command
on PE1 to view the LDP session setup. You can see that an LDP session has been
set up between PE1 and PE2.
[PE1] display mpls ldp session
LDP Session(s) in Public Network
Codes: LAM(Label Advertisement Mode), SsnAge Unit(DDDD:HH:MM)
A '*' before a session means the session is being deleted.
------------------------------------------------------------------------------
PeerID Status LAM SsnRole SsnAge KASent/Rcv
------------------------------------------------------------------------------
2.2.2.2:0 Operational DU Passive 0000:15:29 3717/3717
3.3.3.3:0 Operational DU Passive 0000:00:00 2/2
------------------------------------------------------------------------------
TOTAL: 2 session(s) Found.
----End
Configuration Files
● CE1 configuration file
#
sysname CE1
#
vlan batch 10
#
interface Vlanif10
ip address 10.10.10.1 255.255.255.0
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
return
interface Vlanif20
ip address 10.1.1.2 255.255.255.0
mpls
mpls ldp
#
interface Vlanif30
ip address 10.2.2.2 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet0/0/1
port link-type hybrid
port hybrid pvid vlan 30
port hybrid tagged vlan 30
#
interface GigabitEthernet0/0/2
port link-type hybrid
port hybrid pvid vlan 20
port hybrid tagged vlan 20
#
interface LoopBack1
ip address 2.2.2.2 255.255.255.255
#
ospf 1
area 0.0.0.0
network 2.2.2.2 0.0.0.0
network 10.1.1.0 0.0.0.255
network 10.2.2.0 0.0.0.255
#
return
● PE2 configuration file
#
sysname PE2
#
router id 3.3.3.3
#
vcmp role silent
#
vlan batch 30
#
mpls lsr-id 3.3.3.3
mpls
#
mpls l2vpn
#
mpls ldp
#
mpls ldp remote-peer 1.1.1.1
remote-ip 1.1.1.1
#
interface Vlanif30
ip address 10.2.2.1 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet0/0/1
port link-type hybrid
port hybrid pvid vlan 30
port hybrid tagged vlan 30
#
interface GigabitEthernet0/0/2
port link-type hybrid
#
interface GigabitEthernet0/0/2.1
qinq termination pe-vid 200 ce-vid 10
mpls l2vc 1.1.1.1 101
#
interface LoopBack1
ip address 3.3.3.3 255.255.255.255
#
ospf 1
area 0.0.0.0
network 3.3.3.3 0.0.0.0
network 10.2.2.0 0.0.0.255
#
return
When a Switch is connected to multiple CEs, the Switch can add the same outer
VLAN tag to packets with different VLAN tags from different CEs, thereby saving
VLAN IDs on the public network.
NOTE
● Only the S5720EI, S5720HI, S6720EI, and S6720S-EI support this example.
● VLAN termination sub-interfaces cannot be created on a VCMP client.
GE0/0/2 GE0/0/1
PE1 PE2
GE0/0/2 GE0/0/1
GE0/0/1 P GE0/0/2
GE0/0/2 GE0/0/2
Switch1 Switch2
GE0/0/1 GE0/0/1
GE0/0/1 GE0/0/1
CE1 CE2
- Loopback1 - 1.1.1.1/32
- GigabitEthernet0/0 GigabitEthernet0/0 -
/2 /2.1
- Loopback1 - 3.3.3.3/32
- Loopback1 - 2.2.2.2/32
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure a routing protocol on PE and P devices of the backbone network to
implement interworking, and enable MPLS.
2. Use the default tunnel policy to create an LSP for data transmission.
3. Enable MPLS L2VPN and create VC connections on PEs.
4. On PE1, configure VLAN stacking on the sub-interface connected to Switch1,
and create a VC to connect the sub-interface to a VLL network.
5. On PE2, configure a QinQ sub-interface on the interface connected to
Switch2, and create a VC connect the QinQ sub-interface to a VLL network.
6. On Switch1, add the interface connected to CE1 to a specified VLAN.
7. On Switch2, configure selective QinQ on the interface connected to CE2.
Procedure
Step 1 Create VLANs on the CE, PE, and P devices, add interfaces to the VLANs, and
assign IP addresses to VLANIF interfaces according to Figure 10-17.
# Configure CE1 to ensure that each packet sent from CE1 to Switch1 carries one
VLAN tag.
<HUAWEI> system-view
[HUAWEI] sysname CE1
[CE1] vlan batch 10
[CE1] interface gigabitethernet 0/0/1
[CE1-GigabitEthernet0/0/1] port link-type trunk
[CE1-GigabitEthernet0/0/1] port trunk allow-pass vlan 10
[CE1-GigabitEthernet0/0/1] quit
[CE1] interface vlanif 10
[CE1-Vlanif10] ip address 10.10.10.1 24
[CE1-Vlanif10] quit
# Configure CE2 to ensure that each packet sent from CE2 to Switch2 carries one
VLAN tag.
<HUAWEI> system-view
[HUAWEI] sysname CE2
[CE2] vlan batch 10
[CE2] interface gigabitethernet 0/0/1
[CE2-GigabitEthernet0/0/1] port link-type trunk
[CE2-GigabitEthernet0/0/1] port trunk allow-pass vlan 10
[CE2-GigabitEthernet0/0/1] quit
[CE2] interface vlanif 10
[CE2-Vlanif10] ip address 10.10.10.2 24
[CE2-Vlanif10] quit
# Configure PE1.
<HUAWEI> system-view
[HUAWEI] sysname PE1
[PE1] vlan batch 20
[PE1] interface gigabitethernet 0/0/2
[PE1-GigabitEthernet0/0/2] port link-type hybrid
[PE1-GigabitEthernet0/0/2] port hybrid pvid vlan 20
[PE1-GigabitEthernet0/0/2] port hybrid tagged vlan 20
[PE1-GigabitEthernet0/0/2] quit
[PE1] interface vlanif 20
[PE1-Vlanif20] ip address 10.1.1.1 24
[PE1-Vlanif20] quit
# Configure P.
<HUAWEI> system-view
[HUAWEI] sysname P
[P] vlan batch 20 30
[P] interface gigabitethernet 0/0/1
[P-GigabitEthernet0/0/1] port link-type hybrid
[P-GigabitEthernet0/0/1] port hybrid pvid vlan 30
[P-GigabitEthernet0/0/1] port hybrid tagged vlan 30
[P-GigabitEthernet0/0/1] quit
[P] interface gigabitethernet 0/0/2
[P-GigabitEthernet0/0/2] port link-type hybrid
[P-GigabitEthernet0/0/2] port hybrid pvid vlan 20
[P-GigabitEthernet0/0/2] port hybrid tagged vlan 20
[P-GigabitEthernet0/0/2] quit
[P] interface vlanif 20
[P-Vlanif20] ip address 10.1.1.2 24
[P-Vlanif20] quit
[P] interface vlanif 30
[P-Vlanif30] ip address 10.2.2.2 24
[P-Vlanif30] quit
# Configure PE2.
<HUAWEI> system-view
[HUAWEI] sysname PE2
[PE2] vlan batch 30
[PE2] interface gigabitethernet 0/0/1
[PE2-GigabitEthernet0/0/1] port link-type hybrid
[PE2-GigabitEthernet0/0/1] port hybrid pvid vlan 30
[PE2-GigabitEthernet0/0/1] port hybrid tagged vlan 30
[PE2-GigabitEthernet0/0/1] quit
[PE2] interface vlanif 30
[PE2-Vlanif30] ip address 10.2.2.1 24
[PE2-Vlanif30] quit
Step 2 Configure selective QinQ on switch interfaces and specify the VLANs allowed by
the interfaces.
# Configure Switch1.
<HUAWEI> system-view
[HUAWEI] sysname Switch1
[Switch1] vlan 10
[Switch1-vlan10] quit
# Configure Switch2.
<HUAWEI> system-view
[HUAWEI] sysname Switch2
[Switch2] vlan 100
[Switch2-vlan100] quit
[Switch2] interface gigabitethernet0/0/2
[Switch2-GigabitEthernet0/0/2] port link-type hybrid
[Switch2-GigabitEthernet0/0/2] port hybrid tagged vlan 100
[Switch2-GigabitEthernet0/0/2] quit
[Switch2] interface gigabitethernet0/0/1
[Switch2-GigabitEthernet0/0/1] port link-type hybrid
[Switch2-GigabitEthernet0/0/1] port hybrid untagged vlan 100
[Switch2-GigabitEthernet0/0/1] qinq vlan-translation enable
[Switch2-GigabitEthernet0/0/1] port vlan-stacking vlan 10 stack-vlan 100
[Switch2-GigabitEthernet0/0/1] quit
Step 3 Configure an IGP on the MPLS backbone network. OSPF is used in this example.
Configure PE1, P, and PE2 to advertise 32-bit loopback interface addresses as the
LSR IDs.
# Configure PE1.
[PE1] router id 1.1.1.1
[PE1] interface loopback 1
[PE1-LoopBack1] ip address 1.1.1.1 32
[PE1-LoopBack1] quit
[PE1] ospf 1
[PE1-ospf-1] area 0
[PE1-ospf-1-area-0.0.0.0] network 1.1.1.1 0.0.0.0
[PE1-ospf-1-area-0.0.0.0] network 10.1.1.1 0.0.0.255
[PE1-ospf-1-area-0.0.0.0] quit
[PE1-ospf-1] quit
# Configure P.
[P] router id 2.2.2.2
[P] interface loopback 1
[P-LoopBack1] ip address 2.2.2.2 32
[P-LoopBack1] quit
[P] ospf 1
[P-ospf-1] area 0
[P-ospf-1-area-0.0.0.0] network 2.2.2.2 0.0.0.0
[P-ospf-1-area-0.0.0.0] network 10.1.1.2 0.0.0.255
[P-ospf-1-area-0.0.0.0] network 10.2.2.2 0.0.0.255
[P-ospf-1-area-0.0.0.0] quit
[P-ospf-1] quit
# Configure PE2.
[PE2] router id 3.3.3.3
[PE2] interface loopback 1
[PE2-LoopBack1] ip address 3.3.3.3 32
[PE2-LoopBack1] quit
[PE2] ospf 1
[PE2-ospf-1] area 0
[PE2-ospf-1-area-0.0.0.0] network 3.3.3.3 0.0.0.0
[PE2-ospf-1-area-0.0.0.0] network 10.2.2.1 0.0.0.255
[PE2-ospf-1-area-0.0.0.0] quit
[PE2-ospf-1] quit
# After the configuration is complete, PE1, P, and PE2 can establish OSPF neighbor
relationships. Run the display ospf peer command to verify that the OSPF
neighbor relationship status is Full. Run the display ip routing-table command to
verify that the PEs learn the route to the Loopback1 interface of each other. The
following is the display on PE1:
[PE1] display ospf peer
Step 4 Enable basic MPLS functions and MPLS LDP on the MPLS network.
# Configure PE1.
[PE1] mpls lsr-id 1.1.1.1
[PE1] mpls
[PE1-mpls] quit
[PE1] mpls ldp
[PE1-mpls-ldp] quit
[PE1] interface vlanif 20
[PE1-Vlanif20] mpls
[PE1-Vlanif20] mpls ldp
[PE1-Vlanif20] quit
# Configure P.
[P] mpls lsr-id 2.2.2.2
[P] mpls
[P-mpls] quit
[P] mpls ldp
[P-mpls-ldp] quit
[P] interface vlanif 20
[P-Vlanif20] mpls
[P-Vlanif20] mpls ldp
[P-Vlanif20] quit
[P] interface vlanif 30
[P-Vlanif30] mpls
[P-Vlanif30] mpls ldp
[P-Vlanif30] quit
# Configure PE2.
[PE2] mpls lsr-id 3.3.3.3
[PE2] mpls
[PE2-mpls] quit
[PE2] mpls ldp
[PE2-mpls-ldp] quit
[PE2] interface vlanif 30
[PE2-Vlanif30] mpls
[PE2-Vlanif30] mpls ldp
[PE2-Vlanif30] quit
# Configure PE1.
[PE1] mpls ldp remote-peer 3.3.3.3
[PE1-mpls-ldp-remote-3.3.3.3] remote-ip 3.3.3.3
[PE1-mpls-ldp-remote-3.3.3.3] quit
# Configure PE2.
[PE2] mpls ldp remote-peer 1.1.1.1
[PE2-mpls-ldp-remote-1.1.1.1] remote-ip 1.1.1.1
[PE2-mpls-ldp-remote-1.1.1.1] quit
After the configuration is complete, run the display mpls ldp session command
on PE1 to view the LDP session setup. You can see that an LDP session is set up
between PE1 and PE2.
[PE1] display mpls ldp session
LDP Session(s) in Public Network
Codes: LAM(Label Advertisement Mode), SsnAge Unit(DDDD:HH:MM)
A '*' before a session means the session is being deleted.
------------------------------------------------------------------------------
PeerID Status LAM SsnRole SsnAge KASent/Rcv
------------------------------------------------------------------------------
2.2.2.2:0 Operational DU Passive 0000:15:29 3717/3717
3.3.3.3:0 Operational DU Passive 0000:00:00 2/2
------------------------------------------------------------------------------
TOTAL: 2 session(s) Found.
Check the L2VPN connections on PEs. You can see that an L2VC connection has
been set up and is in Up state.
----End
Configuration Files
● CE1 configuration file
#
sysname CE1
#
vlan batch 10
#
interface Vlanif10
ip address 10.10.10.1 255.255.255.0
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
return
#
interface Vlanif20
ip address 10.1.1.1 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet0/0/1
port link-type hybrid
#
interface GigabitEthernet0/0/1.1
qinq stacking vid 10 pe-vid 100
mpls l2vc 3.3.3.3 101
#
interface GigabitEthernet0/0/2
port link-type hybrid
port hybrid pvid vlan 20
port hybrid tagged vlan 20
#
interface LoopBack1
ip address 1.1.1.1 255.255.255.255
#
ospf 1
area 0.0.0.0
network 1.1.1.1 0.0.0.0
network 10.1.1.0 0.0.0.255
#
return
● P configuration file
#
sysname P
#
router id 2.2.2.2
#
vlan batch 20 30
#
mpls lsr-id 2.2.2.2
mpls
#
mpls ldp
#
interface Vlanif20
ip address 10.1.1.2 255.255.255.0
mpls
mpls ldp
#
interface Vlanif30
ip address 10.2.2.2 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet0/0/1
port link-type hybrid
port hybrid pvid vlan 30
port hybrid tagged vlan 30
#
interface GigabitEthernet0/0/2
port link-type hybrid
port hybrid pvid vlan 20
port hybrid tagged vlan 20
#
interface LoopBack1
ip address 2.2.2.2 255.255.255.255
#
ospf 1
area 0.0.0.0
network 2.2.2.2 0.0.0.0
network 10.1.1.0 0.0.0.255
network 10.2.2.0 0.0.0.255
#
return
● PE2 configuration file
#
sysname PE2
#
router id 3.3.3.3
#
vcmp role silent
#
vlan batch 30
#
mpls lsr-id 3.3.3.3
mpls
#
mpls l2vpn
#
mpls ldp
#
mpls ldp remote-peer 1.1.1.1
remote-ip 1.1.1.1
#
interface Vlanif30
ip address 10.2.2.1 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet0/0/1
port link-type hybrid
port hybrid pvid vlan 30
port hybrid tagged vlan 30
#
interface GigabitEthernet0/0/2.1
qinq termination pe-vid 100 ce-vid 10
mpls l2vc 1.1.1.1 101
#
interface LoopBack1
ip address 3.3.3.3 255.255.255.255
#
ospf 1
area 0.0.0.0
network 3.3.3.3 0.0.0.0
network 10.2.2.0 0.0.0.255
#
return
● Switch2 configuration file
#
sysname Switch2
#
vlan batch 100
#
interface GigabitEthernet0/0/1
port link-type hybrid
qinq vlan-translation enable
port hybrid untagged vlan 100
port vlan-stacking vlan 10 stack-vlan 100
#
interface GigabitEthernet0/0/2
port link-type hybrid
port hybrid tagged vlan 100
#
return
● CE2 configuration file
#
sysname CE2
#
vlan batch 10
#
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
#
return
NOTE
● Only the S5720EI, S5720HI, S6720EI, and S6720S-EI support this example.
● VLAN termination sub-interfaces cannot be created on a VCMP client.
GE0/0/1 GE0/0/2
PE1 PE2
GE0/0/2 GE0/0/1
GE0/0/1 P GE0/0/2
GE0/0/1 GE0/0/1
CE1 CE2
- Loopback1 - 1.1.1.1/32
- GigabitEthernet0/0 GigabitEthernet0/0 -
/2 /2.1
- Loopback1 - 3.3.3.3/32
- Loopback1 - 2.2.2.2/32
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure a routing protocol on the backbone network to implement
interworking between devices.
2. Set up a remote LDP session between PEs.
3. Establish tunnels between PEs to transmit service data.
4. Enable MPLS L2VPN on the PEs.
5. Create a VSI on the PEs and specify LDP as the signaling protocol.
6. Configure single-tag VLAN mapping on the PE1 sub-interface connected to
CE1 and bind the sub-interface the VSI to connect it to the VPLS network.
7. Configure a Dot1q sub-interface on the interface of PE2 connected to CE2 and
bind the sub-interface to the VSI to connect it to the VPLS network.
Procedure
Step 1 Create VLANs on the CE, PE, and P devices, add interfaces to the VLANs, and
assign IP addresses to VLANIF interfaces according to Figure 10-18.
NOTE
● The AC-side and PW-side physical interfaces of a PE cannot be added to the same
VLAN; otherwise, a loop may occur.
● After the configuration is complete, the packets sent from a CE to a PE must carry a
VLAN tag.
# Configure CE1.
<HUAWEI> system-view
[HUAWEI] sysname CE1
[CE1] vlan batch 10
[CE1] interface gigabitethernet 0/0/1
[CE1-GigabitEthernet0/0/1] port link-type trunk
[CE1-GigabitEthernet0/0/1] port trunk allow-pass vlan 10
[CE1-GigabitEthernet0/0/1] quit
[CE1] interface vlanif 10
[CE1-Vlanif10] ip address 10.1.1.1 24
[CE1-Vlanif10] quit
# Configure CE2.
<HUAWEI> system-view
[HUAWEI] sysname CE2
[CE2] vlan batch 20
[CE2] interface gigabitethernet 0/0/1
[CE2-GigabitEthernet0/0/1] port link-type trunk
[CE2-GigabitEthernet0/0/1] port trunk allow-pass vlan 20
[CE2-GigabitEthernet0/0/1] quit
[CE2] interface vlanif 20
[CE2-Vlanif20] ip address 10.1.1.2 24
[CE2-Vlanif20] quit
# Configure PE1.
<HUAWEI> system-view
[HUAWEI] sysname PE1
[PE1] vlan batch 20
[PE1] interface gigabitethernet 0/0/2
[PE1-GigabitEthernet0/0/2] port link-type hybrid
[PE1-GigabitEthernet0/0/2] port hybrid pvid vlan 20
[PE1-GigabitEthernet0/0/2] port hybrid tagged vlan 20
[PE1-GigabitEthernet0/0/2] quit
[PE1] interface vlanif 20
[PE1-Vlanif20] ip address 4.4.4.4 24
[PE1-Vlanif20] quit
# Configure P.
<HUAWEI> system-view
[HUAWEI] sysname P
[P] vlan batch 20 30
[P] interface gigabitethernet 0/0/1
[P-GigabitEthernet0/0/1] port link-type hybrid
[P-GigabitEthernet0/0/1] port hybrid pvid vlan 20
[P-GigabitEthernet0/0/1] port hybrid tagged vlan 20
[P-GigabitEthernet0/0/1] quit
[P] interface gigabitethernet 0/0/2
[P-GigabitEthernet0/0/2] port link-type hybrid
[P-GigabitEthernet0/0/2] port hybrid pvid vlan 30
[P-GigabitEthernet0/0/2] port hybrid tagged vlan 30
[P-GigabitEthernet0/0/2] quit
[P] interface vlanif 20
[P-Vlanif20] ip address 4.4.4.5 24
[P-Vlanif20] quit
[P] interface vlanif 30
[P-Vlanif30] ip address 5.5.5.4 24
[P-Vlanif30] quit
# Configure PE2.
<HUAWEI> system-view
[HUAWEI] sysname PE2
[PE2] vlan batch 30
[PE2] interface gigabitethernet 0/0/1
[PE2-GigabitEthernet0/0/1] port link-type hybrid
[PE2-GigabitEthernet0/0/1] port hybrid pvid vlan 30
[PE2-GigabitEthernet0/0/1] port hybrid tagged vlan 30
[PE2-GigabitEthernet0/0/1] quit
[PE2] interface vlanif 30
[PE2-Vlanif30] ip address 5.5.5.5 24
[PE2-Vlanif30] quit
# Configure P.
[P] router id 2.2.2.2
[P] interface loopback 1
[P-LoopBack1] ip address 2.2.2.2 32
[P-LoopBack1] quit
[P] ospf 1
[P-ospf-1] area 0
[P-ospf-1-area-0.0.0.0] network 2.2.2.2 0.0.0.0
[P-ospf-1-area-0.0.0.0] network 4.4.4.5 0.0.0.255
[P-ospf-1-area-0.0.0.0] network 5.5.5.4 0.0.0.255
[P-ospf-1-area-0.0.0.0] quit
[P-ospf-1] quit
# Configure PE2.
[PE2] router id 3.3.3.3
[PE2] interface loopback 1
[PE2-LoopBack1] ip address 3.3.3.3 32
[PE2-LoopBack1] quit
[PE2] ospf 1
[PE2-ospf-1] area 0
[PE2-ospf-1-area-0.0.0.0] network 3.3.3.3 0.0.0.0
[PE2-ospf-1-area-0.0.0.0] network 5.5.5.5 0.0.0.255
[PE2-ospf-1-area-0.0.0.0] quit
[PE2-ospf-1] quit
# Configure P.
[P] mpls lsr-id 2.2.2.2
[P] mpls
[P-mpls] quit
[P] mpls ldp
[P-mpls-ldp] quit
[P] interface vlanif 20
[P-Vlanif20] mpls
[P-Vlanif20] mpls ldp
[P-Vlanif20] quit
[P] interface vlanif 30
[P-Vlanif30] mpls
[P-Vlanif30] mpls ldp
[P-Vlanif30] quit
# Configure PE2.
[PE2] mpls lsr-id 3.3.3.3
[PE2] mpls
[PE2-mpls] quit
[PE2] mpls ldp
[PE2-mpls-ldp] quit
[PE2] interface vlanif 30
[PE2-Vlanif30] mpls
[PE2-Vlanif30] mpls ldp
[PE2-Vlanif30] quit
After the configuration is complete, run the display mpls ldp session command
on PE1, P, and PE2. You can see that the peer relationships are set up between PE1
and P, and between P and PE2. The status of the peer relationship is Operational.
Run the display mpls ldp command to view the MPLS LDP configuration. The
following is the display on PE1:
[PE1] display mpls ldp session
LDP Session(s) in Public Network
Codes: LAM(Label Advertisement Mode), SsnAge Unit(DDDD:HH:MM)
A '*' before a session means the session is being deleted.
------------------------------------------------------------------------------
PeerID Status LAM SsnRole SsnAge KASent/Rcv
------------------------------------------------------------------------------
2.2.2.2:0 Operational DU Passive 0000:15:29 3717/3717
------------------------------------------------------------------------------
TOTAL: 1 session(s) Found.
# Configure PE2.
[PE2] mpls ldp remote-peer 1.1.1.1
[PE2-mpls-ldp-remote-1.1.1.1] remote-ip 1.1.1.1
[PE2-mpls-ldp-remote-1.1.1.1] quit
After the configuration is complete, run the display mpls ldp session command
on PE1 or PE2. You can see that the peer status is Operational, indicating that a
peer relationship has been set up between PE1 and PE2. The display on PE1 is
used as an example.
[PE1] display mpls ldp session
LDP Session(s) in Public Network
Codes: LAM(Label Advertisement Mode), SsnAge Unit(DDDD:HH:MM)
A '*' before a session means the session is being deleted.
------------------------------------------------------------------------------
PeerID Status LAM SsnRole SsnAge KASent/Rcv
------------------------------------------------------------------------------
2.2.2.2:0 Operational DU Passive 0000:15:29 3717/3717
3.3.3.3:0 Operational DU Passive 0000:00:00 2/2
------------------------------------------------------------------------------
TOTAL: 2 session(s) Found.
# Configure PE2.
[PE2] mpls l2vpn
[PE2-l2vpn] quit
# Configure PE2.
[PE2] vsi a2 static
[PE2-vsi-a2] pwsignal ldp
[PE2-vsi-a2-ldp] vsi-id 2
[PE2-vsi-a2-ldp] peer 1.1.1.1
[PE2-vsi-a2-ldp] quit
[PE2-vsi-a2] quit
# Configure PE2.
[PE2] vcmp role silent
[PE2] interface gigabitethernet0/0/2
[PE2-GigabitEthernet0/0/2] port link-type hybrid
[PE2-GigabitEthernet0/0/2] quit
[PE2] interface gigabitethernet0/0/2.1
[PE2-GigabitEthernet0/0/2.1] dot1q termination vid 20
[PE2-GigabitEthernet0/0/2.1] l2 binding vsi a2
[PE2-GigabitEthernet0/0/2.1] quit
After the configuration is complete, run the display vsi name a2 verbose
command on PE1. You can see that the VSI a2 sets up a PW to PE2 and the VSI
status is Up.
[PE1] display vsi name a2 verbose
***VSI Name : a2
Administrator VSI : no
Isolate Spoken : disable
VSI Index :0
PW Signaling : ldp
Member Discovery Style : static
PW MAC Learn Style : unqualify
Encapsulation Type : vlan
MTU : 1500
Diffserv Mode : uniform
Mpls Exp : --
DomainId : 255
Domain Name :
Ignore AcState : disable
P2P VSI : disable
Create Time : 0 days, 0 hours, 5 minutes, 1 seconds
VSI State : up
VSI ID :2
*Peer Router ID : 3.3.3.3
Negotiation-vc-id :2
primary or secondary : primary
ignore-standby-state : no
VC Label : 23552
Peer Type : dynamic
Session : up
Tunnel ID : 0x22
Broadcast Tunnel ID : 0x22
Broad BackupTunnel ID : 0x0
CKey :2
NKey :1
Stp Enable :0
PwIndex :0
Control Word : disable
**PW Information:
----End
Configuration Files
● CE1 configuration file
#
sysname CE1
#
vlan batch 10
#
interface Vlanif10
ip address 10.1.1.1 255.255.255.0
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
return
interface Vlanif20
ip address 4.4.4.5 255.255.255.0
mpls
mpls ldp
#
interface Vlanif30
ip address 5.5.5.4 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet0/0/1
port link-type hybrid
port hybrid pvid vlan 20
port hybrid tagged vlan 20
#
interface GigabitEthernet0/0/2
port link-type hybrid
port hybrid pvid vlan 30
port hybrid tagged vlan 30
#
interface LoopBack1
ip address 2.2.2.2 255.255.255.255
#
ospf 1
area 0.0.0.0
network 2.2.2.2 0.0.0.0
network 4.4.4.0 0.0.0.255
network 5.5.5.0 0.0.0.255
#
return
● PE2 configuration file
#
sysname PE2
#
router id 3.3.3.3
#
vcmp role silent
#
vlan batch 30
#
mpls lsr-id 3.3.3.3
mpls
#
mpls l2vpn
#
vsi a2 static
pwsignal ldp
vsi-id 2
peer 1.1.1.1
#
mpls ldp
#
mpls ldp remote-peer 1.1.1.1
remote-ip 1.1.1.1
#
interface Vlanif30
ip address 5.5.5.5 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet0/0/1
port link-type hybrid
port hybrid pvid vlan 30
port hybrid tagged vlan 30
#
interface GigabitEthernet0/0/2
port link-type hybrid
#
interface GigabitEthernet0/0/2.1
NOTE
● Only the S5720EI, S5720HI, S6720EI, and S6720S-EI support this example.
● VLAN termination sub-interfaces cannot be created on a VCMP client.
GE0/0/2 GE0/0/2
PE1 PE2
GE0/0/1 GE0/0/1
GE0/0/1 P GE0/0/2
GE0/0/2 GE0/0/2
Switch1 Switch2
GE0/0/1 GE0/0/1
GE0/0/1 GE0/0/1
CE1 CE2
- Loopback1 - 1.1.1.1/32
- GigabitEthernet0/0 GigabitEthernet0/0 -
/2 /2.1
- Loopback1 - 3.3.3.3/32
- Loopback1 - 2.2.2.2/32
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure a routing protocol on the backbone network to implement
interworking.
2. Configure selective QinQ on the switch interfaces connected to CEs.
3. Set up a remote LDP session between PEs.
4. Establish tunnels between PEs to transmit service data.
5. Enable MPLS L2VPN on the PEs.
6. Create a VSI on the PEs and specify LDP as the signaling protocol.
7. Configure double-tag VLAN mapping on the sub-interface connected to
Switch1 on PE1 and bind the sub-interface to the VSI to connect it to the
VPLS network.
8. Configure a QinQ sub-interface on the interface connected to Switch2 on PE2
and bind the sub-interface to the VSI to connect it to the VPLS network.
Procedure
Step 1 Create VLANs on the devices, add interfaces to the VLANs, and assign IP addresses
to VLANIF interfaces according to Figure 10-19.
NOTE
● The AC-side and PW-side physical interfaces of a PE cannot be added to the same
VLAN; otherwise, a loop may occur.
● Ensure that each packet sent from a CE to the Switch carries one VLAN tag.
# Configure CE1.
<HUAWEI> system-view
[HUAWEI] sysname CE1
[CE1] vlan batch 10
[CE1] interface gigabitethernet 0/0/1
[CE1-GigabitEthernet0/0/1] port link-type trunk
[CE1-GigabitEthernet0/0/1] port trunk allow-pass vlan 10
[CE1-GigabitEthernet0/0/1] quit
[CE1] interface vlanif 10
[CE1-Vlanif10] ip address 10.1.1.1 24
[CE1-Vlanif10] quit
# Configure CE2.
<HUAWEI> system-view
[HUAWEI] sysname CE2
[CE2] vlan batch 10
# Configure PE1.
<HUAWEI> system-view
[HUAWEI] sysname PE1
[PE1] vlan batch 20
[PE1] interface gigabitethernet 0/0/2
[PE1-GigabitEthernet0/0/2] port link-type hybrid
[PE1-GigabitEthernet0/0/2] port hybrid pvid vlan 20
[PE1-GigabitEthernet0/0/2] port hybrid tagged vlan 20
[PE1-GigabitEthernet0/0/2] quit
[PE1] interface vlanif 20
[PE1-Vlanif20] ip address 4.4.4.4 24
[PE1-Vlanif20] quit
# Configure P.
<HUAWEI> system-view
[HUAWEI] sysname P
[P] vlan batch 20 30
[P] interface gigabitethernet 0/0/1
[P-GigabitEthernet0/0/1] port link-type hybrid
[P-GigabitEthernet0/0/1] port hybrid pvid vlan 20
[P-GigabitEthernet0/0/1] port hybrid tagged vlan 20
[P-GigabitEthernet0/0/1] quit
[P] interface gigabitethernet 0/0/2
[P-GigabitEthernet0/0/2] port link-type hybrid
[P-GigabitEthernet0/0/2] port hybrid pvid vlan 30
[P-GigabitEthernet0/0/2] port hybrid tagged vlan 30
[P-GigabitEthernet0/0/2] quit
[P] interface vlanif 20
[P-Vlanif20] ip address 4.4.4.5 24
[P-Vlanif20] quit
[P] interface vlanif 30
[P-Vlanif30] ip address 5.5.5.4 24
[P-Vlanif30] quit
# Configure PE2.
<HUAWEI> system-view
[HUAWEI] sysname PE2
[PE2] vlan batch 30
[PE2] interface gigabitethernet 0/0/1
[PE2-GigabitEthernet0/0/1] port link-type hybrid
[PE2-GigabitEthernet0/0/1] port hybrid pvid vlan 30
[PE2-GigabitEthernet0/0/1] port hybrid tagged vlan 30
[PE2-GigabitEthernet0/0/1] quit
[PE2] interface vlanif 30
[PE2-Vlanif30] ip address 5.5.5.5 24
[PE2-Vlanif30] quit
Step 2 Configure selective QinQ on switch interfaces and specify the VLANs allowed by
the interfaces.
# Configure Switch1.
<HUAWEI> system-view
[HUAWEI] sysname Switch1
[Switch1] vlan 100
[Switch1-vlan100] quit
[Switch1] interface gigabitethernet0/0/2
[Switch1-GigabitEthernet0/0/2] port link-type hybrid
[Switch1-GigabitEthernet0/0/2] port hybrid tagged vlan 100
[Switch1-GigabitEthernet0/0/2] quit
[Switch1] interface gigabitethernet0/0/1
[Switch1-GigabitEthernet0/0/1] port link-type hybrid
[Switch1-GigabitEthernet0/0/1] qinq vlan-translation enable
[Switch1-GigabitEthernet0/0/1] port hybrid untagged vlan 100
[Switch1-GigabitEthernet0/0/1] port vlan-stacking vlan 10 stack-vlan 100
[Switch1-GigabitEthernet0/0/1] quit
# Configure Switch2.
<HUAWEI> system-view
[HUAWEI] sysname Switch2
[Switch2] vlan 200
[Switch2-vlan200] quit
[Switch2] interface gigabitethernet0/0/2
[Switch2-GigabitEthernet0/0/2] port link-type hybrid
[Switch2-GigabitEthernet0/0/2] port hybrid tagged vlan 200
[Switch2-GigabitEthernet0/0/2] quit
[Switch2] interface gigabitethernet0/0/1
[Switch2-GigabitEthernet0/0/1] port link-type hybrid
[Switch2-GigabitEthernet0/0/1] qinq vlan-translation enable
[Switch2-GigabitEthernet0/0/1] port hybrid untagged vlan 200
[Switch2-GigabitEthernet0/0/1] port vlan-stacking vlan 10 stack-vlan 200
[Switch2-GigabitEthernet0/0/1] quit
Configure PE1, P, and PE2 to advertise 32-bit loopback interface addresses as the
LSR IDs.
# Configure PE1.
[PE1] router id 1.1.1.1
[PE1] interface loopback 1
[PE1-LoopBack1] ip address 1.1.1.1 32
[PE1-LoopBack1] quit
[PE1] ospf 1
[PE1-ospf-1] area 0
[PE1-ospf-1-area-0.0.0.0] network 1.1.1.1 0.0.0.0
[PE1-ospf-1-area-0.0.0.0] network 4.4.4.4 0.0.0.255
[PE1-ospf-1-area-0.0.0.0] quit
[PE1-ospf-1] quit
# Configure P.
[P] router id 2.2.2.2
[P] interface loopback 1
[P-LoopBack1] ip address 2.2.2.2 32
[P-LoopBack1] quit
[P] ospf 1
[P-ospf-1] area 0
[P-ospf-1-area-0.0.0.0] network 2.2.2.2 0.0.0.0
[P-ospf-1-area-0.0.0.0] network 4.4.4.5 0.0.0.255
[P-ospf-1-area-0.0.0.0] network 5.5.5.4 0.0.0.255
[P-ospf-1-area-0.0.0.0] quit
[P-ospf-1] quit
# Configure PE2.
[PE2] router id 3.3.3.3
[PE2] interface loopback 1
[PE2-LoopBack1] ip address 3.3.3.3 32
[PE2-LoopBack1] quit
[PE2] ospf 1
[PE2-ospf-1] area 0
[PE2-ospf-1-area-0.0.0.0] network 3.3.3.3 0.0.0.0
[PE2-ospf-1-area-0.0.0.0] network 5.5.5.5 0.0.0.255
[PE2-ospf-1-area-0.0.0.0] quit
[PE2-ospf-1] quit
# Configure P.
[P] mpls lsr-id 2.2.2.2
[P] mpls
[P-mpls] quit
[P] mpls ldp
[P-mpls-ldp] quit
[P] interface vlanif 20
[P-Vlanif20] mpls
[P-Vlanif20] mpls ldp
[P-Vlanif20] quit
[P] interface vlanif 30
[P-Vlanif30] mpls
[P-Vlanif30] mpls ldp
[P-Vlanif30] quit
# Configure PE2.
[PE2] mpls lsr-id 3.3.3.3
[PE2] mpls
[PE2-mpls] quit
[PE2] mpls ldp
[PE2-mpls-ldp] quit
[PE2] interface vlanif 30
[PE2-Vlanif30] mpls
[PE2-Vlanif30] mpls ldp
[PE2-Vlanif30] quit
After the configuration is complete, run the display mpls ldp session command
on PE1, P, and PE2. You can see that the peer relationships are set up between PE1
and P, and between P and PE2. The status of the peer relationship is Operational.
Run the display mpls ldp command to view the MPLS LDP configuration. The
following is the display on PE1:
# Configure PE2.
[PE2] mpls ldp remote-peer 1.1.1.1
[PE2-mpls-ldp-remote-1.1.1.1] remote-ip 1.1.1.1
[PE2-mpls-ldp-remote-1.1.1.1] quit
After the configuration is complete, run the display mpls ldp session command
on PE1 or PE2. You can see that the status of the peer relationship between PE1
and PE2 is Operational. That is, the peer relationship is set up. The display on PE1
is used as an example.
[PE1] display mpls ldp session
LDP Session(s) in Public Network
Codes: LAM(Label Advertisement Mode), SsnAge Unit(DDDD:HH:MM)
A '*' before a session means the session is being deleted.
------------------------------------------------------------------------------
PeerID Status LAM SsnRole SsnAge KASent/Rcv
------------------------------------------------------------------------------
2.2.2.2:0 Operational DU Passive 0000:15:29 3717/3717
3.3.3.3:0 Operational DU Passive 0000:00:00 2/2
------------------------------------------------------------------------------
TOTAL: 2 session(s) Found.
# Configure PE2.
[PE2] mpls l2vpn
[PE2-l2vpn] quit
# Configure PE2.
[PE2] vsi a2 static
[PE2-vsi-a2] pwsignal ldp
[PE2-vsi-a2-ldp] vsi-id 2
[PE2-vsi-a2-ldp] peer 1.1.1.1
[PE2-vsi-a2-ldp] quit
[PE2-vsi-a2] quit
# Configure PE2.
[PE2] vcmp role silent
[PE2] interface gigabitethernet0/0/2
[PE2-GigabitEthernet0/0/2] port link-type hybrid
[PE2-GigabitEthernet0/0/2] quit
[PE2] interface gigabitethernet0/0/2.1
[PE2-GigabitEthernet0/0/2.1] qinq termination pe-vid 200 ce-vid 10
[PE2-GigabitEthernet0/0/2.1] l2 binding vsi a2
[PE2-GigabitEthernet0/0/2.1] quit
***VSI Name : a2
Administrator VSI : no
Isolate Spoken : disable
VSI Index :0
PW Signaling : ldp
Member Discovery Style : static
PW MAC Learn Style : unqualify
Encapsulation Type : vlan
MTU : 1500
Diffserv Mode : uniform
Mpls Exp : --
DomainId : 255
Domain Name :
Ignore AcState : disable
P2P VSI : disable
Create Time : 0 days, 0 hours, 5 minutes, 1 seconds
VSI State : up
VSI ID :2
*Peer Router ID : 3.3.3.3
Negotiation-vc-id :2
primary or secondary : primary
ignore-standby-state : no
VC Label : 23552
Peer Type : dynamic
Session : up
Tunnel ID : 0x22
Broadcast Tunnel ID : 0x22
Broad BackupTunnel ID : 0x0
CKey :2
NKey :1
Stp Enable :0
PwIndex :0
Control Word : disable
**PW Information:
----End
Configuration Files
● CE1 configuration file
#
sysname CE1
#
vlan batch 10
#
interface Vlanif10
ip address 10.1.1.1 255.255.255.0
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
return
peer 3.3.3.3
#
mpls ldp
#
mpls ldp remote-peer 3.3.3.3
remote-ip 3.3.3.3
#
interface Vlanif20
ip address 4.4.4.4 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet0/0/1
port link-type hybrid
#
interface GigabitEthernet0/0/1.1
qinq mapping pe-vid 100 ce-vid 10 map-vlan vid 200
l2 binding vsi a2
#
interface GigabitEthernet0/0/2
port link-type hybrid
port hybrid pvid vlan 20
port hybrid tagged vlan 20
#
interface LoopBack1
ip address 1.1.1.1 255.255.255.255
#
ospf 1
area 0.0.0.0
network 1.1.1.1 0.0.0.0
network 4.4.4.0 0.0.0.255
#
return
● P configuration file
#
sysname P
#
router id 2.2.2.2
#
vlan batch 20 30
#
mpls lsr-id 2.2.2.2
mpls
#
mpls ldp
#
interface Vlanif20
ip address 4.4.4.5 255.255.255.0
mpls
mpls ldp
#
interface Vlanif30
ip address 5.5.5.4 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet0/0/1
port link-type hybrid
port hybrid pvid vlan 20
port hybrid tagged vlan 20
#
interface GigabitEthernet0/0/2
port link-type hybrid
port hybrid pvid vlan 30
port hybrid tagged vlan 30
#
interface LoopBack1
ip address 2.2.2.2 255.255.255.255
#
ospf 1
area 0.0.0.0
network 2.2.2.2 0.0.0.0
network 4.4.4.0 0.0.0.255
network 5.5.5.0 0.0.0.255
#
return
● PE2 configuration file
#
sysname PE2
#
router id 3.3.3.3
#
vcmp role silent
#
vlan batch 30
#
mpls lsr-id 3.3.3.3
mpls
#
mpls l2vpn
#
vsi a2 static
pwsignal ldp
vsi-id 2
peer 1.1.1.1
#
mpls ldp
#
mpls ldp remote-peer 1.1.1.1
remote-ip 1.1.1.1
#
interface Vlanif30
ip address 5.5.5.5 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet0/0/1
port link-type hybrid
port hybrid pvid vlan 30
port hybrid tagged vlan 30
#
interface GigabitEthernet0/0/2
port link-type hybrid
#
interface GigabitEthernet0/0/2.1
qinq termination pe-vid 200 ce-vid 10
l2 binding vsi a2
#
interface LoopBack1
ip address 3.3.3.3 255.255.255.255
#
ospf 1
area 0.0.0.0
network 3.3.3.3 0.0.0.0
network 5.5.5.0 0.0.0.255
#
return
the same VPLS network. To implement communication between CE1 and CE2, use
LDP as the VPLS signaling protocol to establish PWs and configure VPLS.
Switch1 forwards the packets sent from CE1 without changing VLAN tags of the
packets.
You are required to configure selective QinQ on the interface connected to CE2 so
that Switch2 adds the carrier-specified VLAN tag to the packets sent from CE2.
The packets sent from Switch1 to PE1 contain only one VLAN tag, and the packets
sent from Switch2 to PE2 contain two VLAN tags. In this case, you need to
configure VLAN stacking on the sub-interface of PE1 connected to Switch1 and
connect the sub-interface to the VPLS network to enable communication between
CE1 and CE2.
When a Switch is connected to multiple CEs, the Switch can add the same outer
VLAN tag to packets with different VLAN tags from different CEs, thereby saving
VLAN IDs on the public network.
NOTE
● Only the S5720EI, S5720HI, S6720EI, and S6720S-EI support this example.
● VLAN termination sub-interfaces cannot be created on a VCMP client.
GE0/0/2 GE0/0/2
PE1 PE2
GE0/0/1 GE0/0/1
GE0/0/1 P GE0/0/2
GE0/0/2 GE0/0/2
Switch1 Switch2
GE0/0/1 GE0/0/1
GE0/0/1 GE0/0/1
CE1 CE2
- Loopback1 - 1.1.1.1/32
- GigabitEthernet0/0 GigabitEthernet0/0 -
/2 /2.1
- Loopback1 - 3.3.3.3/32
- Loopback1 - 2.2.2.2/32
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure a routing protocol on the backbone network to implement
interworking.
2. Add the interface of Switch1 connected to CE1 to a specified VLAN.
3. Configure selective QinQ on the interface of Switch2 connected to CE2.
4. Set up a remote LDP session between PEs.
5. Establish tunnels between PEs to transmit service data.
6. Enable MPLS L2VPN on the PEs.
7. Create a VSI on the PEs and specify LDP as the signaling protocol.
8. Configure a VLAN stacking sub-interface on the interface of PE1 connected to
Switch1 and bind the sub-interface to the VSI to connect it to the VPLS
network.
9. Configure a QinQ sub-interface on the interface of PE2 connected to Switch2
and bind the sub-interface to the VSI to connect the sub-interface to the VPLS
network.
Procedure
Step 1 Create VLANs on the devices, add interfaces to the VLANs, and assign IP addresses
to VLANIF interfaces according to Figure 10-20.
NOTE
● The AC-side and PW-side physical interfaces of a PE cannot be added to the same
VLAN; otherwise, a loop may occur.
● Ensure that each packet sent from a CE to the Switch carries one VLAN tag.
# Configure CE1.
<HUAWEI> system-view
[HUAWEI] sysname CE1
[CE1] vlan batch 10
[CE1] interface gigabitethernet 0/0/1
[CE1-GigabitEthernet0/0/1] port link-type trunk
[CE1-GigabitEthernet0/0/1] port trunk allow-pass vlan 10
[CE1-GigabitEthernet0/0/1] quit
[CE1] interface vlanif 10
[CE1-Vlanif10] ip address 10.1.1.1 24
[CE1-Vlanif10] quit
# Configure CE2.
<HUAWEI> system-view
[HUAWEI] sysname CE2
[CE2] vlan batch 10
[CE2] interface gigabitethernet 0/0/1
[CE2-GigabitEthernet0/0/1] port link-type trunk
[CE2-GigabitEthernet0/0/1] port trunk allow-pass vlan 10
[CE2-GigabitEthernet0/0/1] quit
[CE2] interface vlanif 10
[CE2-Vlanif10] ip address 10.1.1.2 24
[CE2-Vlanif10] quit
# Configure PE1.
<HUAWEI> system-view
[HUAWEI] sysname PE1
[PE1] vlan batch 20
[PE1] interface gigabitethernet 0/0/2
[PE1-GigabitEthernet0/0/2] port link-type hybrid
[PE1-GigabitEthernet0/0/2] port hybrid pvid vlan 20
[PE1-GigabitEthernet0/0/2] port hybrid tagged vlan 20
[PE1-GigabitEthernet0/0/2] quit
[PE1] interface vlanif 20
[PE1-Vlanif20] ip address 4.4.4.4 24
[PE1-Vlanif20] quit
# Configure P.
<HUAWEI> system-view
[HUAWEI] sysname P
[P] vlan batch 20 30
[P] interface gigabitethernet 0/0/1
[P-GigabitEthernet0/0/1] port link-type hybrid
[P-GigabitEthernet0/0/1] port hybrid pvid vlan 20
[P-GigabitEthernet0/0/1] port hybrid tagged vlan 20
[P-GigabitEthernet0/0/1] quit
[P] interface gigabitethernet 0/0/2
[P-GigabitEthernet0/0/2] port link-type hybrid
[P-GigabitEthernet0/0/2] port hybrid pvid vlan 30
[P-GigabitEthernet0/0/2] port hybrid tagged vlan 30
[P-GigabitEthernet0/0/2] quit
[P] interface vlanif 20
[P-Vlanif20] ip address 4.4.4.5 24
[P-Vlanif20] quit
[P] interface vlanif 30
[P-Vlanif30] ip address 5.5.5.4 24
[P-Vlanif30] quit
# Configure PE2.
<HUAWEI> system-view
[HUAWEI] sysname PE2
[PE2] vlan batch 30
[PE2] interface gigabitethernet 0/0/1
[PE2-GigabitEthernet0/0/1] port link-type hybrid
[PE2-GigabitEthernet0/0/1] port hybrid pvid vlan 30
[PE2-GigabitEthernet0/0/1] port hybrid tagged vlan 30
[PE2-GigabitEthernet0/0/1] quit
[PE2] interface vlanif 30
[PE2-Vlanif30] ip address 5.5.5.5 24
[PE2-Vlanif30] quit
Step 2 Configure selective QinQ on switch interfaces and specify the VLANs allowed by
the interfaces.
# Configure Switch1.
<HUAWEI> system-view
[HUAWEI] sysname Switch1
[Switch1] vlan 10
[Switch1-vlan10] quit
[Switch1] interface gigabitethernet0/0/2
[Switch1-GigabitEthernet0/0/2] port link-type hybrid
[Switch1-GigabitEthernet0/0/2] port hybrid tagged vlan 10
[Switch1-GigabitEthernet0/0/2] quit
[Switch1] interface gigabitethernet0/0/1
[Switch1-GigabitEthernet0/0/1] port link-type hybrid
[Switch1-GigabitEthernet0/0/1] port hybrid tagged vlan 10
[Switch1-GigabitEthernet0/0/1] quit
# Configure Switch2.
<HUAWEI> system-view
[HUAWEI] sysname Switch2
[Switch2] vlan 100
[Switch2-vlan100] quit
[Switch2] interface gigabitethernet0/0/2
[Switch2-GigabitEthernet0/0/2] port link-type hybrid
[Switch2-GigabitEthernet0/0/2] port hybrid tagged vlan 100
[Switch2-GigabitEthernet0/0/2] quit
[Switch2] interface gigabitethernet0/0/1
[Switch2-GigabitEthernet0/0/1] port link-type hybrid
[Switch2-GigabitEthernet0/0/1] qinq vlan-translation enable
[Switch2-GigabitEthernet0/0/1] port hybrid untagged vlan 100
[Switch2-GigabitEthernet0/0/1] port vlan-stacking vlan 10 stack-vlan 100
[Switch2-GigabitEthernet0/0/1] quit
[PE1-ospf-1-area-0.0.0.0] quit
[PE1-ospf-1] quit
# Configure P.
[P] router id 2.2.2.2
[P] interface loopback 1
[P-LoopBack1] ip address 2.2.2.2 32
[P-LoopBack1] quit
[P] ospf 1
[P-ospf-1] area 0
[P-ospf-1-area-0.0.0.0] network 2.2.2.2 0.0.0.0
[P-ospf-1-area-0.0.0.0] network 4.4.4.5 0.0.0.255
[P-ospf-1-area-0.0.0.0] network 5.5.5.4 0.0.0.255
[P-ospf-1-area-0.0.0.0] quit
[P-ospf-1] quit
# Configure PE2.
[PE2] router id 3.3.3.3
[PE2] interface loopback 1
[PE2-LoopBack1] ip address 3.3.3.3 32
[PE2-LoopBack1] quit
[PE2] ospf 1
[PE2-ospf-1] area 0
[PE2-ospf-1-area-0.0.0.0] network 3.3.3.3 0.0.0.0
[PE2-ospf-1-area-0.0.0.0] network 5.5.5.5 0.0.0.255
[PE2-ospf-1-area-0.0.0.0] quit
[PE2-ospf-1] quit
# Configure P.
[P] mpls lsr-id 2.2.2.2
[P] mpls
[P-mpls] quit
[P] mpls ldp
[P-mpls-ldp] quit
[P] interface vlanif 20
[P-Vlanif20] mpls
[P-Vlanif20] mpls ldp
[P-Vlanif20] quit
[P] interface vlanif 30
[P-Vlanif30] mpls
[P-Vlanif30] mpls ldp
[P-Vlanif30] quit
# Configure PE2.
[PE2] mpls lsr-id 3.3.3.3
[PE2] mpls
[PE2-mpls] quit
[PE2] mpls ldp
[PE2-mpls-ldp] quit
[PE2] interface vlanif 30
[PE2-Vlanif30] mpls
[PE2-Vlanif30] mpls ldp
[PE2-Vlanif30] quit
After the configuration is complete, run the display mpls ldp session command
on PE1, P, and PE2. You can see that the peer relationships are set up between PE1
and P, and between P and PE2. The status of the peer relationship is Operational.
Run the display mpls ldp command to view the MPLS LDP configuration. The
following is the display on PE1:
[PE1] display mpls ldp session
LDP Session(s) in Public Network
Codes: LAM(Label Advertisement Mode), SsnAge Unit(DDDD:HH:MM)
A '*' before a session means the session is being deleted.
------------------------------------------------------------------------------
PeerID Status LAM SsnRole SsnAge KASent/Rcv
------------------------------------------------------------------------------
2.2.2.2:0 Operational DU Passive 0000:15:29 3717/3717
------------------------------------------------------------------------------
TOTAL: 1 session(s) Found.
# Configure PE2.
[PE2] mpls ldp remote-peer 1.1.1.1
[PE2-mpls-ldp-remote-1.1.1.1] remote-ip 1.1.1.1
[PE2-mpls-ldp-remote-1.1.1.1] quit
After the configuration is complete, run the display mpls ldp session command
on PE1 or PE2. You can see that the peer status is Operational, indicating that a
peer relationship has been set up between PE1 and PE2. The display on PE1 is
used as an example.
[PE1] display mpls ldp session
LDP Session(s) in Public Network
Codes: LAM(Label Advertisement Mode), SsnAge Unit(DDDD:HH:MM)
A '*' before a session means the session is being deleted.
------------------------------------------------------------------------------
PeerID Status LAM SsnRole SsnAge KASent/Rcv
------------------------------------------------------------------------------
2.2.2.2:0 Operational DU Passive 0000:15:29 3717/3717
# Configure PE2.
[PE2] mpls l2vpn
[PE2-l2vpn] quit
# Configure PE2.
[PE2] vsi a2 static
[PE2-vsi-a2] pwsignal ldp
[PE2-vsi-a2-ldp] vsi-id 2
[PE2-vsi-a2-ldp] peer 1.1.1.1
[PE2-vsi-a2-ldp] quit
[PE2-vsi-a2] quit
# Configure PE2.
[PE2] vcmp role silent
[PE2] interface gigabitethernet0/0/2
[PE2-GigabitEthernet0/0/2] port link-type hybrid
[PE2-GigabitEthernet0/0/2] quit
[PE2] interface gigabitethernet0/0/2.1
[PE2-GigabitEthernet0/0/2.1] qinq termination pe-vid 100 ce-vid 10
[PE2-GigabitEthernet0/0/2.1] l2 binding vsi a2
[PE2-GigabitEthernet0/0/2.1] quit
***VSI Name : a2
Administrator VSI : no
Isolate Spoken : disable
VSI Index :0
PW Signaling : ldp
Member Discovery Style : static
PW MAC Learn Style : unqualify
Encapsulation Type : vlan
MTU : 1500
Diffserv Mode : uniform
Mpls Exp : --
DomainId : 255
Domain Name :
Ignore AcState : disable
P2P VSI : disable
Create Time : 0 days, 0 hours, 5 minutes, 1 seconds
VSI State : up
VSI ID :2
*Peer Router ID : 3.3.3.3
Negotiation-vc-id :2
primary or secondary : primary
ignore-standby-state : no
VC Label : 23552
Peer Type : dynamic
Session : up
Tunnel ID : 0x22
Broadcast Tunnel ID : 0x22
Broad BackupTunnel ID : 0x0
CKey :2
NKey :1
Stp Enable :0
PwIndex :0
Control Word : disable
**PW Information:
----End
Configuration Files
● CE1 configuration file
#
sysname CE1
#
vlan batch 10
#
interface Vlanif10
ip address 10.1.1.1 255.255.255.0
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
return
#
interface GigabitEthernet0/0/2
port link-type hybrid
#
interface GigabitEthernet0/0/2.1
qinq termination pe-vid 100 ce-vid 10
l2 binding vsi a2
#
interface LoopBack1
ip address 3.3.3.3 255.255.255.255
#
ospf 1
area 0.0.0.0
network 3.3.3.3 0.0.0.0
network 5.5.5.0 0.0.0.255
#
return
10 IP GE0/0/2
GE0/0/1 SwitchC
user1
VLAN 10
NOTE
When configuring QinQ stacking on a VLANIF interface, ensure that the VLANIF interface
corresponds to the management VLAN. VLANIF interfaces corresponding to other VLANs do
not support QinQ stacking.
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure QinQ on SwitchA.
2. Perform the following configurations on SwitchB:
a. Create VLAN 10 and configure VLAN 10 as the management VLAN.
b. Create VLANIF 10.
c. Configure QinQ stacking on a VLANIF interface.
Procedure
Step 1 Configure SwitchC.
# Configure SwitchC to allow packets from VLAN 10 to pass through GE0/0/1 and
GE0/0/2.
<HUAWEI> system-view
[HUAWEI] sysname SwitchC
[SwitchC] vlan batch 10
[SwitchC] interface gigabitethernet 0/0/1
[SwitchC-GigabitEthernet0/0/1] port link-type hybrid
[SwitchC-GigabitEthernet0/0/1] port hybrid tagged vlan 10
[SwitchC-GigabitEthernet0/0/1] quit
[SwitchC] interface gigabitethernet 0/0/2
[SwitchC-GigabitEthernet0/0/2] port link-type hybrid
[SwitchC-GigabitEthernet0/0/2] port hybrid tagged vlan 10
[SwitchC-GigabitEthernet0/0/2] quit
----End
Configuration Files
● SwitchA configuration file
#
sysname SwitchA
#
vlan batch 20
#
interface GigabitEthernet0/0/1
port link-type hybrid
qinq vlan-translation enable
port hybrid untagged vlan 20
port vlan-stacking vlan 10 stack-vlan 20
#
interface GigabitEthernet0/0/2
port link-type hybrid
port hybrid tagged vlan 20
#
return
● SwitchC configuration file
#
sysname SwitchC
#
vlan batch 10
#
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
#
return
● SwitchB configuration file
#
sysname SwitchB
#
vlan batch 10 20
#
vlan 10
management-vlan
#
interface Vlanif10
ip address 10.10.10.1 255.255.255.0
Procedure
1. Run the display this command in the view of the interface configured with
selective QinQ to check the outer VLAN tag.
2. Run the display vlan summary command in any view to check whether the
outer VLAN has been created.
<HUAWEI> display vlan summary
Static vlan:
Total 3 static vlan.
1 9 to 10
Dynamic vlan:
Total 0 dynamic vlan.
Reserved vlan:
Total 0 reserved vlan.
– If the command output contains the outer VLAN ID, the outer VLAN has
been created. Continue to check for other common misconfigurations.
– If the command output does not contain the outer VLAN ID, the outer
VLAN is not created. Run the vlan batch command to create a VLAN and
check whether QinQ traffic can be correctly transmitted. If traffic
forwarding still fails, continue to check for other common
misconfigurations.
Procedure
1. Run the display this command in the view of the interface configured with
selective QinQ to check the outer VLAN tag.
2. Run the display vlan vlan-id command in any view to check whether the
interface configured with selective QinQ belongs to the outer VLAN. vlan-id
specifies the outer VLAN ID.
<HUAWEI> display vlan 3
--------------------------------------------------------------------------------
U: Up; D: Down; TG: Tagged; UT: Untagged;
MP: Vlan-mapping; ST: Vlan-stacking;
#: ProtocolTransparent-vlan; *: Management-vlan;
--------------------------------------------------------------------------------
– If the system displays the message "Error:The VLAN does not exist.", the
outer VLAN is not created. Run the vlan batch command to create the
outer VLAN and run the display vlan vlan-id command to check whether
the interface belongs to the VLAN.
– If there is no interface configured with selective QinQ, run the port
hybrid untagged vlan vlan-id command to add the interface to the
VLAN in untagged mode.
– If the command output does not display the interface configured with
selective QinQ but the flag before the interface is not UT, run the port
hybrid untagged vlan vlan-id command to add the interface to the
VLAN in untagged mode.
– If the command output displays the interface configured with selective
QinQ and the interface has joined the VLAN in untagged mode, continue
to check for other common misconfigurations.