Hi there,
As we know, selective QinQ, also called VLAN stacking or QinQ stacking, is implemented based on interfaces and VLANs.
We are going to introduce you a case for configuring the selective QinQ in this post. Hope it could help you.
Configure the device to tag VLAN 2 in the outer tag of packets with VLANs 100 to 200 in inner tags, to tag VLAN 3 in the outer tag of packets with VLANs 300 to 400, and to transparently transmit packets from VLAN 1000.
Configure selective QinQ on a fixed switch.
# Create VLAN 2, VLAN 3, and VLAN 1000.
<HUAWEI> system-view [HUAWEI] vlan batch 2 3 1000
# Configure downlink interface GE0/0/1.
[HUAWEI] interface gigabitethernet0/0/1 [HUAWEI-GigabitEthernet0/0/1] port link-type hybrid [HUAWEI-GigabitEthernet0/0/1] qinq vlan-translation enable //VLAN translation must be enabled on the fixed device. [HUAWEI-GigabitEthernet0/0/1] port hybrid untagged vlan 2 3 //The interface joins VLAN 2 and VLAN 3 in untagged mode. [HUAWEI-GigabitEthernet0/0/1] port hybrid tagged vlan 1000 //The interface transparently transmits packets tagged with VLAN 1000. [HUAWEI-GigabitEthernet0/0/1] port vlan-stacking vlan 100 to 200 stack-vlan 2 //The interface adds VLAN 2 in the outer tag of packets with VLANs 100 to 200 in inner tags. [HUAWEI-GigabitEthernet0/0/1] port vlan-stacking vlan 300 to 400 stack-vlan 3 //The interface adds VLAN 3 in the outer tag of packets with VLANs 300 to 400 in inner tags. [HUAWEI-GigabitEthernet0/0/1] port vlan-mapping vlan 1000 map-vlan 1000 //The S5700EI, S3700EI, and S3700SI must be configured to map the VLAN to itself from which single-tagged packets need to be transparently transmitted. [HUAWEI-GigabitEthernet0/0/1] quit
# Configure uplink interface GE0/0/5 to transparently transmit packets from VLAN 2, VLAN 3, and VLAN 1000.
[HUAWEI] interface gigabitethernet0/0/5 [HUAWEI-GigabitEthernet0/0/5] port link-type trunk [HUAWEI-GigabitEthernet0/0/5] port trunk allow-pass vlan 2 3 1000
Configure selective QinQ on a modular switch.
# Create VLAN 2, VLAN 3, and VLAN 1000.
<HUAWEI> system-view [HUAWEI] vlan batch 2 3 1000
# Configure downlink interface GE1/0/1.
[HUAWEI] interface gigabitethernet1/0/1 [HUAWEI-GigabitEthernet1/0/1] port link-type hybrid [HUAWEI-GigabitEthernet1/0/1] port hybrid untagged vlan 2 3 //The interface joins VLAN 2 and VLAN 3 in untagged mode. [HUAWEI-GigabitEthernet1/0/1] port hybrid tagged vlan 1000 //The interface transparently transmits packets tagged with VLAN 1000. [HUAWEI-GigabitEthernet1/0/1] port vlan-stacking vlan 100 to 200 stack-vlan 2 //The interface adds VLAN 2 in the outer tag of packets with VLANs 100 to 200 in inner tags. [HUAWEI-GigabitEthernet1/0/1] port vlan-stacking vlan 300 to 400 stack-vlan 3 //The interface adds VLAN 3 in the outer tag of packets with VLANs 300 to 400 in inner tags. [HUAWEI-GigabitEthernet1/0/1] port vlan-mapping vlan 1000 map-vlan 1000 //The ES0D0G24SA00 and ES0D0G24CA00 cards of the S7700, and EH1D2S24CSA0 and EH1D2G24SSA0 cards of the S9700 must be configured to map the VLAN to itself from which single-tagged packets need to be transparently transmitted. [HUAWEI-GigabitEthernet1/0/1] quit
# Configure uplink interface GE2/0/1 to transparently transmit packets from VLAN 2, VLAN 3, and VLAN 1000.
[HUAWEI] interface gigabitethernet2/0/1 [HUAWEI-GigabitEthernet2/0/1] port link-type trunk [HUAWEI-GigabitEthernet2/0/1] port trunk allow-pass vlan 2 3 1000
That's all for this example.
If you have any questions, kindly let us know.