Professional Documents
Culture Documents
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
9.2 Principles
9.3 Applications
9.10 FAQ
9.11 References
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.
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.
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.
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
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
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.
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
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.
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
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.
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
Other S1700 Models that cannot be configured using commands. For details about features
models and versions, see S1700 Documentation Bookshelf.
S5710-C-LI V200R001C00
S5730SI V200R011C10
S5730S-EI V200R011C10
NOTE:
To know details about software mappings, see Hardware Query Tool.
Feature Limitations
For the points of attention when configuring QinQ on a sub-interface, see 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
Other S1700 Models that cannot be configured using commands. For details about features
models and versions, see S1700 Documentation Bookshelf.
S5730SI V200R011C10
S5730S-EI V200R011C10
The switch forwards packets based only on their outer VLAN tags and learns MAC address entries
based on the outer VLAN tags.
Selective QinQ is recommended to be enabled on a hybrid interface and the qinq vlan-translation
enable command must have been executed to enable VLAN translation. Selective QinQ can only take
effect on the interface in the inbound direction.
When an interface configured with VLAN stacking needs to remove the outer tag from outgoing frames,
the interface must join the VLAN specified by stack-vlan in untagged mode. If the outer VLAN does
not need to be removed, the interface must join the VLAN specified by stack-vlan in tagged mode.
The device configured with selective QinQ can only add an outer VLAN tag to a frame with an inner
VLAN tag on an interface, and the outer VLAN ID must exist. Otherwise, the services where selective
QinQ is configured are unavailable.
If only single-tagged packets from a VLAN need to be transparently transmitted, do not specify the
VLAN as the inner VLAN for selective QinQ. After selective QinQ is configured on the S3700EI,
S3700SI, or S5700EI, VLAN mapping, for example, port vlan-mapping vlan 20 map-vlan 20, must
be configured to map the VLAN to itself from which single-tagged packets need to be transparently
transmitted.
When VLAN stacking is configured, do not configure stack-vlan to the VLAN corresponding to the
VLANIF interface.
VLAN-based flow mirroring allows the device to identify only outer VLAN tags of QinQ packets.
The globally configured traffic-limit command that takes effect for all interfaces in the inbound
direction is invalid for QinQ packets.
ND snooping and adding double tags to untagged packets can be configured together on the S5720EI,
S5720HI, S6720EI and S6720S-EI.
SAVI and adding double tags to untagged packets can be configured together on the S5720EI, S5720HI,
S6720EI and S6720S-EI.
If the PW-side interface is a Layer 3 interface switched by the undo portswitch command, the AC-side
interface cannot be a Layer 3 interface or subinterface belonging to a Layer 3 interface; otherwise,
traffic forwarding is abnormal. This rule applies to S5720EI, S6720EI, and S6720S-EI.
Background
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 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.
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 outer VLAN ID (stack-vlan) added to the original tagged packet is set.
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.
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
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
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.
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
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.
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.
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
NOTE:
QinQ mapping cannot be used with stacking, QinQ termination, and Dot1q termination commands on the same sub-
interface.
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 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.
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.
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 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
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
# 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
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
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
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
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
2. Configure SwitchB.
# Create VLANs.
<HUAWEI> system-view
[HUAWEI] sysname SwitchB
[SwitchB] vlan batch 101 to 150 1000 to 1103
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
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
- GigabitEthernet0/0/2 GigabitEthernet0/0/2.1 -
- Loopback1 - 3.3.3.3/32
- Loopback1 - 2.2.2.2/32
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure a routing protocol on PE and P devices of the backbone network to implement
interworking, and enable MPLS.
2. Use the default tunnel policy to create an LSP for data transmission.
3. Enable MPLS L2VPN and create VC connections on PEs.
4. Create a sub-interface on the interface of PE1 connected to CE1, configure VLAN mapping of a
single tag on the sub-interface, and create a VC to connect the sub-interface to the VLL network.
5. Configure a Dot1q sub-interface on the interface of PE2 connected to CE2, and create a VC to
connect the sub-interface to the VLL network.
Procedure
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
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
# 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
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
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
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
- Loopback1 - 1.1.1.1/32
- GigabitEthernet0/0/2 GigabitEthernet0/0/2.1 -
- Loopback1 - 3.3.3.3/32
- Loopback1 - 2.2.2.2/32
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure a routing protocol on PE and P devices of the backbone network to implement
interworking, and enable MPLS.
2. Use the default tunnel policy to create an LSP for data transmission.
3. Enable MPLS L2VPN and create VC connections on PEs.
4. Create a sub-interface on the 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
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
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
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
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
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
- Loopback1 - 1.1.1.1/32
- GigabitEthernet0/0/2 GigabitEthernet0/0/2.1 -
- Loopback1 - 3.3.3.3/32
- Loopback1 - 2.2.2.2/32
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure a routing protocol on PE and P devices of the backbone network to implement
interworking, and enable MPLS.
2. Use the default tunnel policy to create an LSP for data transmission.
3. Enable MPLS L2VPN and create VC connections on PEs.
4. On PE1, configure VLAN stacking on the sub-interface connected to Switch1, and create a VC to
connect the sub-interface to a VLL network.
5. On PE2, configure a QinQ sub-interface on the interface connected to Switch2, and create a VC
connect the QinQ sub-interface to a VLL network.
6. On Switch1, add the interface connected to CE1 to a specified VLAN.
7. On Switch2, configure selective QinQ on the interface connected to CE2.
Procedure
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
4. Enable basic MPLS functions and MPLS LDP on the MPLS network.
# Configure PE1.
[PE1] mpls lsr-id 1.1.1.1
[PE1] mpls
[PE1-mpls] quit
[PE1] mpls ldp
[PE1-mpls-ldp] quit
[PE1] interface vlanif 20
[PE1-Vlanif20] mpls
[PE1-Vlanif20] mpls ldp
[PE1-Vlanif20] quit
# Configure P.
[P] mpls lsr-id 2.2.2.2
[P] mpls
[P-mpls] quit
[P] mpls ldp
[P-mpls-ldp] quit
[P] interface vlanif 20
[P-Vlanif20] mpls
[P-Vlanif20] mpls ldp
[P-Vlanif20] quit
[P] interface vlanif 30
[P-Vlanif30] mpls
[P-Vlanif30] mpls ldp
[P-Vlanif30] quit
# Configure PE2.
[PE2] mpls lsr-id 3.3.3.3
[PE2] mpls
[PE2-mpls] quit
[PE2] mpls ldp
[PE2-mpls-ldp] quit
[PE2] interface vlanif 30
[PE2-Vlanif30] mpls
[PE2-Vlanif30] mpls ldp
[PE2-Vlanif30] quit
# Configure 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
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
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
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
- Loopback1 - 1.1.1.1/32
- GigabitEthernet0/0/2 GigabitEthernet0/0/2.1 -
- Loopback1 - 3.3.3.3/32
- Loopback1 - 2.2.2.2/32
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure a routing protocol on the backbone network to implement interworking between devices.
2. Set up a remote LDP session between PEs.
3. Establish tunnels between PEs to transmit service data.
4. Enable MPLS L2VPN on 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
# 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
# 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
# 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
# Configure PE2.
[PE2] mpls l2vpn
[PE2-l2vpn] quit
# Configure PE2.
[PE2] vsi a2 static
[PE2-vsi-a2] pwsignal ldp
[PE2-vsi-a2-ldp] vsi-id 2
[PE2-vsi-a2-ldp] peer 1.1.1.1
[PE2-vsi-a2-ldp] quit
[PE2-vsi-a2] quit
# Configure PE2.
[PE2] vcmp role silent
[PE2] interface gigabitethernet0/0/2
[PE2-GigabitEthernet0/0/2] port link-type hybrid
[PE2-GigabitEthernet0/0/2] quit
[PE2] interface gigabitethernet0/0/2.1
[PE2-GigabitEthernet0/0/2.1] dot1q termination vid 20
[PE2-GigabitEthernet0/0/2.1] l2 binding vsi a2
[PE2-GigabitEthernet0/0/2.1] quit
***VSI Name : a2
Administrator VSI : no
Isolate Spoken : disable
VSI Index : 0
PW Signaling : ldp
Member Discovery Style : static
PW MAC Learn Style : unqualify
Encapsulation Type : vlan
MTU : 1500
Diffserv Mode : uniform
Mpls Exp : --
DomainId : 255
Domain Name :
Ignore AcState : disable
P2P VSI : disable
Create Time : 0 days, 0 hours, 5 minutes, 1 seconds
VSI State : up
VSI ID : 2
*Peer Router ID : 3.3.3.3
Negotiation-vc-id : 2
primary or secondary : primary
ignore-standby-state : no
VC Label : 23552
Peer Type : dynamic
Session : up
Tunnel ID : 0x22
Broadcast Tunnel ID : 0x22
Broad BackupTunnel ID : 0x0
CKey : 2
NKey : 1
Stp Enable : 0
PwIndex : 0
Control Word : disable
**PW Information:
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
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
- Loopback1 - 1.1.1.1/32
- GigabitEthernet0/0/2 GigabitEthernet0/0/2.1 -
- Loopback1 - 3.3.3.3/32
- Loopback1 - 2.2.2.2/32
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
# 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
# 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
# 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
# Configure PE2.
[PE2] mpls l2vpn
[PE2-l2vpn] quit
# Configure PE2.
[PE2] vsi a2 static
[PE2-vsi-a2] pwsignal ldp
[PE2-vsi-a2-ldp] vsi-id 2
[PE2-vsi-a2-ldp] peer 1.1.1.1
[PE2-vsi-a2-ldp] quit
[PE2-vsi-a2] quit
# Configure PE2.
[PE2] vcmp role silent
[PE2] interface gigabitethernet0/0/2
[PE2-GigabitEthernet0/0/2] port link-type hybrid
[PE2-GigabitEthernet0/0/2] quit
[PE2] interface gigabitethernet0/0/2.1
[PE2-GigabitEthernet0/0/2.1] qinq termination pe-vid 200 ce-vid 10
[PE2-GigabitEthernet0/0/2.1] l2 binding vsi a2
[PE2-GigabitEthernet0/0/2.1] quit
***VSI Name : a2
Administrator VSI : no
Isolate Spoken : disable
VSI Index : 0
PW Signaling : ldp
Member Discovery Style : static
PW MAC Learn Style : unqualify
Encapsulation Type : vlan
MTU : 1500
Diffserv Mode : uniform
Mpls Exp : --
DomainId : 255
Domain Name :
Ignore AcState : disable
P2P VSI : disable
Create Time : 0 days, 0 hours, 5 minutes, 1 seconds
VSI State : up
VSI ID : 2
*Peer Router ID : 3.3.3.3
Negotiation-vc-id : 2
primary or secondary : primary
ignore-standby-state : no
VC Label : 23552
Peer Type : dynamic
Session : up
Tunnel ID : 0x22
Broadcast Tunnel ID : 0x22
Broad BackupTunnel ID : 0x0
CKey : 2
NKey : 1
Stp Enable : 0
PwIndex : 0
Control Word : disable
**PW Information:
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
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
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
- Loopback1 - 1.1.1.1/32
- GigabitEthernet0/0/2 GigabitEthernet0/0/2.1 -
- Loopback1 - 3.3.3.3/32
- Loopback1 - 2.2.2.2/32
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure a routing protocol on the backbone network to implement interworking.
2. Add the interface of Switch1 connected to CE1 to a specified VLAN.
3. Configure selective QinQ on the interface of Switch2 connected to CE2.
4. Set up a remote LDP session between PEs.
5. Establish tunnels between PEs to transmit service data.
6. Enable MPLS L2VPN on the PEs.
7. Create a VSI on the PEs and specify LDP as the signaling protocol.
8. Configure a VLAN stacking sub-interface on the interface of PE1 connected to Switch1 and bind the
sub-interface to the VSI to connect it to the VPLS network.
9. Configure a QinQ sub-interface on the interface of PE2 connected to Switch2 and bind the sub-
interface to the VSI to connect the sub-interface to the VPLS network.
Procedure
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
# 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
# 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
# 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
# Configure PE2.
[PE2] mpls l2vpn
[PE2-l2vpn] quit
# Configure PE2.
[PE2] vsi a2 static
[PE2-vsi-a2] pwsignal ldp
[PE2-vsi-a2-ldp] vsi-id 2
[PE2-vsi-a2-ldp] peer 1.1.1.1
[PE2-vsi-a2-ldp] quit
[PE2-vsi-a2] quit
# Configure PE2.
[PE2] vcmp role silent
[PE2] interface gigabitethernet0/0/2
[PE2-GigabitEthernet0/0/2] port link-type hybrid
[PE2-GigabitEthernet0/0/2] quit
[PE2] interface gigabitethernet0/0/2.1
[PE2-GigabitEthernet0/0/2.1] qinq termination pe-vid 100 ce-vid 10
[PE2-GigabitEthernet0/0/2.1] l2 binding vsi a2
[PE2-GigabitEthernet0/0/2.1] quit
***VSI Name : a2
Administrator VSI : no
Isolate Spoken : disable
VSI Index : 0
PW Signaling : ldp
Member Discovery Style : static
PW MAC Learn Style : unqualify
Encapsulation Type : vlan
MTU : 1500
Diffserv Mode : uniform
Mpls Exp : --
DomainId : 255
Domain Name :
Ignore AcState : disable
P2P VSI : disable
Create Time : 0 days, 0 hours, 5 minutes, 1 seconds
VSI State : up
VSI ID : 2
*Peer Router ID : 3.3.3.3
Negotiation-vc-id : 2
primary or secondary : primary
ignore-standby-state : no
VC Label : 23552
Peer Type : dynamic
Session : up
Tunnel ID : 0x22
Broadcast Tunnel ID : 0x22
Broad BackupTunnel ID : 0x0
CKey : 2
NKey : 1
Stp Enable : 0
PwIndex : 0
Control Word : disable
**PW Information:
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
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
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
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
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.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.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.
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"