You are on page 1of 118

Contents

9 QinQ Configuration
9.1 Introduction to QinQ
9.2 Principles
9.2.1 QinQ Fundamentals
9.2.2 Basic QinQ
9.2.3 Selective QinQ
9.2.4 VLAN Stacking on a VLANIF Interface
9.2.5 TPID
9.2.6 QinQ Mapping
9.3 Applications
9.3.1 Public User Services on a Metro Ethernet Network
9.3.2 Enterprise Network Connection Through Private Lines
9.4 Configuration Task Summary
9.5 Licensing Requirements and Limitations for QinQ
9.6 Configuring QinQ
9.6.1 Configuring Basic QinQ
9.6.2 Configuring Selective QinQ
9.6.3 Configuring the TPID Value in an Outer VLAN Tag
9.6.4 Configuring QinQ Stacking on a VLANIF Interface
9.6.5 Configuring the Device to Add Double VLAN Tags to Untagged Packets
9.6.6 Configuring QinQ Mapping
9.6.6.1 Configuring 1-to-1 QinQ Mapping
9.6.6.2 Configuring 2-to-1 QinQ Mapping
9.7 Maintaining QinQ
9.7.1 Displaying VLAN Translation Resource Usage
9.8 Configuration Examples
9.8.1 Example for Configuring Basic QinQ
9.8.2 Example for Configuring Selective QinQ
9.8.3 Example for Configuring Selective QinQ and VLAN Mapping
9.8.4 Example for Connecting a Single-Tag VLAN Mapping Sub-Interface to a VLL Network
9.8.5 Example for Connecting a Double-Tag VLAN Mapping Sub-Interface to a VLL Network
9.8.6 Example for Connecting a VLAN Stacking Sub-interface to a VLL Network
9.8.7 Example for Connecting a Single-tag VLAN Mapping Sub-interface to a VPLS Network
9.8.8 Example for Connecting a Double-tag VLAN Mapping Sub-interface to a VPLS Network
9.8.9 Example for Connecting a VLAN Stacking Sub-interface to a VPLS Network
9.8.10 Example for Configuring QinQ Stacking on a VLANIF Interface
9.9 Common Misconfigurations
9.9.1 QinQ Traffic Forwarding Fails Because the Outer VLAN Is Not Created
9.9.2 QinQ Traffic Forwarding Fails Because the Interface Does Not Transparently Transmit the Outer VLAN ID
9.10 FAQ
9.10.1 Does the Switch Support QinQ?
9.10.2 What Are Causes for QinQ Traffic Forwarding Failures?
9.10.3 Can I Rapidly Delete All QinQ Configurations of an Interface?
9.10.4 Can I Directly Delete Inner VLAN IDs from QinQ Configuration?
9.10.5 Can the Switch Add Double VLAN Tags to Untagged Packets?
9.10.6 Which Tag Does the TPID Configured by the qinq protocol Command Match?
9.10.7 Which VLAN Does the Interface Enabled with VLAN Mapping or QinQ Obtain Through MAC Address
Learning?
9.11 References

9 QinQ Configuration

This chapter describes how to configure 802.1Q-in-802.1Q (QinQ).

 9.1 Introduction to QinQ

 9.2 Principles

 9.3 Applications

 9.4 Configuration Task Summary

 9.5 Licensing Requirements and Limitations for QinQ

 9.6 Configuring QinQ

 9.7 Maintaining QinQ

 9.8 Configuration Examples

 9.9 Common Misconfigurations

 9.10 FAQ

 9.11 References

9.1 Introduction to QinQ


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.
QinQ was originally developed to expand VLAN space by adding an additional 802.1Q tag to an 802.1Q-
tagged packet. In this way, the number of VLANs can increase to 4094 x 4094.
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.

9.2 Principles
9.2.1 QinQ Fundamentals
QinQ expands VLAN space by adding an additional 802.1Q VLAN tag to an 802.1Q-tagged packet. Devices
forward packets over the public network according to outer VLAN tags of the packets, and learn MAC
addresses from the outer VLAN tags. The private VLAN tags in the packets are forwarded as payload of the
packets.
Figure 9-1 Typical QinQ application

In Figure 9-1, customer network A is divided into private VLANs 1 to 10, and customer network B is divided
into private VLANs 1 to 20. The carrier allocates public VLANs 3 and 4 to customer networks A and B
respectively. When tagged packets from networks A and B arrive at the carrier network, the packets are tagged
outer VLANs 3 and 4. Therefore, the packets from different customer networks are separated on the carrier
network, even though the customer networks use overlapping VLAN ranges. When the packets reach the PE on
the other side of the carrier network, the PE removes public VLAN tags from the packets and forwards the
packets to the CE of the appropriate customer network.

QinQ Packet Encapsulation Format


A QinQ packet has a fixed format, in which an 802.1Q tag is added outside the existing 802.1Q tag of the
packet. A QinQ packet has 4 more bytes than an 802.1Q packet.

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.

Figure 9-2 802.1Q 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
This encapsulation mode is also called QinQ tunneling. It encapsulates packets arriving at the same
interface with the same outer VLAN tag, and therefore cannot distinguish users and services at the
same time.
 Flow-based QinQ encapsulation
This encapsulation mode classifies packets arriving at an interface into different flows, and then
determines whether to add outer VLAN tags and which outer VLAN tags to add on a per flow basis.
This mode is also called selective QinQ.
Traffic can be classified based on VLAN ID ranges if a customer uses different VLAN IDs for
different services. For example, PC users access the Internet through VLANs 101 to 200, IPTV users
through VLANs 201 to 300, and VIPs through VLANs 301 to 400. When receiving service data, the
UPE adds outer tag 100 to packets from PCs, outer tag 300 to packets from IPTV users, and outer tag
500 to packets from VIPs.
 QinQ encapsulation on sub-interfaces
QinQ encapsulation can be performed on both Layer 2 interfaces and Layer 3 sub-interfaces.
When service data is transparently transmitted over an MPLS/IP core network using
PWE3/VLL/VPLS, a network-end provider edge (NPE) sub-interface adds an outer VLAN tag to a
packet based on the inner VLAN tag. Then the packet is transmitted on the VLL/PWE3/VPLS network
using the outer VLAN tag. Packets from multiple private VLANs can be transparently transmitted
through a sub-interface, which is called a QinQ stacking sub-interface.
QinQ encapsulation on a sub-interface is also a form of flow-based QinQ encapsulation. The QinQ
stacking sub-interface must be used with the L2VPN service (PWE3/VLL/VPLS), and cannot support
Layer 3 forwarding.

9.2.2 Basic QinQ


Basic QinQ, also called QinQ tunneling, is performed based on interfaces. After basic QinQ is configured on an
interface, packets received on the interface are tagged with the default VLAN ID of the interface. After being
processed by basic QinQ on an interface, single-tagged packets change into double-tagged packets, and
untagged packets change into single-tagged packets with the default VLAN tag of the interface.
Basic QinQ can be configured to expand VLAN space when multiple VLANs are required.
In Figure 9-3, Department 1 has two offices and Department 2 has three offices. These offices are connected to
PE1 and PE2, respectively. Department 1 and Department 2 can plan their own VLANs as required.
Figure 9-3 Networking diagram of QinQ tunneling

Table 9-1 describes the outer VLAN tag plan for Department 1 and Department 2.
Table 9-1 VLAN plan for Department 1 and Department 2
Department VLAN ID Range Outer VLAN ID

Department 1 2 to 500 10

Department 2 500 to 4094 20


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.

9.2.3 Selective QinQ


Selective QinQ, also called VLAN stacking or QinQ stacking, is performed based on interfaces and VLAN IDs.
In addition to basic QinQ functions, selective QinQ has the following functions:
 VLAN ID-based selective QinQ: adds outer VLAN tags based on inner VLAN IDs.
 802.1p priority-based selective QinQ: adds outer VLAN tags based on 802.1p priorities in inner VLAN
tags.
 Traffic policy-based selective QinQ: adds outer VLAN tags based on traffic policies so that
differentiated services can be provided based on service types.
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.
In Figure 9-4, Department 1 and Department 2 have multiple offices.
Figure 9-4 Networking diagram of selective QinQ

Table 9-2 VLAN plan for Department 1 and Department 2


Device Interface VLAN ID Range Outer VLAN ID

PE1 Port1 2 to 500 10

Port1 1000 to 2000 20


Device Interface VLAN ID Range Outer VLAN ID

Port2 100 to 500 10

PE2 Port1 1000 to 4094 20

Port2 500 to 2500 20

 Department 1 uses VLANs 2 to 500.


 Department 2 uses VLANs 500 to 4094.
 Port1 on PE1 receives packets from VLANs of Department 1 and Department 2 simultaneously.
Selective QinQ is configured on PE1 and PE2 in the following way to implement communication within each
department and isolate the two departments.
 Configure outer VLAN tags for packets received on interfaces of PE1 and PE2 according to Table 9-2.
 Configure Port3 on PE1 and Port3 on PE2 to allow packets of VLAN 20 to pass.

9.2.4 VLAN Stacking on a VLANIF Interface


In Figure 9-5, DeviceA is connected to DeviceB through a third-party network. DeviceB is configured with the
management VLAN. The management VLAN ID is the same as the VLAN ID of the downstream user
connected to DeviceA but different from the S-VLAN ID.
Figure 9-5 Networking diagram of VLAN stacking on a VLANIF interface

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.

9.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 9-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.
Figure 9-6 802.1Q encapsulation

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 9-3.
Table 9-3 Protocol types and values
Protocol Type Value

ARP 0x0806

RARP 0x8035

IP 0x0800

IPv6 0x86DD

PPPoE 0x8863/0x8864

MPLS 0x8847/0x8848

IPX/SPX 0x8137

LACP 0x8809

802.1x 0x888E

HGMP 0x88A7
Protocol Type Value

Reserved 0xFFFD/0xFFFE/0xFFFF

9.2.6 QinQ Mapping


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.
QinQ mapping is generally deployed on edge devices of a metro Ethernet and often used to map a VLAN tag
carried in a packet to a specified VLAN tag before the packet is transmitted on the public network. QinQ
mapping applies to the following scenarios:
 The VLAN IDs deployed in new sites and old sites conflict, but new sites need to communicate with old
sites.
 Sites connected to the public network use conflicting VLAN IDs but do not need to communicate with
one another.
 The VLAN IDs on both ends of the public network are different.
Currently, the device supports the following QinQ mapping modes:
 1-to-1 mapping
When a sub-interface receives a single-tagged packet, it maps the VLAN tag to a specified tag.
 2-to-1 mapping
When a sub-interface receives a double-tagged packet, it maps the outer VLAN tag to a specified tag
and retains the inner VLAN tag.
Figure 9-7 QinQ mapping

