Basic QinQ configuration example
Network requirements
As shown in Figure 70:
The service provider assigns VLAN 100 to Company A's VLANs 10 through 70.
The service provider assigns VLAN 200 to Company B's VLANs 30 through 90.
The devices between PE 1 and PE 2 in the service provider network use a TPID value of 0x8200.
Configure QinQ on PE 1 and PE 2 to transmit traffic in VLANs 100 and 200 for Company A and Company B, respectively.
For the QinQ frames to be identified correctly, set the SVLAN TPID to 0x8200 on the service provider-side ports of PE 1 and PE 2.
Figure 70: Network diagram
Configuration procedure
Configure PE 1:
# Configure HundredGigE 1/0/1 as a trunk port, and assign it to VLAN 100.
<PE1> system-view [PE1] interface hundredgige 1/0/1 [PE1-HundredGigE1/0/1] port link-type trunk [PE1-HundredGigE1/0/1] port trunk permit vlan 100
# Set the PVID of HundredGigE 1/0/1 to VLAN 100.
[PE1-HundredGigE1/0/1] port trunk pvid vlan 100
# Enable QinQ on HundredGigE 1/0/1.
[PE1-HundredGigE1/0/1] qinq enable [PE1-HundredGigE1/0/1] quit
# Configure HundredGigE 1/0/2 as a trunk port, and assign it to VLANs 100 and 200.
[PE1] interface hundredgige 1/0/2 [PE1-HundredGigE1/0/2] port link-type trunk [PE1-HundredGigE1/0/2] port trunk permit vlan 100 200
# Set the TPID value in the SVLAN tags to 0x8200 on HundredGigE 1/0/2.
[PE1-HundredGigE1/0/2] qinq ethernet-type service-tag 8200 [PE1-HundredGigE1/0/2] quit
# Configure HundredGigE 1/0/3 as a trunk port, and assign it to VLAN 200.
[PE1] interface hundredgige 1/0/3 [PE1-HundredGigE1/0/3] port link-type trunk [PE1-HundredGigE1/0/3] port trunk permit vlan 200
# Set the PVID of HundredGigE 1/0/3 to VLAN 200.
[PE1-HundredGigE1/0/3] port trunk pvid vlan 200
# Enable QinQ on HundredGigE 1/0/3.
[PE1-HundredGigE1/0/3] qinq enable [PE1-HundredGigE1/0/3] quit
Configure PE 2:
# Configure HundredGigE 1/0/1 as a trunk port, and assign it to VLAN 200.
<PE2> system-view [PE2] interface hundredgige 1/0/1 [PE2-HundredGigE1/0/1] port link-type trunk [PE2-HundredGigE1/0/1] port trunk permit vlan 200
# Set the PVID of HundredGigE 1/0/1 to VLAN 200.
[PE2-HundredGigE1/0/1] port trunk pvid vlan 200
# Enable QinQ on HundredGigE 1/0/1.
[PE2-HundredGigE1/0/1] qinq enable [PE2-HundredGigE1/0/1] quit
# Configure HundredGigE 1/0/2 as a trunk port, and assign it to VLANs 100 and 200.
[PE2] interface hundredgige 1/0/2 [PE2-HundredGigE1/0/2] port link-type trunk [PE2-HundredGigE1/0/2] port trunk permit vlan 100 200
# Set the TPID value in the SVLAN tags to 0x8200 on HundredGigE 1/0/2.
[PE2-HundredGigE1/0/2] qinq ethernet-type service-tag 8200 [PE2-HundredGigE1/0/2] quit
# Configure HundredGigE 1/0/3 as a trunk port, and assign it to VLAN 100.
[PE2] interface hundredgige 1/0/3 [PE2-HundredGigE1/0/3] port link-type trunk [PE2-HundredGigE1/0/3] port trunk permit vlan 100
# Set the PVID of HundredGigE 1/0/3 to VLAN 100.
[PE2-HundredGigE1/0/3] port trunk pvid vlan 100
# Enable QinQ on HundredGigE 1/0/3.
[PE2-HundredGigE1/0/3] qinq enable [PE2-HundredGigE1/0/3] quit
Configure the devices between PE 1 and PE 2:
# Set the MTU to a minimum of 1504 bytes for each port on the path of QinQ frames. (Details not shown.)
# Configure all ports on the forwarding path to allow frames from VLANs 100 and 200 to pass through without removing the VLAN tag. (Details not shown.)