---
title: QinQ Configuration
slug: enterprise-v5p2/im36-qinq-configuration
description: ethernet switching
createdAt: 2025-11-14T03:58:42.084Z
---

### <font color="#1d50a2">show interface vlan-stack</font>

**\[Command]**
**show interface vlan-stack**

**\[Purpose]**
View the VLAN stack function configuration of the interface

**\[View]**
System view

**\[Use Cases]**

```plaintext
sonic# show interface vlan-stack
Name        Vlan  Stack_vlan   Remark_8021p    Remark_tc  Mode
--------- ------ ------------ -------------- ----------- ------
Ethernet1   100      101           NULL          NULL     tagged
Ethernet1   300      101           NULL          NULL     tagged
Ethernet1   400      101           NULL          NULL     tagged
```

### <font color="#1d50a2">show interface qinq protocol</font>

**\[Command]**
**show interface qinq protocol \[** *interface\_name* **]**

**\[Purpose]**
View the qinq protocol configuration of the interface

**\[View]**
System view

**\[Use Cases]**

```plaintext
sonic# show interface qinq protocol 1
Name      Protocol
--------- ----------
Ethernet1  0x88A8
```

### <font color="#1d50a2">qinq protocol</font>

**\[Command]**
**qinq protocol** *value*
**no qinq protocol**

**\[Purpose]**
Configure the TPID

**\[Parameter]**

| **Parameter** | **Description**                                          |
| ------------- | -------------------------------------------------------- |
| *value*       | 4-bit hexadecimal integer form, default value is: 0x8100 |

**\[View]**
Interface view

**\[Usage Scenario]**
Inbound Direction:
In the inbound direction, the "qinq protocol" command is used for identifying VLAN information in received packets. If an interface receives QinQ-tagged packets and you don't want to modify the VLAN information in the packet, the configuration should match the TPID (Tag Protocol Identifier) of the incoming packet. This means the TPID configuration should be consistent with the TPID used in the received packets.
Outbound Direction:
In the outbound direction, the "qinq protocol" command is used to modify the TPID value in outgoing packets.

**\[Use Cases]**

```plaintext
sonic(config)# interface ethernet 1
sonic(config-if-1)# qinq protocol 0x88a8
```

### <font color="#1d50a2">qinq enable</font>

**\[Command]**
**qinq enable**

**\[Purpose]**
Enable basic QinQ functionality on the interface

**\[View]**
Interface view

**\[Usage Scenario]**
When the port enable switch is activated, all traffic entering the device from this port will be tagged with an additional layer corresponding to the Port VLAN ID (PVID). If the packet does not have a VLAN tag, it will be encapsulated with a layer corresponding to the PVID VLAN. If the packet already carries a VLAN tag, an additional layer corresponding to the PVID VLAN will be added.

**\[Use Cases]**

```plaintext
sonic(config)# interface ethernet 1
sonic(config-if-1)# qinq enable
```

### <font color="#1d50a2">vlan-stack \{tagged|untagged\}</font>

**\[Command]**
**vlan-stack \{tagged|untagged}** *vlan\_id stack\_id* **\[remark-dot1p** *dot1p\_value* **] \[remark-tc** *tc\_value* **]**
**no vlan-stack untagged**
**no vlan-stack tagged**

**\[Purpose]**
Configure the VLAN stack function of the interface

**\[Parameter]**

| **Parameter**  | **Description**                                                                                                           |
| -------------- | ------------------------------------------------------------------------------------------------------------------------- |
| **tagged**     | Interface received messages with VLAN tag   need to be overlaid as a two-layer VLAN                                       |
| **untagged**   | Interface receives messages without VLAN   tags that require stacking two layer VLANs                                     |
| *vlan\_id*     | VLAN ID of interface received with VLAN tag packets or inner VLAN ID after QinQ encapsulation of packets without VLAN tag |
| *stack\_id*    | Specify the outer VLAN tag after stacking                                                                                 |
| *dot1p\_value* | Modify the 802.1p priority of the outer   VLAN tag                                                                        |
| *tc\_value*    | Modify the priority of packets for local   processing                                                                     |

**\[View]**
Interface view

**\[Usage Scenario]**
VLAN Stacking is a Layer 2 technology that allows the encapsulation of user packets with an outer VLAN tag based on the user's VLAN ID. This helps differentiate between different users' packets.

**\[Notes]**
To enable VLAN stacking, it should be configured in the inbound direction.
If incoming packets are already VLAN-tagged, ensure that the TPID (Tag Protocol Identifier) used for the outer VLAN tag is different from the TPID configured on the interface.
If user need to remove the outer VLAN tag, the interface should join the stacked VLAN with an untagged mode.
If user don't need to remove the outer VLAN tag, the interface should join the stacked VLAN with a tagged mode.

**\[Use Cases]**

```plaintext
sonic(config)# interface ethernet 1
sonic(config-if-1)# qinq protocol 0x88a8
sonic(config-if-1)# switchport access vlan 101
sonic(config-if-1)# vlan-stack tagged 100 101 remark-dot1p 4 remark-tc 4
```

### <font color="#1d50a2">switchport untagged vlan </font>

**\[Command]**
**switchport untagged vlan** *vlan\_id-vlan\_id*
**no switchport untagged vlan** *vlan\_id-vlan\_id*

**\[Purpose]**
Add the interface to multiple VLANs as untagged

**\[View]**
Interface view, LAG view

**\[Usage Scenario]**
In a QINQ scenario, when multi-layer VLAN services are forwarded outbound through an interface, this configuration command can be used to match services with the specified outer VLAN, strip the outer tag, and then forward them.

**\[Comment]**
VLANs must be configured on the interface in trunk mode before untagged can be configured.

**\[Use Cases]**

```none
sonic# configure terminal
sonic(config)# interface ethernet 1
sonic(config-if-1)# switchport trunk vlan 234
sonic(config-if-1)# switchport untagged vlan 234
```

