Selective QinQ configuration example (configuring an outer VLAN tagging policy by using QoS policy-based method)

Network requirements

As shown in Figure 66:

Configure the edge and third-party devices to allow frames from CVLAN 10 to be transmitted between the branches via SVLAN 100 and frames from CVLAN 20 to be transmitted between the branches via SVLAN 200.

Figure 67: Network diagram

Configuration procedure


[IMPORTANT: ]

IMPORTANT:

Make sure that you have configured the devices in the service provider network to allow QinQ packets to pass through.


  1. Configure PE 1:

    • Configure GigabitEthernet 1/0/1:

      # Configure GigabitEthernet 1/0/1 as a hybrid port to permit frames of VLAN 100 and VLAN 200 to pass through untagged.

      <PE1> system-view
      [PE1] interface gigabitethernet 1/0/1
      [PE1-GigabitEthernet1/0/1] port link-type hybrid
      [PE1-GigabitEthernet1/0/1] port hybrid vlan 100 200 untagged
      [PE1-GigabitEthernet1/0/1] quit
      

      # Create class A10 and configure the class to match frames from Site 1 with CVLAN 10.

      [PE1] traffic classifier A10
      [PE1-classifier-A10] if-match customer-vlan-id 10
      [PE1-classifier-A10] quit
      

      # Create traffic behavior P100 and add the action of inserting outer VLAN tag 100.

      [PE1] traffic behavior P100
      [PE1-behavior-P100] nest top-most vlan-id 100
      [PE1-behavior-P100] quit
      

      # Create class A20 and configure the class to match frames with CVLAN 20. Create traffic behavior P200 and add the action of inserting outer VLAN tag 200.

      [PE1] traffic classifier A20
      [PE1-classifier-A20] if-match customer-vlan-id 20
      [PE1-classifier-A20] quit
      [PE1] traffic behavior P200
      [PE1-behavior-P200] nest top-most vlan-id 200
      [PE1-behavior-P200] quit
      

      # Create a QoS policy named qinq, associate traffic class A10 with traffic behavior P100, and associate traffic class A20 with traffic behavior P200.

      [PE1] qos policy qinq
      [PE1-qospolicy-qinq] classifier A10 behavior P100
      [PE1-qospolicy-qinq] classifier A20 behavior P200
      [PE1-qospolicy-qinq] quit
      

      # Enable basic QinQ on the port.

      [PE1] interface gigabitethernet 1/0/1
      [PE1-GigabitEthernet1/0/1] qinq enable
      

      # Apply QoS policy qinq to the incoming traffic on the port.

      [PE1-GigabitEthernet1/0/1] qos apply policy qinq inbound
      
    • Configure GigabitEthernet 1/0/2:

      # Configure GigabitEthernet 1/0/2 as a trunk port and assign it to VLAN 100 and VLAN 200.

      [PE1] interface gigabitethernet 1/0/2
      [PE1-GigabitEthernet1/0/2] port link-type trunk
      [PE1-GigabitEthernet1/0/2] port trunk permit vlan 100 200
      

      # Set the TPID in the outer VLAN tags to 0x8200.

      [PE1-GigabitEthernet1/0/2] qinq ethernet-type service-tag 8200
      [PE1-GigabitEthernet1/0/2] quit
      
  2. Configure PE 2:

    • Configure GigabitEthernet 1/0/1:

      # Configure GigabitEthernet 1/0/1 as a hybrid port to permit frames of VLAN 100 and VLAN 200 to pass through untagged.

      [PE2] interface gigabitethernet 1/0/1
      [PE2-GigabitEthernet1/0/1] port link-type hybrid
      [PE2-GigabitEthernet1/0/1] port hybrid vlan 100 200 untagged
      [PE2-GigabitEthernet1/0/1] quit
      

      # Create class A10 and configure the class to match frames from Site 2 with CVLAN 10.

      [PE2] traffic classifier A10
      [PE2-classifier-A10] if-match customer-vlan-id 10
      [PE2-classifier-A10] quit
      

      # Create traffic behavior P100 and add the action of inserting outer VLAN tag 100.

      [PE2] traffic behavior P100
      [PE2-behavior-P100] nest top-most vlan-id 100
      [PE2-behavior-P100] quit
      

      # Create class A20 and configure the class to match frames with CVLAN 20. Create traffic behavior P200 and add the action of inserting outer VLAN tag 200.

      [PE2] traffic classifier A20
      [PE2-classifier-A20] if-match customer-vlan-id 20
      [PE2-classifier-A20] quit
      [PE2] traffic behavior P200
      [PE2-behavior-P200] nest top-most vlan-id 200
      [PE2-behavior-P200] quit
      

      # Create a QoS policy named qinq, associate traffic class A10 with traffic behavior P100, and associate traffic class A20 with traffic behavior P200.

      [PE2] qos policy qinq
      [PE2-qospolicy-qinq] classifier A10 behavior P100
      [PE2-qospolicy-qinq] classifier A20 behavior P200
      [PE2-qospolicy-qinq] quit
      

      # Enable basic QinQ on the port.

      [PE2] interface gigabitethernet 1/0/1
      [PE2-GigabitEthernet1/0/1] qinq enable
      

      # Apply QoS policy qinq to the incoming traffic on the port.

      [PE2-GigabitEthernet1/0/1] qos apply policy qinq inbound
      
    • Configure GigabitEthernet 1/0/2:

      # Configure GigabitEthernet 1/0/2 as a trunk port and assign it to VLAN 100 and VLAN 200.

      [PE2] interface gigabitethernet 1/0/2
      [PE2-GigabitEthernet1/0/2] port link-type trunk
      [PE2-GigabitEthernet1/0/2] port trunk permit vlan 100 200
      

      # Set the TPID in the outer VLAN tags to 0x8200.

      [PE2-GigabitEthernet1/0/2] qinq ethernet-type service-tag 8200
      [PE2-GigabitEthernet1/0/2] quit
      
  3. On the third-party devices between PE 1 and PE 2, configure the port that connects to PE 1 and the port that connects to PE 2 to allow tagged frames of VLAN 100 and VLAN 200 to pass through. (Details not shown.)