In Figure 9-7, 1-to-1 QinQ mapping is configured on GE0/0/1.1 interfaces of Device2 and Device3. Frames
sent from PC1 to PC2 are processed as follows:
1. PC1 sends an untagged frame to Device1. After receiving the frame, Device1 adds VLAN tag 20 to
the frame.
2. Device1 forwards the frame with VLAN tag 20 to Device2. Device2 replaces VLAN tag 20 with S-
VLAN tag 50 on sub-interface GE0/0/1.1.
3. Device2 sends the frame with S-VLAN tag 50 through GE0/0/2.
4. The frame is transparently transmitted on the ISP network.
5. When the frame arrives at GE0/0/1.1 of Device3, Device3 replaces VLAN tag 50 with VLAN tag 40.
Frames sent from PC2 to PC1 are processed in a similar way.
QinQ mapping allows PC1 to communicate with PC2.

Comparison Between QinQ Mapping and VLAN Mapping


Table 9-4 compares QinQ mapping and VLAN mapping.
Table 9-4 Comparison between QinQ mapping and VLAN mapping

Mapping Similarity Difference

1-to-1 The interface maps the tag in a  QinQ mapping is performed on sub-interfaces and used for
received single-tagged packet to a VPLS access.
specified tag.  VLAN mapping is performed on main interfaces and
applies to Layer 2 networks where packets are forwarded
based on VLANs.

2-to-1 The interface maps the outer tag of a  QinQ mapping is performed on sub-interfaces and used for
received double-tagged packet to a VPLS access.
specified tag and retains the inner
Mapping Similarity Difference

tag. The inner tag is transparently  VLAN mapping is performed on main interfaces and
transmitted as service data. applies to Layer 2 networks where packets are forwarded
based on VLANs.

9.3 Applications
9.3.1 Public User Services on a Metro Ethernet Network
Figure 9-8 QinQ application on a metro Ethernet network

In Figure 9-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 9-
5.
Table 9-5 Example of VLAN assignment
Service VLAN Range

HSI 101 to 300

VoIP 301 to 500


Service VLAN Range

IPTV 501 to 700

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.

9.3.2 Enterprise Network Connection Through Private Lines


In Figure 9-9, an enterprise has two sites in different places. Each site has three networks: Finance, Marketing,
and Others. To ensure network security, the enterprise requires that users belonging to different networks be
unable to communicate with each other.
Figure 9-9 Private line connection between enterprise users

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.
9.4 Configuration Task Summary
Table 9-6 describes the QinQ configuration tasks.
Table 9-6 QinQ configuration task summary

Scenario Description Task

Configure basic QinQ After basic QinQ is configured, the 9.6.1 Configuring Basic QinQ
switch adds a public tag to incoming
packets so that user packets can be
forwarded on the public network.

Configure selective QinQ Selective QinQ based on the VLAN ID 9.6.2 Configuring Selective QinQ
enables the switch to add different
outer VLAN tags to received data
frames according to VLAN IDs in the
frames.

Set the TPID value in an outer VLAN This configuration allows a Huawei 9.6.3 Configuring the TPID Value in
tag device to communicate with a non- an Outer VLAN Tag
Huawei device.

Configure QinQ stacking on a To log in to a remote device and 9.6.4 Configuring QinQ Stacking on a
VLANIF interface manage the device, configure QinQ VLANIF Interface
stacking on the VLANIF interface
corresponding to the management
VLAN of the remote device.

Configure the device to add double The device can be configured to add 9.6.5 Configuring the Device to Add
VLAN tags to untagged packets double VLAN tags to untagged Double VLAN Tags to Untagged
packets. Packets

Configure QinQ mapping QinQ mapping maps C-VLAN tags to 9.6.6 Configuring QinQ Mapping
S-VLAN tags to shield different C-
VLAN tags.

9.5 Licensing Requirements and Limitations for QinQ


Involved Network Elements
Other network elements are not required.

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
Table 9-7 Products and versions supporting QinQ

Product Product Model Software Version

S1700 S1720GFR V200R006C10, V200R009C00, V200R010C00, V200R011C00, V200R011C10

S1720GW, V200R010C00, V200R011C00, V200R011C10


S1720GWR

S1720GW-E, V200R010C00, V200R011C00, V200R011C10


S1720GWR-E

S1720X, S1720X- V200R011C00, V200R011C10


E

Other S1700 Models that cannot be configured using commands. For details about features
models and versions, see S1700 Documentation Bookshelf.

S2700 S2700SI Not supported


S2700EI V100R005C01, V100R006(C00&C01&C03&C05)
NOTE:
The S2700EI does not support selective QinQ.

S2710SI Not supported


S2720EI V200R006C10, V200R009C00, V200R010C00, V200R011C10

S2750EI V200R003C00, V200R005C00SPC300, V200R006C00, V200R007C00,


V200R008C00, V200R009C00, V200R010C00, V200R011C00, V200R011C10

S3700 S3700SI V100R005C01, V100R006(C00&C01&C03&C05)

S3700EI V100R005C01, V100R006(C00&C01&C03&C05)

S3700HI V100R006C01, V200R001C00

S5700 S5700LI V200R001C00, V200R002C00, V200R003(C00&C02&C10),


V200R005C00SPC300, V200R006C00, V200R007C00, V200R008C00,
V200R009C00, V200R010C00, V200R011C00, V200R011C10

S5700S-LI V200R001C00, V200R002C00, V200R003C00, V200R005C00SPC300,


V200R006C00, V200R007C00, V200R008C00, V200R009C00,
V200R010C00, V200R011C00, V200R011C10

S5710-C-LI V200R001C00

S5710-X-LI V200R008C00, V200R009C00, V200R010C00, V200R011C00, V200R011C10

S5700EI V100R005C01, V100R006(C00&C01), V200R001(C00&C01), V200R002C00,


V200R003C00, V200R005(C00&C01&C02&C03)

S5700SI V100R005C01, V100R006C00, V200R001C00, V200R002C00,


V200R003C00, V200R005C00
Product Product Model Software Version

S5710EI V200R001C00, V200R002C00, V200R003C00, V200R005(C00&C02)

S5720EI V200R007C00, V200R008C00, V200R009C00, V200R010C00,


V200R011C00, V200R011C10

S5720LI, V200R010C00, V200R011C00, V200R011C10


S5720S-LI
S5720SI, S5720S- V200R008C00, V200R009C00, V200R010C00, V200R011C00, V200R011C10
SI
S5700HI V100R006C01, V200R001(C00&C01), V200R002C00, V200R003C00,
V200R005(C00SPC500&C01&C02)

S5710HI V200R003C00, V200R005(C00&C02&C03)

S5720HI V200R006C00, V200R007(C00&C10), V200R008C00, V200R009C00,


V200R010C00, V200R011C00, V200R011C10

S5730SI V200R011C10

S5730S-EI V200R011C10

S6700 S6700EI V100R006C00, V200R001(C00&C01), V200R002C00, V200R003C00,


V200R005(C00&C01&C02)

S6720EI V200R008C00, V200R009C00, V200R010C00, V200R011C00, V200R011C10

S6720S-EI V200R009C00, V200R010C00, V200R011C00, V200R011C10

S6720LI, V200R011C00, V200R011C10


S6720S-LI

S6720SI, S6720S- V200R011C00, V200R011C10


SI

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 7.4 Licensing Requirements
and Limitations for VLAN Termination.
 The devices listed in Table 9-8 can add double tags to untagged packets.
Table 9-8 Products and versions supporting the function of adding double tags to untagged packets

Product Product Model Software Version

S1700 S1720GFR V200R006C10, V200R009C00, V200R010C00, V200R011C00,


V200R011C10
Product Product Model Software Version

S1720GW, V200R010C00, V200R011C00, V200R011C10


S1720GWR

S1720GW-E, V200R010C00, V200R011C00, V200R011C10


S1720GWR-E

S1720X, V200R011C00, V200R011C10


S1720X-E

Other S1700 Models that cannot be configured using commands. For details about features
models and versions, see S1700 Documentation Bookshelf.

S2700 S2700SI Not supported


S2700EI Not supported
S2710SI Not supported
S2720EI V200R006C10, V200R009C00, V200R010C00, V200R011C10
S2750EI V200R003C00, V200R005C00SPC300, V200R006C00, V200R007C00,
V200R008C00, V200R009C00, V200R010C00, V200R011C00,
V200R011C10

S3700 S3700SI Not supported


S3700EI Not supported
S3700HI Not supported
S5700 S5700LI V200R003 (C00&C02&C10), V200R005C00SPC300, V200R006C00,
V200R007C00, V200R008C00, V200R009C00, V200R010C00,
V200R011C00, V200R011C10
S5700S-LI V200R003C00, V200R005C00SPC300, V200R006C00, V200R007C00,
V200R008C00, V200R009C00, V200R010C00, V200R011C00,
V200R011C10
S5710-C-LI Not supported
S5710-X-LI V200R008C00, V200R009C00, V200R010C00, V200R011C00,
V200R011C10

S5700EI Not supported


S5700SI Not supported
S5710EI V200R003C00, V200R005 (C00&C02)
S5720EI V200R007C00, V200R008C00, V200R009C00, V200R010C00,
V200R011C00, V200R011C10

S5720LI, V200R010C00, V200R011C00, V200R011C10


S5720S-LI
S5720SI, V200R008C00, V200R009C00, V200R010C00, V200R011C00,
S5720S-SI V200R011C10
Product Product Model Software Version

S5700HI V200R002C00, V200R003C00, V200R005 (C00SPC500&C01&C02)


S5710HI V200R003C00, V200R005(C00&C02&C03)

S5720HI V200R006C00, V200R007(C00&C10), V200R008C00, V200R009C00,


V200R010C00, V200R011C00, V200R011C10

S5730SI V200R011C10

S5730S-EI V200R011C10

S6700 S6700EI V200R003C00, V200R005 (C00&C01&C02)


S6720EI V200R008C00, V200R009C00, V200R010C00, V200R011C00,
V200R011C10

S6720S-EI V200R009C00, V200R010C00, V200R011C00, V200R011C10

S6720LI, V200R011C00, V200R011C10


S6720S-LI

S6720SI, V200R011C00, V200R011C10


S6720S-SI

 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.
 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.

9.6 Configuring QinQ


9.6.1 Configuring Basic QinQ
Basic QinQ enables the device to add a public tag to incoming packets so that user packets can be forwarded on
the public network.

Background
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
1. Run:
system-view

The system view is displayed.


2. Run:
vlan vlan-id

A VLAN used on the public network is created.


3. Run:
quit

Exit from the VLAN view.


4. Run:
interface interface-type interface-number

The interface view is displayed.


The interface can be a physical interface or an Eth-Trunk interface.
5. Run:
port link-type dot1q-tunnel

The link type of the interface is set to Dot1q-tunnel.


By default, the LNP negotiation mode of an interface on the S2750, S5700LI, S5700S-LI, S5710-X-
LI, S5720SI, and S5720S-SI is negotiation-auto, and the LNP negotiation mode of an interface on
other models is negotiation-desirable.
Dot1q-tunnel interfaces do not support Layer 2 multicast.
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.

