Skip to content
Ask AI

QinQ Configuration

[Command] show interface vlan-stack

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

[View] System view

[Use Cases]

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

show interface qinq protocol [interface-name]

Section titled “show interface qinq protocol [interface-name]”

[Command] show interface qinq protocol [interface_name]

[Purpose] View the qinq protocol configuration of the interface

[View] System view

[Use Cases]

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

[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]

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

vlan-stack {tagged|untagged} vlan-id stack-id [remark-dot1p value] [remark-tc

Section titled “vlan-stack {tagged|untagged} vlan-id stack-id [remark-dot1p value] [remark-tc”

[Command] vlan-stack {tagged|untagged}vlan-id stack-id[remark-dot1pvalue**] [remark-tcvalue]** no vlan-stack untagged no vlan-stack tagged {all|vlan-id}

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

ParameterDescription
taggedInterface received messages with VLAN tag need to be overlaid as a two-layer VLAN
untaggedInterface receives messages without VLAN tags that require stacking two layer VLANs
vlan-idVLAN ID of interface received with VLAN tag packets or inner VLAN ID after QinQ encapsulation of packets without VLAN tag
stack-idSpecify the outer VLAN tag after stacking
remark-dot1p valueModify the 802.1p priority of the outer VLAN tag
remrak-tc valueModify 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]

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