Checking the Configuration


 Run the display current-configuration interface interface-type interface-number command to check
the QinQ configuration on the interface.

9.6.2 Configuring Selective QinQ


Selective QinQ enables an interface to add a public VLAN tag to user packets carrying a private VLAN tag so
that the packets can be forwarded on the public network.

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.
 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
1. Run:
system-view

The system view is displayed.


2. Run:
interface interface-type interface-number

The interface can be a physical interface or an Eth-Trunk interface.


3. Run:
port link-type hybrid

The link type of the interface is set to hybrid.


By default, the LNP negotiation mode of an interface on the S2750, S5700LI, S5700S-LI, S5710-X-
LI, S5720SI, and S5720S-SI is negotiation-auto, and the LNP negotiation mode of an interface on
other models is negotiation-desirable.
4. Run:
port hybrid untagged vlan vlan-id

The interface is added to the VLAN in untagged mode.


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.
5. Run:
qinq vlan-translation enable

VLAN translation is enabled on the interface.


6. Run:
port vlan-stacking vlan vlan-id1 [ to vlan-id2 ] stack-vlan vlan-id3 [ remark-
8021p 8021p-value ]

Selective QinQ is configured.


By default, the priority in the stacked outer VLAN tag is the same as the priority in the inner VLAN
tag.
7. Run:
quit

Exit from the interface view.


8. Run:
interface interface-type interface-number

The view of another interface is displayed.


This interface is the outbound interface for QinQ packets, different from the interface specified in
step 2.
9. Run:
port link-type trunk

The link type of the interface is set to trunk.


10. Run:
port trunk allow-pass vlan vlan-id3

The outer VLAN ID (stack-vlan) added to the original tagged packet is set.

Checking the Configuration


 Run the display current-configuration interface interface-type interface-number command to check
the selective QinQ configuration on the interface.

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.

9.6.3 Configuring the TPID Value in an Outer VLAN Tag


To enable interoperation between devices from different vendors, set the same TPID value in outer VLAN tags
on the devices.

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
1. Run:
system-view

The system view is displayed.


2. Run:
interface interface-type interface-number

The interface view is displayed.


3. Run:
qinq protocol protocol-id

The protocol type in the outer VLAN tag is set.


The qinq protocol command cannot be used on Dot1q-tunnel interfaces.
By default, the TPID value in the outer VLAN tag is 0x8100.

9.6.4 Configuring QinQ Stacking on a VLANIF Interface


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.

Background
As shown in Figure 9-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.
Figure 9-10 Networking for QinQ stacking on a VLANIF interface

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
1. Run:
system-view

The system view is displayed.


2. Run:
interface vlanif vlan-id

The VLANIF interface corresponding to the management VLAN is created.


Before running this command, ensure that the management VLAN exists.
3. Run:
qinq stacking vlan vlan-id

QinQ stacking is configured on the VLANIF interface.

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 sendcommand before using the qinq stacking vlan command.
 The outer VLAN added to packets must be an existing VLAN with no VLANIF interface configured.

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.

9.6.5 Configuring the Device to Add Double VLAN Tags to Untagged


Packets
You can configure one device to add double VLAN tags to untagged packets.

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
1. Run:
system-view

The system view is displayed.


2. Run:
vlan vlan-id

The outer VLAN is created.


3. Run:
quit

Return to the system view.


4. Run:
interface interface-type interface-number

The interface view is displayed.


5. Run:
port link-type hybrid

The link type of the interface is set to hybrid.


By default, the LNP negotiation mode of an interface on the S2750, S5700LI, S5700S-LI, S5710-X-
LI, S5720SI, and S5720S-SI is negotiation-auto, and the LNP negotiation mode of an interface on
other models is negotiation-desirable.
6. Run:
qinq vlan-translation enable

VLAN translation is enabled on the interface.


7. Run:
port hybrid untagged vlan vlan-id

The interface is added to the outer VLAN.


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 in untagged mode.
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 S2750, S5700LI,
S5700S-LI, S5710-X-LI, 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.

9.6.6 Configuring QinQ Mapping


VLAN mapping maps C-VLAN tags to S-VLAN tags to shield different C-VLAN tags.

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.
NOTE:
The mapped VLAN IDs specified in QinQ mapping configuration must be different from the control VLAN IDs for ring protocols
such as SEP, RRPP, and ERPS. Otherwise, an error message will be displayed, indicating that the configuration fails.
Only the S6720EI supports this configuration.

9.6.6.1 Configuring 1-to-1 QinQ Mapping

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
1. Run:
system-view

The system view is displayed.


2. Run:
interface interface-type interface-number

The interface view is displayed.


3. Run:
port link-type { hybrid | trunk }

The port link-type is set.


4. Run:
quit

Return to the system view.


5. Run:
interface interface-type interface-number.subinterface-number

The view of the CE-side Ethernet or Eth-Trunk sub-interface of the PE is displayed.


6. Run:
qinq mapping vid vlan-id1 [ to vlan-id2 ] map-vlan vid vlan-id3

The sub-interface is configured to map a tag of a packet to a specified tag.


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.

9.6.6.2 Configuring 2-to-1 QinQ Mapping

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
1. Run:
system-view

The system view is displayed.


2. Run:
interface interface-type interface-number

The interface view is displayed.


3. Run:
port link-type { hybrid | trunk }

The port link-type is set.


4. Run:
quit

Return to the system view.


5. Run:
interface interface-type interface-number.subinterface-number

The view of the CE-side Ethernet or Eth-Trunk sub-interface of the PE is displayed.


6. Run:
qinq mapping pe-vid vlan-id1 ce-vid vlan-id2 [ to vlan-id3 ] map-vlan vid vlan-
id4

The sub-interface is configured to map the outer tag of double-tagged packets to a specified tag.
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.

9.7 Maintaining QinQ


9.7.1 Displaying VLAN Translation Resource Usage
Context
During QinQ configuration (excluding basic QinQ configuration), VLAN translation resources may be
insufficient. You can run command 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
1. Run the display vlan-translation resource [ slot slot-number ] command in any view to view VLAN
translation resource usage on a card.

NOTE:
Only the S5720HI, S5720EI, and S6720EI support this command.

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 on a card conflict.

NOTE:
Only the S5720HI supports this command.

9.8 Configuration Examples


Interface types used in this manual are examples. In device configuration, use the existing interface types on
devices.

9.8.1 Example for Configuring Basic QinQ


Networking Requirements
In Figure 9-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.
The requirements are as follows:
 Enterprise 1 and Enterprise 2 use independent VLAN plans that do not affect each other.
 Traffic of an enterprise's branches is transparently transmitted on the ISP network. Users accessing the
same service in an enterprise are allowed to communicate, and users accessing different services are
isolated.
You can configure QinQ to meet the preceding requirements. VLAN 100 and VLAN 200 provided by the ISP
network can be used to transmit traffic for Enterprise 1 and Enterprise 2 respectively, thereby implementing
communication within an enterprise and isolating the two enterprises. To implement interoperation with the
non-Huawei device, set the TPID value in outer VLAN tags to 0x9100 on the interfaces of the Huawei devices
connected to the non-Huawei device.
Figure 9-11 Networking for configuring basic QinQ

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.
4. Create VLANs on Switch1, Switch2, Switch3, and Switch4, and add interfaces to VLANs to
implement Layer 2 connectivity.

Procedure
1. Create VLANs.
# Create VLAN 100 and VLAN 200 on SwitchA.
<HUAWEI> system-view
[HUAWEI] sysname SwitchA
[SwitchA] vlan batch 100 200

# Create VLAN 100 and VLAN 200 on SwitchB.


<HUAWEI> system-view
[HUAWEI] sysname SwitchB
[SwitchB] vlan batch 100 200

# Create VLANs 10 to 50 on Switch1. The configuration of Switch3 is similar to that of Switch1, and
is not mentioned here.
<HUAWEI> system-view
[HUAWEI] sysname Switch1
[Switch1] vlan batch 10 to 50

# Create VLANs 20 to 60 on Switch2. The configuration of Switch4 is similar to that of Switch2, and
is not mentioned here.
<HUAWEI> system-view
[HUAWEI] sysname Switch2
[Switch2] vlan batch 20 to 60

2. Set the link type of interfaces to Dot1q-tunnel.


# 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

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

4. Add interfaces of access switches to VLANs.


# Add GE0/0/1 on Switch1 to VLANs 10 to 50. The configuration of Switch3 is similar to that of
Switch1, and is not mentioned here.
[Switch1] interface gigabitethernet 0/0/1
[Switch1-GigabitEthernet0/0/1] port link-type trunk
[Switch1-GigabitEthernet0/0/1] port trunk allow-pass vlan 10 to 50
[Switch1-GigabitEthernet0/0/1] quit

# Add GE0/0/1 on Switch2 to VLANs 20 to 60. The configuration of Switch4 is similar to that of
Switch2, and is not mentioned here.
[Switch2] interface gigabitethernet 0/0/1
[Switch2-GigabitEthernet0/0/1] port link-type trunk
[Switch2-GigabitEthernet0/0/1] port trunk allow-pass vlan 20 to 60
[Switch2-GigabitEthernet0/0/1] quit

5. Configure the TPID value in outer VLAN tags.


# Set the TPID value in outer VLAN tags to 0x9100 on SwitchA.
[SwitchA] interface gigabitethernet 0/0/3
[SwitchA-GigabitEthernet0/0/3] qinq protocol 9100

# Set the TPID value in outer VLAN tags to 0x9100 on SwitchB.


[SwitchB] interface gigabitethernet 0/0/3
[SwitchB-GigabitEthernet0/0/3] qinq protocol 9100

6. Verify the configuration.


In Enterprise 1, ping a PC in a VLAN of a branch from a PC in the same VLAN of another branch. If
the ping operation is successful, internal users of Enterprise 1 can communicate.
In Enterprise 2, ping a PC in a VLAN of a branch from a PC in the same VLAN of another branch. If
the ping operation is successful, internal users of Enterprise 2 can communicate.
Ping a PC in any VLAN of Enterprise 2 from a PC in the same VLAN of Enterprise 1. If the ping
operation fails, users in Enterprise 1 and Enterprise 2 are isolated.

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

 SwitchB configuration file


 #
 sysname SwitchB
 #
 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

 Switch1 configuration file


 #
 sysname Switch1
 #
 vlan batch 10 to 50
 #
 interface GigabitEthernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 10 to 50
 #
return

 Switch2 configuration file


 #
 sysname Switch2
 #
 vlan batch 20 to 60
 #
 interface GigabitEthernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 20 to 60
 #
return

 Switch3 configuration file


 #
 sysname Switch3
 #
 vlan batch 10 to 50
 #
 interface GigabitEthernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 10 to 50
 #
return

 Switch4 configuration file


 #
 sysname Switch4
 #
 vlan batch 20 to 60
 #
 interface GigabitEthernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 20 to 60
 #
return

9.8.2 Example for Configuring Selective QinQ


Networking Requirements
In Figure 9-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.
Figure 9-12 Networking diagram for configuring selective QinQ

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
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

2. Configure selective QinQ on interfaces.


# Configure GE0/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] qinq vlan-translation enable
[SwitchA-GigabitEthernet0/0/1] port vlan-stacking vlan 100 stack-vlan 2
[SwitchA-GigabitEthernet0/0/1] port vlan-stacking vlan 300 stack-vlan 3
[SwitchA-GigabitEthernet0/0/1] quit

# Configure GE0/0/1 on SwitchB.


[SwitchB] interface gigabitethernet 0/0/1
[SwitchB-GigabitEthernet0/0/1] port link-type hybrid
[SwitchB-GigabitEthernet0/0/1] port hybrid untagged vlan 2 3
[SwitchB-GigabitEthernet0/0/1] qinq vlan-translation enable
[SwitchB-GigabitEthernet0/0/1] port vlan-stacking vlan 100 stack-vlan 2
[SwitchB-GigabitEthernet0/0/1] port vlan-stacking vlan 300 stack-vlan 3
[SwitchB-GigabitEthernet0/0/1] quit

3. Configure other interfaces.


# Add GE0/0/2 to VLAN 2 and VLAN 3 on SwitchA.
[SwitchA] interface gigabitethernet 0/0/2
[SwitchA-GigabitEthernet0/0/2] port link-type trunk
[SwitchA-GigabitEthernet0/0/2] port trunk allow-pass vlan 2 3
[SwitchA-GigabitEthernet0/0/2] quit

# Add GE0/0/2 to VLAN 2 and VLAN 3 on SwitchB.


[SwitchB] interface gigabitethernet 0/0/2
[SwitchB-GigabitEthernet0/0/2] port link-type trunk
[SwitchB-GigabitEthernet0/0/2] port trunk allow-pass vlan 2 3
[SwitchB-GigabitEthernet0/0/2] quit

4. Verify the configuration.


If the configurations on SwitchA and SwitchB are correct, the following situations occur:
 PCs can communicate with each other through the ISP network.
 VoIP terminals can communicate with each other through the ISP network.

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

 SwitchB configuration file


 #
 sysname SwitchB
 #
 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

9.8.3 Example for Configuring Selective QinQ and VLAN Mapping


Networking Requirements
In Figure 9-13, Internet access, IPTV, and VoIP services are provided for users through home gateways.
The corridor switches allocate VLANs to the services as follows:
 VLANs for the Internet access service of different users: VLAN 1000 to VLAN 1100
 Shared VLAN for the IPTV service: VLAN 1101
 Shared VLAN for the VoIP service: VLAN 1102
 Shared VLAN for home gateways: VLAN 1103
Each community switch is connected to 50 downstream corridor switches, and maps VLAN IDs in packets of
the Internet access service from the corridor switches to VLANs 101-150.
The aggregation switch of the carrier is connected to 50 downstream community switches, and adds outer
VLAN IDs 21-70 to packets sent from the community switches.
Figure 9-13 Networking diagram for configuring selective QinQ and VLAN mapping

Configuration Roadmap
The configuration roadmap is as follows:
1. Create VLANs on SwitchA and SwitchB.
2. Configure VLAN mapping on SwitchB and add GE 0/0/1 and GE 0/0/2 to VLANs.
3. Configure selective QinQ on SwitchA and add GE 0/0/1 to VLANs.
4. Add other downlink interfaces of SwitchA and SwitchB to VLANs. The configurations are similar to
the configurations of GE0/0/1 interfaces, and are not mentioned here.
5. Configure other community switches. The configuration is similar to the configuration of SwitchB,
and is not mentioned here.

Procedure
1. Configure SwitchA.
# Create VLANs.
<HUAWEI> system-view
[HUAWEI] sysname SwitchA
[SwitchA] vlan batch 21 to 70 1101 to 1103

# Add downlink interface gigabitethernet 0/0/1 to VLANs.


[SwitchA] interface gigabitethernet 0/0/1
[SwitchA-GigabitEthernet0/0/1] port link-type hybrid
[SwitchA-GigabitEthernet0/0/1] port hybrid untagged vlan 21
[SwitchA-GigabitEthernet0/0/1] port hybrid tagged vlan 1101 to 1103
[SwitchA-GigabitEthernet0/0/1] quit

# Configure selective QinQ on gigabitethernet 0/0/1.


[SwitchA] interface gigabitethernet 0/0/1
[SwitchA-GigabitEthernet0/0/1] qinq vlan-translation enable
[SwitchA-GigabitEthernet0/0/1] port vlan-stacking vlan 101 to 150 stack-vlan 21
[SwitchA-GigabitEthernet0/0/1] quit

2. Configure SwitchB.
# Create VLANs.
<HUAWEI> system-view
[HUAWEI] sysname SwitchB
[SwitchB] vlan batch 101 to 150 1000 to 1103

# Add interfaces to VLANs.


[SwitchB] interface gigabitethernet 0/0/1
[SwitchB-GigabitEthernet0/0/1] port link-type hybrid
[SwitchB-GigabitEthernet0/0/1] port hybrid tagged vlan 101 1000 to 1103
[SwitchB-GigabitEthernet0/0/1] quit
[SwitchB] interface gigabitethernet 0/0/2
[SwitchB-GigabitEthernet0/0/2] port link-type hybrid
[SwitchB-GigabitEthernet0/0/2] port hybrid tagged vlan 101 to 150 1101 to 1103
[SwitchB-GigabitEthernet0/0/2] quit

# Configure VLAN mapping on downlink interface gigabitethernet 0/0/1.


[SwitchB] interface gigabitethernet 0/0/1
[SwitchB-GigabitEthernet0/0/1] qinq vlan-translation enable
[SwitchB-GigabitEthernet0/0/1] port vlan-mapping vlan 1000 to 1100 map-vlan 101
[SwitchB-GigabitEthernet0/0/1] quit

3. Verify the configuration.


The Internet access service, IPTV service, and VoIP service are available.

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
 SwitchB configuration file
 #
 sysname SwitchB
 #
 vlan batch 101 to 150 1000 to 1103
 #
 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

9.8.4 Example for Connecting a Single-Tag VLAN Mapping Sub-


Interface to a VLL Network
Networking Requirements
In Figure 9-14, CE1 and CE2 are connected to PE1 and PE2 respectively through VLANs.
A Martini VLL is set up between CE1 and CE2.

NOTE:
 Only the S6720EI supports this example.
 VLAN termination sub-interfaces cannot be created on a VCMP client.

Figure 9-14 Networking diagram for connecting a single-tag VLAN mapping sub-interface to a VLL network

Switch Interface VLANIF Interface IP Address

PE1 GigabitEthernet0/0/1 GigabitEthernet0/0/1.1 -

- GigabitEthernet0/0/2 VLANIF 20 10.1.1.1/24


- Loopback1 - 1.1.1.1/32

PE2 GigabitEthernet0/0/1 VLANIF 30 10.2.2.1/24

- GigabitEthernet0/0/2 GigabitEthernet0/0/2.1 -

- Loopback1 - 3.3.3.3/32

P GigabitEthernet0/0/1 VLANIF 30 10.2.2.2/24

- GigabitEthernet0/0/2 VLANIF 20 10.1.1.2/24

- Loopback1 - 2.2.2.2/32

CE1 GigabitEthernet0/0/1 VLANIF 10 10.10.10.1/24

CE2 GigabitEthernet0/0/1 VLANIF 20 10.10.10.2/24

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
1. Add interfaces of CEs, PEs, and P to VLANs and configure IP addresses for the VLANIF interfaces
according to Figure 9-14.
# 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

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
[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 peercommand 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

OSPF Process 1 with Router ID 1.1.1.1


Neighbors

Area 0.0.0.0 interface 10.1.1.1(Vlanif20)'s neighbors


Router ID: 2.2.2.2 Address: 10.1.1.2
State: Full Mode:Nbr is Master Priority: 1
DR: 10.1.1.2 BDR: 10.1.1.1 MTU: 0
Dead timer due in 34 sec
Retrans timer interval: 5
Neighbor is up for 00:01:16
Authentication Sequence: [ 0 ]
[PE1] display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 8 Routes : 8

Destination/Mask Proto Pre Cost Flags NextHop Interface

1.1.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack1


2.2.2.2/32 OSPF 10 1 D 10.1.1.2 Vlanif20
3.3.3.3/32 OSPF 10 2 D 10.1.1.2 Vlanif20
10.1.1.0/24 Direct 0 0 D 10.1.1.1 Vlanif20
10.1.1.1/32 Direct 0 0 D 127.0.0.1 Vlanif20
10.2.2.0/24 OSPF 10 2 D 10.1.1.2 Vlanif20
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0

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.
[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

4. Create remote LDP sessions between PEs.


# 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 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.

5. Enable MPLS L2VPN on PEs and create VC connections.


# On PE1, create a VC connection on GigabitEthernet0/0/1.1 connected to CE1.
[PE1] mpls l2vpn
[PE1-l2vpn] quit
[PE1] vcmp role silent
[PE1] interface gigabitethernet0/0/1
[PE1-GigabitEthernet0/0/1] port link-type hybrid
[PE1-GigabitEthernet0/0/1] quit
[PE1] interface gigabitethernet0/0/1.1
[PE1-GigabitEthernet0/0/1.1] qinq mapping vid 10 map-vlan vid 20
[PE1-GigabitEthernet0/0/1.1] mpls l2vc 3.3.3.3 101
[PE1-GigabitEthernet0/0/1.1] quit

# On PE2, create a VC connection on GigabitEthernet0/0/2.1 connected to CE2.


[PE2] mpls l2vpn
[PE2-l2vpn] quit
[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] mpls l2vc 1.1.1.1 101
[PE2-GigabitEthernet0/0/2.1] quit

6. Verify the configuration.


On PEs, check the L2VPN connections. You can see that an L2VC connection has been set up and is
in Up state.
The output on PE1 is used as an example:
[PE1] display mpls l2vc interface gigabitethernet0/0/1.1
*client interface : GigabitEthernet0/0/1.1 is up
Administrator PW : no
session state : up
AC status : up
Ignore AC state : disable
VC state : up
Label state : 0
Token state : 0
VC ID : 101
VC type : VLAN
destination : 3.3.3.3
local group ID : 0 remote group ID : 0
local VC label : 23552 remote VC label : 23552
local AC OAM State : up
local PSN OAM State : up
local forwarding state : forwarding
local status code : 0x0
remote AC OAM state : up
remote PSN OAM state : up
remote forwarding state: forwarding
remote status code : 0x0
ignore standby state : no
BFD for PW : unavailable
VCCV State : up
manual fault : not set
active state : active
forwarding entry : exist
link state : up
local VC MTU : 1500 remote VC MTU : 1500
local VCCV : alert ttl lsp-ping bfd
remote VCCV : alert ttl lsp-ping bfd
local control word : disable remote control word : disable
tunnel policy name : --
PW template name : --
primary or secondary : primary
load balance type : flow
Access-port : false
Switchover Flag : false
VC tunnel/token info : 1 tunnels/tokens
NO.0 TNL type : lsp , TNL ID : 0x10031
Backup TNL type : lsp , TNL ID : 0x0
create time : 1 days, 22 hours, 15 minutes, 9 seconds
up time : 0 days, 22 hours, 54 minutes, 57 seconds
last change time : 0 days, 22 hours, 54 minutes, 57 seconds
VC last up time : 2010/10/09 19:26:37
VC total up time : 1 days, 20 hours, 42 minutes, 30 seconds
CKey : 8
NKey : 3
PW redundancy mode : --
AdminPw interface : --
AdminPw link state : --
Diffserv Mode : uniform
Service Class : --
Color : --
DomainId : --
Domain Name : --

CE1 and CE2 can ping each other.


The output on CE1 is used as an example:
[CE1] ping 10.10.10.2
PING 10.10.10.2: 56 data bytes, press CTRL_C to break
Reply from 10.10.10.2: bytes=56 Sequence=1 ttl=255 time=31 ms
Reply from 10.10.10.2: bytes=56 Sequence=2 ttl=255 time=10 ms
Reply from 10.10.10.2: bytes=56 Sequence=3 ttl=255 time=5 ms
Reply from 10.10.10.2: bytes=56 Sequence=4 ttl=255 time=2 ms
Reply from 10.10.10.2: bytes=56 Sequence=5 ttl=255 time=28 ms

--- 10.10.10.2 ping statistics ---


5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 2/15/31 ms

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

 PE1 configuration file


 #
 sysname PE1
 #
 router id 1.1.1.1
 #
 vcmp role silent
 #
 vlan batch 20
 #
 mpls lsr-id 1.1.1.1
 mpls
 #
 mpls l2vpn
 #
 mpls ldp
 #
 mpls ldp remote-peer 3.3.3.3
 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

 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
 dot1q termination vid 20
 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

 CE2 configuration file


 #
 sysname CE2
 #
 vlan batch 20
 #
 interface Vlanif20
 ip address 10.10.10.2 255.255.255.0
 #
 interface GigabitEthernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 20
 #
return

9.8.5 Example for Connecting a Double-Tag VLAN Mapping Sub-


Interface to a VLL Network
Networking Requirements
As shown in Figure 9-15, CE1 and CE2 are connected to PE1 and PE2 respectively through VLANs.
A Martini VLL is set up between PE1 and PE2.
Switch1 is connected to CE1 and PE1.
Switch2 is connected to CE2 and PE2.
Selective QinQ is required on the switch interfaces connected to CEs to tag packets sent from CEs with the
VLAN IDs specified by the carrier.
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 S6720EI supports this example.
 VLAN termination sub-interfaces cannot be created on a VCMP client.

Figure 9-15 Networking diagram for connecting a double-tag VLAN mapping sub-interface to a VLL network
Switch Interface VLANIF Interface IP address

PE1 GigabitEthernet0/0/1 GigabitEthernet0/0/1.1 -

- GigabitEthernet0/0/2 VLANIF 20 10.1.1.1/24

- Loopback1 - 1.1.1.1/32

PE2 GigabitEthernet0/0/1 VLANIF 30 10.2.2.1/24

- GigabitEthernet0/0/2 GigabitEthernet0/0/2.1 -

- Loopback1 - 3.3.3.3/32

P GigabitEthernet0/0/1 VLANIF 30 10.2.2.2/24

- GigabitEthernet0/0/2 VLANIF 20 10.1.1.2/24

- Loopback1 - 2.2.2.2/32

CE1 GigabitEthernet0/0/1 VLANIF 10 10.10.10.1/24

CE2 GigabitEthernet0/0/1 VLANIF 10 10.10.10.2/24

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 PE1 interface connected to Switch1, configure double-tag VLAN
mapping, and create a VC to connect the QinQ sub-interface to a VLL network.
5. Create a sub-interface on the PE2 interface connected to Switch2, and create a VC to connect the
QinQ sub-interface to a VLL network.
6. Configure selective QinQ on the switch interfaces connected to CEs.

Procedure
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 9-15.
# Configure CE1 to ensure that each packet sent from CE1 to Switch1 carries a single 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 a single 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

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

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 peercommand 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

OSPF Process 1 with Router ID 1.1.1.1


Neighbors

Area 0.0.0.0 interface 10.1.1.1(Vlanif20)'s neighbors


Router ID: 2.2.2.2 Address: 10.1.1.2
State: Full Mode:Nbr is Master Priority: 1
DR: 10.1.1.2 BDR: 10.1.1.1 MTU: 0
Dead timer due in 34 sec
Retrans timer interval: 5
Neighbor is up for 00:01:16
Authentication Sequence: [ 0 ]
[PE1] display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 8 Routes : 8

Destination/Mask Proto Pre Cost Flags NextHop Interface


1.1.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack1
2.2.2.2/32 OSPF 10 1 D 10.1.1.2 Vlanif20
3.3.3.3/32 OSPF 10 2 D 10.1.1.2 Vlanif20
10.1.1.0/24 Direct 0 0 D 10.1.1.1 Vlanif20
10.1.1.1/32 Direct 0 0 D 127.0.0.1 Vlanif20
10.2.2.0/24 OSPF 10 2 D 10.1.1.2 Vlanif20
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0

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

5. Create remote LDP sessions between PEs.


# 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 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.

6. Enable MPLS L2VPN on PEs and create VC connections.


# On PE1, create a VC connection on GigabitEthernet0/0/1.1 connected to CE1.
[PE1] mpls l2vpn
[PE1-l2vpn] quit
[PE1] vcmp role silent
[PE1] interface gigabitethernet0/0/1
[PE1-GigabitEthernet0/0/1] port link-type hybrid
[PE1-GigabitEthernet0/0/1] quit
[PE1] interface gigabitethernet0/0/1.1
[PE1-GigabitEthernet0/0/1.1] qinq mapping pe-vid 100 ce-vid 10 map-vlan vid 200
[PE1-GigabitEthernet0/0/1.1] mpls l2vc 3.3.3.3 101
[PE1-GigabitEthernet0/0/1.1] quit

# On PE2, create a VC connection on GigabitEthernet0/0/2.1 connected to Switch2.


[PE2] mpls l2vpn
[PE2-l2vpn] quit
[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] mpls l2vc 1.1.1.1 101
[PE2-GigabitEthernet0/0/2.1] quit

7. Verify the configuration.


Check the L2VPN connections on PEs. You can see that an L2VC connection has been set up and is
in Up state.
The display on PE1 is used as an example.
[PE1] display mpls l2vc interface gigabitethernet0/0/1.1
*client interface : GigabitEthernet0/0/1.1 is up
Administrator PW : no
session state : up
AC status : up
Ignore AC state : disable
VC state : up
Label state : 0
Token state : 0
VC ID : 101
VC type : VLAN
destination : 3.3.3.3
local group ID : 0 remote group ID : 0
local VC label : 23552 remote VC label : 23552
local AC OAM State : up
local PSN OAM State : up
local forwarding state : forwarding
local status code : 0x0
remote AC OAM state : up
remote PSN OAM state : up
remote forwarding state: forwarding
remote status code : 0x0
ignore standby state : no
BFD for PW : unavailable
VCCV State : up
manual fault : not set
active state : active
forwarding entry : exist
link state : up
local VC MTU : 1500 remote VC MTU : 1500
local VCCV : alert ttl lsp-ping bfd
remote VCCV : alert ttl lsp-ping bfd
local control word : disable remote control word : disable
tunnel policy name : --
PW template name : --
primary or secondary : primary
load balance type : flow
Access-port : false
Switchover Flag : false
VC tunnel/token info : 1 tunnels/tokens
NO.0 TNL type : lsp , TNL ID : 0x10031
Backup TNL type : lsp , TNL ID : 0x0
create time : 1 days, 22 hours, 15 minutes, 9 seconds
up time : 0 days, 22 hours, 54 minutes, 57 seconds
last change time : 0 days, 22 hours, 54 minutes, 57 seconds
VC last up time : 2010/10/09 19:26:37
VC total up time : 1 days, 20 hours, 42 minutes, 30 seconds
CKey : 8
NKey : 3
PW redundancy mode : --
AdminPw interface : --
AdminPw link state : --
Diffserv Mode : uniform
Service Class : --
Color : --
DomainId : --
Domain Name : --

CE1 and CE2 can ping each other.


The output on CE1 is used as an example:
[CE1] ping 10.10.10.2
PING 10.10.10.2: 56 data bytes, press CTRL_C to break
Reply from 10.10.10.2: bytes=56 Sequence=1 ttl=255 time=31 ms
Reply from 10.10.10.2: bytes=56 Sequence=2 ttl=255 time=10 ms
Reply from 10.10.10.2: bytes=56 Sequence=3 ttl=255 time=5 ms
Reply from 10.10.10.2: bytes=56 Sequence=4 ttl=255 time=2 ms
Reply from 10.10.10.2: bytes=56 Sequence=5 ttl=255 time=28 ms
--- 10.10.10.2 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 2/15/31 ms

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

 Switch1 configuration file


 #
 sysname Switch1
 #
 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

 PE1 configuration file


 #
 sysname PE1
 #
 router id 1.1.1.1
 #
 vcmp role silent
 #
 vlan batch 20
 #
 mpls lsr-id 1.1.1.1
 mpls
 #
 mpls l2vpn
 #
 mpls ldp
 #
 mpls ldp remote-peer 3.3.3.3
 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 pe-vid 100 ce-vid 10 map-vlan vid 200
 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
 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

 Switch2 configuration file


 #
 sysname Switch2
 #
 vlan batch 200
 #
 interface GigabitEthernet0/0/1
 port link-type hybrid
 qinq vlan-translation enable
 port hybrid untagged vlan 200
 port vlan-stacking vlan 10 stack-vlan 200
 #
 interface GigabitEthernet0/0/2
 port link-type hybrid
 port hybrid tagged vlan 200
 #
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

9.8.6 Example for Connecting a VLAN Stacking Sub-interface to a VLL


Network
Networking Requirements
In Figure 9-16, CE1 and CE2 are connected to PE1 and PE2 respectively through VLANs.
A Martini VLL is set up between CE1 and CE2.
Switch1 is connected to CE1 and PE1.
Switch2 is connected to CE2 and PE2.
Switch1 forwards the packets sent from CE1 without changing VLAN tags.
Selective QinQ needs to be configured 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. To allow CE1 and CE2 to communicate with each other, configure VLAN stacking on
the sub-interface of PE1 connected to Switch1, and connect the sub-interface to a VLL network.
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 S6720EI supports this example.
 VLAN termination sub-interfaces cannot be created on a VCMP client.

Figure 9-16 Networking diagram for connecting a VLAN stacking sub-interface to a VLL network

Switch Interface VLANIF Interface IP address

PE1 GigabitEthernet0/0/1 GigabitEthernet0/0/1.1 -

- GigabitEthernet0/0/2 VLANIF 20 10.1.1.1/24

- Loopback1 - 1.1.1.1/32

PE2 GigabitEthernet0/0/1 VLANIF 30 10.2.2.1/24

- GigabitEthernet0/0/2 GigabitEthernet0/0/2.1 -

- Loopback1 - 3.3.3.3/32

P GigabitEthernet0/0/1 VLANIF 30 10.2.2.2/24

- GigabitEthernet0/0/2 VLANIF 20 10.1.1.2/24

- Loopback1 - 2.2.2.2/32

CE1 GigabitEthernet0/0/1 VLANIF 10 10.10.10.1/24

CE2 GigabitEthernet0/0/1 VLANIF 10 10.10.10.2/24

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
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 9-16.
# Configure CE1 to ensure that each packet sent from CE1 to Switch1 carries a single 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 a single 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

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] 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

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 peercommand 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

OSPF Process 1 with Router ID 1.1.1.1


Neighbors

Area 0.0.0.0 interface 10.1.1.1(Vlanif20)'s neighbors


Router ID: 2.2.2.2 Address: 10.1.1.2
State: Full Mode:Nbr is Master Priority: 1
DR: 10.1.1.2 BDR: 10.1.1.1 MTU: 0
Dead timer due in 34 sec
Retrans timer interval: 5
Neighbor is up for 00:01:16
Authentication Sequence: [ 0 ]
[PE1] display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 8 Routes : 8

Destination/Mask Proto Pre Cost Flags NextHop Interface

1.1.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack1


2.2.2.2/32 OSPF 10 1 D 10.1.1.2 Vlanif20
3.3.3.3/32 OSPF 10 2 D 10.1.1.2 Vlanif20
10.1.1.0/24 Direct 0 0 D 10.1.1.1 Vlanif20
10.1.1.1/32 Direct 0 0 D 127.0.0.1 Vlanif20
10.2.2.0/24 OSPF 10 2 D 10.1.1.2 Vlanif20
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0

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

5. Create remote LDP sessions between PEs.


# 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.

6. Enable MPLS L2VPN on PEs and set up VC connections.


# On PE1, create a VC connection on GigabitEthernet0/0/1.1 that is connected to Switch1.
[PE1] mpls l2vpn
[PE1-l2vpn] quit
[PE1] vcmp role silent
[PE1] interface gigabitethernet0/0/1
[PE1-GigabitEthernet0/0/1] port link-type hybrid
[PE1-GigabitEthernet0/0/1] quit
[PE1] interface gigabitethernet0/0/1.1
[PE1-GigabitEthernet0/0/1.1] qinq stacking vid 10 pe-vid 100
[PE1-GigabitEthernet0/0/1.1] mpls l2vc 3.3.3.3 101
[PE1-GigabitEthernet0/0/1.1] quit

# On PE2, create a VC connection on GigabitEthernet0/0/2.1 that is connected to Switch2.


[PE2] mpls l2vpn
[PE2-l2vpn] quit
[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] mpls l2vc 1.1.1.1 101
[PE2-GigabitEthernet0/0/2.1] quit

7. Verify the configuration.


Check the L2VPN connections on PEs. You can see that an L2VC connection has been set up and is
in Up state.
The display on PE1 is used as an example.
[PE1] display mpls l2vc interface gigabitethernet0/0/1.1
*client interface : GigabitEthernet0/0/1.1 is up
Administrator PW : no
session state : up
AC status : up
Ignore AC state : disable
VC state : up
Label state : 0
Token state : 0
VC ID : 101
VC type : VLAN
destination : 3.3.3.3
local group ID : 0 remote group ID : 0
local VC label : 23552 remote VC label : 23552
local AC OAM State : up
local PSN OAM State : up
local forwarding state : forwarding
local status code : 0x0
remote AC OAM state : up
remote PSN OAM state : up
remote forwarding state: forwarding
remote status code : 0x0
ignore standby state : no
BFD for PW : unavailable
VCCV State : up
manual fault : not set
active state : active
forwarding entry : exist
link state : up
local VC MTU : 1500 remote VC MTU : 1500
local VCCV : alert ttl lsp-ping bfd
remote VCCV : alert ttl lsp-ping bfd
local control word : disable remote control word : disable
tunnel policy name : --
PW template name : --
primary or secondary : primary
load balance type : flow
Access-port : false
Switchover Flag : false
VC tunnel/token info : 1 tunnels/tokens
NO.0 TNL type : lsp , TNL ID : 0x10031
Backup TNL type : lsp , TNL ID : 0x0
create time : 1 days, 22 hours, 15 minutes, 9 seconds
up time : 0 days, 22 hours, 54 minutes, 57 seconds
last change time : 0 days, 22 hours, 54 minutes, 57 seconds
VC last up time : 2010/10/09 19:26:37
VC total up time : 1 days, 20 hours, 42 minutes, 30 seconds
CKey : 8
NKey : 3
PW redundancy mode : --
AdminPw interface : --
AdminPw link state : --
Diffserv Mode : uniform
Service Class : --
Color : --
DomainId : --
Domain Name : --

CE1 and CE2 can ping each other.


The display on CE1 is used as an example.
[CE1] ping 10.10.10.2
PING 10.10.10.2: 56 data bytes, press CTRL_C to break
Reply from 10.10.10.2: bytes=56 Sequence=1 ttl=255 time=31 ms
Reply from 10.10.10.2: bytes=56 Sequence=2 ttl=255 time=10 ms
Reply from 10.10.10.2: bytes=56 Sequence=3 ttl=255 time=5 ms
Reply from 10.10.10.2: bytes=56 Sequence=4 ttl=255 time=2 ms
Reply from 10.10.10.2: bytes=56 Sequence=5 ttl=255 time=28 ms

--- 10.10.10.2 ping statistics ---


5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 2/15/31 ms

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

 Switch1 configuration file


 #
 sysname Switch1
 #
 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

 PE1 configuration file


 #
 sysname PE1
 #
 router id 1.1.1.1
 #
 vcmp role silent
 #
 vlan batch 20
 #
 mpls lsr-id 1.1.1.1
 mpls
 #
 mpls l2vpn
 #
 mpls ldp
 #
 mpls ldp remote-peer 3.3.3.3
 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 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
9.8.7 Example for Connecting a Single-tag VLAN Mapping Sub-interface
to a VPLS Network
Networking Requirements
In Figure 9-17, VPLS is enabled on PE1 and PE2. CE1 is connected to PE1 and CE2 is connected to PE2. CE1
and CE2 are on the same VPLS network. To implement communication between CE1 and CE2, use LDP as the
VPLS signaling protocol to establish PWs and configure VPLS.

NOTE:
 Only the S6720EI supports this example.
 VLAN termination sub-interfaces cannot be created on a VCMP client.

Figure 9-17 Networking diagram for connecting a single-tag VLAN mapping sub-interface to a VPLS network

Switch Interface VLANIF Interface IP Address

PE1 GigabitEthernet0/0/1 GigabitEthernet0/0/1.1 -

- GigabitEthernet0/0/2 VLANIF 20 4.4.4.4/24

- Loopback1 - 1.1.1.1/32

PE2 GigabitEthernet0/0/1 VLANIF 30 5.5.5.5/24

- GigabitEthernet0/0/2 GigabitEthernet0/0/2.1 -

- Loopback1 - 3.3.3.3/32

P GigabitEthernet0/0/1 VLANIF 20 4.4.4.5/24

- GigabitEthernet0/0/2 VLANIF 30 5.5.5.4/24

- Loopback1 - 2.2.2.2/32

CE1 GigabitEthernet0/0/1 VLANIF 10 10.1.1.1/24

CE2 GigabitEthernet0/0/1 VLANIF 20 10.1.1.2/24

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 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
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 9-17.

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

2. Configure an IGP protocol. 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 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

After the configuration is complete, run the display ip routing-table command on PE1, P, and PE2.
You can view the routes that PE1, P, and PE2 have learned from each other. The following is the
display on PE1:
[PE1] display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 8 Routes : 8

Destination/Mask Proto Pre Cost Flags NextHop Interface

1.1.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack1


2.2.2.2/32 OSPF 10 1 D 4.4.4.5 Vlanif20
3.3.3.3/32 OSPF 10 2 D 4.4.4.5 Vlanif20
4.4.4.0/24 Direct 0 0 D 4.4.4.4 Vlanif20
4.4.4.4/32 Direct 0 0 D 127.0.0.1 Vlanif20
5.5.5.0/24 OSPF 10 2 D 4.4.4.5 Vlanif20
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0

3. Enable basic MPLS functions and MPLS LDP.


# 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

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.

4. Set up a remote LDP session between PEs.


# 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 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.

5. Enable MPLS L2VPN on the PEs.


# Configure PE1.
[PE1] mpls l2vpn
[PE1-l2vpn] quit

# Configure PE2.
[PE2] mpls l2vpn
[PE2-l2vpn] quit

6. Configure a VSI on the PEs.


# Configure PE1.
[PE1] vsi a2 static
[PE1-vsi-a2] pwsignal ldp
[PE1-vsi-a2-ldp] vsi-id 2
[PE1-vsi-a2-ldp] peer 3.3.3.3
[PE1-vsi-a2-ldp] quit
[PE1-vsi-a2] 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

7. Bind sub-interfaces on the PEs to the VSI.


# Configure PE1.
[PE1] vcmp role silent
[PE1] interface gigabitethernet0/0/1
[PE1-GigabitEthernet0/0/1] port link-type hybrid
[PE1-GigabitEthernet0/0/1] quit
[PE1] interface gigabitethernet0/0/1.1
[PE1-GigabitEthernet0/0/1.1] qinq mapping vid 10 map-vlan vid 20
[PE1-GigabitEthernet0/0/1.1] l2 binding vsi a2
[PE1-GigabitEthernet0/0/1.1] 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

8. Verify the configuration.


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

Interface Name : gigabitethernet0/0/1.1


State : up
Access Port : false
Last Up Time : 2010/12/30 11:31:18
Total Up Time : 0 days, 0 hours, 1 minutes, 35 seconds

**PW Information:

*Peer Ip Address : 3.3.3.3


PW State : up
Local VC Label : 23552
Remote VC Label : 23552
Remote Control Word : disable
PW Type : label
Local VCCV : alert lsp-ping
Remote VCCV : alert lsp-ping
Tunnel ID : 0x22
Broadcast Tunnel ID : 0x22
Broad BackupTunnel ID : 0x0
Ckey : 0x2
Nkey : 0x1
Main PW Token : 0x22
Slave PW Token : 0x0
Tnl Type : LSP
OutInterface : Vlanif20
Backup OutInterface :
Stp Enable : 0
PW Last Up Time : 2010/12/30 11:32:03
PW Total Up Time : 0 days, 0 hours, 0 minutes, 50 seconds

CE1 (10.1.1.1) can ping CE2 (10.1.1.2) successfully.


[CE1] ping 10.1.1.2
PING 10.1.1.2: 56 data bytes, press CTRL_C to break
Reply from 10.1.1.2: bytes=56 Sequence=1 ttl=255 time=90 ms
Reply from 10.1.1.2: bytes=56 Sequence=2 ttl=255 time=77 ms
Reply from 10.1.1.2: bytes=56 Sequence=3 ttl=255 time=34 ms
Reply from 10.1.1.2: bytes=56 Sequence=4 ttl=255 time=46 ms
Reply from 10.1.1.2: bytes=56 Sequence=5 ttl=255 time=94 ms

--- 10.1.1.2 ping statistics ---


5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 34/68/94 ms
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

 CE2 configuration file


 #
 sysname CE2
 #
 vlan batch 20
 #
 interface Vlanif20
 ip address 10.1.1.2 255.255.255.0
 #
 interface GigabitEthernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 20
 #
return

 PE1 configuration file


 #
 sysname PE1
 #
 router id 1.1.1.1
 #
 vcmp role silent
 #
 vlan batch 20
 #
 mpls lsr-id 1.1.1.1
 mpls
 #
 mpls l2vpn
 #
 vsi a2 static
 pwsignal ldp
 vsi-id 2
 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 vid 10 map-vlan vid 20
 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
 dot1q termination vid 20
 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

9.8.8 Example for Connecting a Double-tag VLAN Mapping Sub-


interface to a VPLS Network
Networking Requirements
In Figure 9-18, VPLS is enabled on PE1 and PE2. CE1 connects to PE1 through Switch1 and CE2 connects to
PE2 through Switch2. CE1 and CE2 are on the same VPLS network. To implement communication between
CE1 and CE2, use LDP as the VPLS signaling protocol to establish PWs and configure VPLS.
You are required to configure selective QinQ on the switch interfaces connected to CEs so that Switch1
and Switch2 add the VLAN tags specified by the carrier to the packets sent from CEs.
When Switch1 and Switch2 allow different VLAN tags, configure a double-tag VLAN mapping sub-interface
on a PE and connect the sub-interface to the VPLS to enable communication between CE1 and CE2.
When the 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 S6720EI supports this example.
 VLAN termination sub-interfaces cannot be created on a VCMP client.

Figure 9-18 Networking diagram for connecting a double-tag VLAN mapping sub-interface to a VPLS network

Switch Interface VLANIF Interface IP Address

PE1 GigabitEthernet0/0/1 GigabitEthernet0/0/1.1 -

- GigabitEthernet0/0/2 VLANIF 20 4.4.4.4/24

- Loopback1 - 1.1.1.1/32

PE2 GigabitEthernet0/0/1 VLANIF 30 5.5.5.5/24

- GigabitEthernet0/0/2 GigabitEthernet0/0/2.1 -

- Loopback1 - 3.3.3.3/32

P GigabitEthernet0/0/1 VLANIF 20 4.4.4.5/24

- GigabitEthernet0/0/2 VLANIF 30 5.5.5.4/24

- Loopback1 - 2.2.2.2/32

CE1 GigabitEthernet0/0/1 VLANIF 10 10.1.1.1/24

CE2 GigabitEthernet0/0/1 VLANIF 10 10.1.1.2/24


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 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
1. Create VLANs on the devices, add interfaces to the VLANs, and assign IP addresses to VLANIF
interfaces according to Figure 9-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.
 Ensure that each packet sent from a CE to the Switch carries a single 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

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

3. Configure an IGP protocol. 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 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

After the configuration is complete, run the display ip routing-table command on PE1, P, and PE2.
You can view the routes that PE1, P, and PE2 have learned from each other. The following is the
display on PE1:
[PE1] display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 8 Routes : 8

Destination/Mask Proto Pre Cost Flags NextHop Interface

1.1.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack1


2.2.2.2/32 OSPF 10 1 D 4.4.4.5 Vlanif20
3.3.3.3/32 OSPF 10 2 D 4.4.4.5 Vlanif20
4.4.4.0/24 Direct 0 0 D 4.4.4.4 Vlanif20
4.4.4.4/32 Direct 0 0 D 127.0.0.1 Vlanif20
5.5.5.0/24 OSPF 10 2 D 4.4.4.5 Vlanif20
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0

4. Enable basic MPLS functions and MPLS LDP.


# 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

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.

5. Set up a remote LDP session between PEs.


# 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 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.

6. Enable MPLS L2VPN on the PEs.


# Configure PE1.
[PE1] mpls l2vpn
[PE1-l2vpn] quit

# Configure PE2.
[PE2] mpls l2vpn
[PE2-l2vpn] quit

7. Configure a VSI on the PEs.


# Configure PE1.
[PE1] vsi a2 static
[PE1-vsi-a2] pwsignal ldp
[PE1-vsi-a2-ldp] vsi-id 2
[PE1-vsi-a2-ldp] peer 3.3.3.3
[PE1-vsi-a2-ldp] quit
[PE1-vsi-a2] 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

8. Bind sub-interfaces interfaces to the VSI on PEs.


# Configure PE1.
[PE1] vcmp role silent
[PE1] interface gigabitethernet0/0/1
[PE1-GigabitEthernet0/0/1] port link-type hybrid
[PE1-GigabitEthernet0/0/1] quit
[PE1] interface gigabitethernet0/0/1.1
[PE1-GigabitEthernet0/0/1.1] qinq mapping pe-vid 100 ce-vid 10 map-vlan vid 200
[PE1-GigabitEthernet0/0/1.1] l2 binding vsi a2
[PE1-GigabitEthernet0/0/1.1] 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

9. Verify the configuration.


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

Interface Name : gigabitethernet0/0/1.1


State : up
Access Port : false
Last Up Time : 2010/12/30 11:31:18
Total Up Time : 0 days, 0 hours, 1 minutes, 35 seconds

**PW Information:

*Peer Ip Address : 3.3.3.3


PW State : up
Local VC Label : 23552
Remote VC Label : 23552
Remote Control Word : disable
PW Type : label
Local VCCV : alert lsp-ping
Remote VCCV : alert lsp-ping
Tunnel ID : 0x22
Broadcast Tunnel ID : 0x22
Broad BackupTunnel ID : 0x0
Ckey : 0x2
Nkey : 0x1
Main PW Token : 0x22
Slave PW Token : 0x0
Tnl Type : LSP
OutInterface : Vlanif20
Backup OutInterface :
Stp Enable : 0
PW Last Up Time : 2010/12/30 11:32:03
PW Total Up Time : 0 days, 0 hours, 0 minutes, 50 seconds

CE1 (10.1.1.1) can ping CE2 (10.1.1.2) successfully.


<CE1> ping 10.1.1.2
PING 10.1.1.2: 56 data bytes, press CTRL_C to break
Reply from 10.1.1.2: bytes=56 Sequence=1 ttl=255 time=90 ms
Reply from 10.1.1.2: bytes=56 Sequence=2 ttl=255 time=77 ms
Reply from 10.1.1.2: bytes=56 Sequence=3 ttl=255 time=34 ms
Reply from 10.1.1.2: bytes=56 Sequence=4 ttl=255 time=46 ms
Reply from 10.1.1.2: bytes=56 Sequence=5 ttl=255 time=94 ms

--- 10.1.1.2 ping statistics ---


5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 34/68/94 ms

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
 CE2 configuration file
 #
 sysname CE2
 #
 vlan batch 10
 #
 interface Vlanif10
 ip address 10.1.1.2 255.255.255.0
 #
 interface GigabitEthernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 10
 #
return

 Switch1 configuration file


 #
 sysname Switch1
 #
 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

 Switch2 configuration file


 #
 sysname Switch2
 #
 vlan batch 200
 #
 interface GigabitEthernet0/0/1
 port link-type hybrid
 qinq vlan-translation enable
 port hybrid untagged vlan 200
 port vlan-stacking vlan 10 stack-vlan 200
 #
 interface GigabitEthernet0/0/2
 port link-type hybrid
 port hybrid tagged vlan 200
 #
return

 PE1 configuration file


 #
 sysname PE1
 #
 router id 1.1.1.1
 #
 vcmp role silent
 #
 vlan batch 20
 #
 mpls lsr-id 1.1.1.1
 mpls
 #
 mpls l2vpn
 #
 vsi a2 static
 pwsignal ldp
 vsi-id 2
 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

9.8.9 Example for Connecting a VLAN Stacking Sub-interface to a VPLS


Network
Networking Requirements
In Figure 9-19, VPLS is enabled on PE1 and PE2. CE1 connects to PE1 through Switch1 and CE2 connects to
PE2 through Switch2. CE1 and CE2 are on 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 fromSwitch2 to PE2
contain double 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 S6720EI supports this example.
 VLAN termination sub-interfaces cannot be created on a VCMP client.

Figure 9-19 Networking diagram for connecting a VLAN stacking sub-interface to a VPLS network

Switch Interface VLANIF Interface IP Address


PE1 GigabitEthernet0/0/1 GigabitEthernet0/0/1.1 -

- GigabitEthernet0/0/2 VLANIF 20 4.4.4.4/24

- Loopback1 - 1.1.1.1/32

PE2 GigabitEthernet0/0/1 VLANIF 30 5.5.5.5/24

- GigabitEthernet0/0/2 GigabitEthernet0/0/2.1 -

- Loopback1 - 3.3.3.3/32

P GigabitEthernet0/0/1 VLANIF 20 4.4.4.5/24

- GigabitEthernet0/0/2 VLANIF 30 5.5.5.4/24

- Loopback1 - 2.2.2.2/32

CE1 GigabitEthernet0/0/1 VLANIF 10 10.1.1.1/24

CE2 GigabitEthernet0/0/1 VLANIF 10 10.1.1.2/24

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
1. Create VLANs on the devices, add interfaces to the VLANs, and assign IP addresses to VLANIF
interfaces according to Figure 9-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 a single 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

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

3. Configure an IGP protocol. 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 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

After the configuration is complete, run the display ip routing-table command on PE1, P, and PE2.
You can view the routes that PE1, P, and PE2 have learned from each other. The following is the
display on PE1:
[PE1] display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 8 Routes : 8

Destination/Mask Proto Pre Cost Flags NextHop Interface

1.1.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack1


2.2.2.2/32 OSPF 10 1 D 4.4.4.5 Vlanif20
3.3.3.3/32 OSPF 10 2 D 4.4.4.5 Vlanif20
4.4.4.0/24 Direct 0 0 D 4.4.4.4 Vlanif20
4.4.4.4/32 Direct 0 0 D 127.0.0.1 Vlanif20
5.5.5.0/24 OSPF 10 2 D 4.4.4.5 Vlanif20
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0

4. Enable basic MPLS functions and MPLS LDP.


# 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

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.

5. Set up a remote LDP session between PEs.


# 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 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.

6. Enable MPLS L2VPN on the PEs.


# Configure PE1.
[PE1] mpls l2vpn
[PE1-l2vpn] quit

# Configure PE2.
[PE2] mpls l2vpn
[PE2-l2vpn] quit

7. Configure a VSI on the PEs.


# Configure PE1.
[PE1] vsi a2 static
[PE1-vsi-a2] pwsignal ldp
[PE1-vsi-a2-ldp] vsi-id 2
[PE1-vsi-a2-ldp] peer 3.3.3.3
[PE1-vsi-a2-ldp] quit
[PE1-vsi-a2] 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

8. Bind sub-interfaces to the VSI on the PEs.


# Configure PE1.
[PE1] vcmp role silent
[PE1] interface gigabitethernet0/0/1
[PE1-GigabitEthernet0/0/1] port link-type hybrid
[PE1-GigabitEthernet0/0/1] quit
[PE1] interface gigabitethernet0/0/1.1
[PE1-GigabitEthernet0/0/1.1] qinq stacking vid 10 pe-vid 100
[PE1-GigabitEthernet0/0/1.1] l2 binding vsi a2
[PE1-GigabitEthernet0/0/1.1] 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

9. Verify the configuration.


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

Interface Name : gigabitethernet0/0/1.1


State : up
Access Port : false
Last Up Time : 2010/12/30 11:31:18
Total Up Time : 0 days, 0 hours, 1 minutes, 35 seconds

**PW Information:

*Peer Ip Address : 3.3.3.3


PW State : up
Local VC Label : 23552
Remote VC Label : 23552
Remote Control Word : disable
PW Type : label
Local VCCV : alert lsp-ping
Remote VCCV : alert lsp-ping
Tunnel ID : 0x22
Broadcast Tunnel ID : 0x22
Broad BackupTunnel ID : 0x0
Ckey : 0x2
Nkey : 0x1
Main PW Token : 0x22
Slave PW Token : 0x0
Tnl Type : LSP
OutInterface : Vlanif20
Backup OutInterface :
Stp Enable : 0
PW Last Up Time : 2010/12/30 11:32:03
PW Total Up Time : 0 days, 0 hours, 0 minutes, 50 seconds

CE1 (10.1.1.1) can ping CE2 (10.1.1.2) successfully.


<CE1> ping 10.1.1.2
PING 10.1.1.2: 56 data bytes, press CTRL_C to break
Reply from 10.1.1.2: bytes=56 Sequence=1 ttl=255 time=90 ms
Reply from 10.1.1.2: bytes=56 Sequence=2 ttl=255 time=77 ms
Reply from 10.1.1.2: bytes=56 Sequence=3 ttl=255 time=34 ms
Reply from 10.1.1.2: bytes=56 Sequence=4 ttl=255 time=46 ms
Reply from 10.1.1.2: bytes=56 Sequence=5 ttl=255 time=94 ms

--- 10.1.1.2 ping statistics ---


5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 34/68/94 ms

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

 CE2 configuration file


 #
 sysname CE2
 #
 vlan batch 10
 #
 interface Vlanif10
 ip address 10.1.1.2 255.255.255.0
 #
 interface GigabitEthernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 10
 #
return

 Switch1 configuration file


 #
 sysname Switch1
 #
 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

 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

 PE1 configuration file


 #
 sysname PE1
 #
 router id 1.1.1.1
 #
 vcmp role silent
 #
 vlan batch 20
 #
 mpls lsr-id 1.1.1.1
 mpls
 #
 mpls l2vpn
 #
 vsi a2 static
 pwsignal ldp
 vsi-id 2
 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 stacking vid 10 pe-vid 100
 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 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

9.8.10 Example for Configuring QinQ Stacking on a VLANIF Interface


Networking Requirements
As shown in Figure 9-20, SwitchA is connected to SwitchB through a third-party network. The management
VLAN is deployed on SwitchB. The management VLAN ID is the same as the VLAN ID of SwitchA, and is
different from the VLAN ID provided by the carrier. To remotely log in to SwitchB from SwitchA, you can
configure VLAN stacking.
Figure 9-20 Networking diagram for configuring QinQ stacking on a VLANIF interface

To remotely log in to SwitchB from SwitchA to manage VLAN services, configure QinQ stacking on the
VLANIF interface corresponding to the management VLAN on SwitchB.

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
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

2. Configure SwitchA.
# Configure QinQ so that the packets sent from SwitchA to SwitchB carry double tags.
<HUAWEI> system-view
[HUAWEI] sysname SwitchA
[SwitchA] vlan batch 20
[SwitchA] interface gigabitethernet 0/0/1
[SwitchA-GigabitEthernet0/0/1] port link-type hybrid
[SwitchA-GigabitEthernet0/0/1] qinq vlan-translation enable
[SwitchA-GigabitEthernet0/0/1] port vlan-stacking vlan 10 stack-vlan 20
[SwitchA-GigabitEthernet0/0/1] port hybrid untagged vlan 20
[SwitchA-GigabitEthernet0/0/1] quit
[SwitchA] interface gigabitethernet 0/0/2
[SwitchA-GigabitEthernet0/0/2] port link-type hybrid
[SwitchA-GigabitEthernet0/0/2] port hybrid tagged vlan 20
[SwitchA-GigabitEthernet0/0/2] quit

3. Configure SwitchB.
# Configure SwitchB to allow packets from VLAN 20 to pass through GE0/0/2.
<HUAWEI> system-view
[HUAWEI] sysname SwitchB
[SwitchB] vlan batch 10 20
[SwitchB] interface gigabitethernet 0/0/2
[SwitchB-GigabitEthernet0/0/2] port link-type hybrid
[SwitchB-GigabitEthernet0/0/2] port hybrid tagged vlan 10 20
[SwitchB-GigabitEthernet0/0/2] quit

# Configure QinQ stacking.


[SwitchB] vlan 10
[SwitchB-vlan10] management-vlan
[SwitchB-vlan10] quit
[SwitchB] interface vlanif 10
[SwitchB-Vlanif10] undo icmp host-unreachable send
[SwitchB-Vlanif10] qinq stacking vlan 20
[SwitchB-Vlanif10] ip address 10.10.10.1 24
[SwitchB-Vlanif10] quit

4. Verify the configuration.


You can log in to SwitchB from SwitchA to manage VLAN services.

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
 undo icmp host-unreachable send
 qinq stacking vlan 20
 #
 interface GigabitEthernet0/0/2
 port link-type hybrid
 port hybrid tagged vlan 10 20
 #
return

9.9 Common Misconfigurations


9.9.1 QinQ Traffic Forwarding Fails Because the Outer VLAN Is Not
Created
Fault Symptom
After selective QinQ is configured on an interface, traffic forwarding fails.

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.
3. <HUAWEI> display vlan summary
4. Static vlan:
5. Total 3 static vlan.
6. 1 9 to 10
7.
8. Dynamic vlan:
9. Total 0 dynamic vlan.
10.
11. 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.

9.9.2 QinQ Traffic Forwarding Fails Because the Interface Does Not
Transparently Transmit the Outer VLAN ID
Fault Symptom
After selective QinQ is configured on an interface, traffic forwarding fails.

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.
3. <HUAWEI> display vlan 3
4. --------------------------------------------------------------------------------
5. U: Up; D: Down; TG: Tagged; UT: Untagged;
6. MP: Vlan-mapping; ST: Vlan-stacking;
7. #: ProtocolTransparent-vlan; *: Management-vlan;
8. --------------------------------------------------------------------------------
9.
10. VID Type Ports
11. --------------------------------------------------------------------------
------
12. 3 common UT:GE0/0/2(U)
13.
14. VID Status Property MAC-LRN Statistics Description
15. --------------------------------------------------------------------------
------
3 enable default enable disable VLAN 0003

 If the system displays the message "Error:The VLAN does not exist.", the outer VLAN is not
created. Run the vlan batchcommand 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.

9.10 FAQ
9.10.1 Does the Switch Support QinQ?
 The S2700EI supports only basic QinQ configured using the port link-type dot1q-tunnel command,
and does not support selective QinQ configured using the port vlan-stacking vlan command.
 The S2700SI does not support basic QinQ or selective QinQ.
 Other models support both basic QinQ and selective QinQ.

9.10.2 What Are Causes for QinQ Traffic Forwarding Failures?


Traffic forwarding on an interface configured with selective QinQ fails in the following situations:
 The outer VLAN specified for selective QinQ is not created.
 The interface is not added to the outer VLAN specified for selective QinQ in untagged mode.

9.10.3 Can I Rapidly Delete All QinQ Configurations of an Interface?


On a switch running V100R006 or a later version, the undo port vlan-stacking all command can be used to
quickly delete all selective QinQ configurations from an interface.

9.10.4 Can I Directly Delete Inner VLAN IDs from QinQ Configuration?
 If the switch is running V100R005 or an earlier version, one or more inner VLAN IDs in QinQ cannot
be directly deleted. You must delete the current selective QinQ configuration, and then reconfigure the
inner VLAN IDs that do not need to be deleted. For example, the port vlan-stacking vlan 10 to 20
stack-vlan 100 command is configured on the switch. To delete inner VLAN 15, perform the
following operations:
1. Run the undo port vlan-stacking vlan 10 to 20 stack-vlan 100 command to delete the current
selective QinQ configuration.
2. Run the port vlan-stacking vlan 10 to 14 stack-vlan 100 and port vlan-stacking vlan 16 to 20
stack-vlan 100 commands to reconfigure the inner VLAN IDs that do not need to be deleted.
 If the switch is running a version later than V100R005, one or more inner VLAN IDs in QinQ can be
directly deleted.

9.10.5 Can the Switch Add Double VLAN Tags to Untagged Packets?
The switch running V200R003 and a later version can add double VLAN tags to untagged packets, but
the S5700EI and S5700SI do not support this function.

9.10.6 Which Tag Does the TPID Configured by the qinq


protocol Command Match?
The TPID configured by the qinq protocol command matches only the outer tag.

9.10.7 Which VLAN Does the Interface Enabled with VLAN Mapping or
QinQ Obtain Through MAC Address Learning?
The VLAN mapping or QinQ implementation is prior to the MAC address learning. Thus, after the VLAN
mapping or QinQ implementation, the interface obtains the outer VLAN ID through MAC address learning.

9.11 References
The following table lists the references for the QinQ feature.

Document Description Remarks

IEEE 802.1Q IEEE standard for local and metropolitan area networks: Virtual -
Bridged Local Area Networks

IEEE 802.1ad IEEE 802.1ad, "Virtual Bridged Local Area Networks: Provider -
Bridges"

You might also like