port vlan-stacking

Function

The port vlan-stacking vlan command enables VLAN stacking on an interface and configures the interface to add a VLAN tag to each received single-tagged packet.

The port vlan-stacking ce-default-vlan command enables VLAN stacking on an interface and configures the interface to add a VLAN tag to an untagged packet that it receives.

The undo port vlan-stacking command restores the default configuration.

By default, VLAN stacking is not configured on interfaces.

Format

port vlan-stacking vlan vlan-id1 [ to vlan-id2 ] stack-vlan vlan-id3

port vlan-stacking ce-default-vlan stack-vlan vlan-id3

undo port vlan-stacking vlan vlan-id1 [ to vlan-id2 ] [ stack-vlan vlan-id3 ]

undo port vlan-stacking ce-default-vlan

Parameters

Parameter Description Value
vlan-id1

Indicates the start value of the inner VLAN range.

The value is an integer ranging from 1 to 4094.

vlan-id2

Indicates the end value of the inner VLAN range.

The value is an integer ranging from 1 to 4094.

stack-vlan vlan-id3

Specifies the VLAN ID in the outer tag to be added to a packet.

The value is an integer ranging from 1 to 4094.

ce-default-vlan

Specifies that the interface adds a VLAN tag to an untagged packet that it receives.

-

Views

Layer 2 100GE interface view, Layer 2 10GE interface view, 25GE-L2 view, 400GE-L2 view, Layer 2 40GE interface view, Layer 2 50GE interface view, Layer 2 Eth-Trunk interface view, Layer 2 GE interface view

Default Level

2: Configuration level

Task Name and Operations

Task Name Operations
ethernet write

Usage Guidelines

Usage Scenario

VLAN stacking, also known as selective QinQ, is a Layer 2 technology that adds outer VLAN tags to packets based on their VLAN IDs.

On access networks of carriers, users must be differentiated based on their applications and access locations or devices. After VLAN stacking is configured on an interface, the interface adds different outer VLAN tags to packets based on their VLAN IDs to differentiate users.

A VLAN stacking interface has the following features:

  • The interface can be configured with multiple VLAN IDs and add different outer VLAN tags to frames from different VLANs.
  • After receiving a frame from a VLAN, the interface adds a VLAN tag to the frame; before sending a frame to a VLAN, the interface removes the outer VLAN tag.

Prerequisites

Before you run the port vlan-stacking command:

  • If the interface is a Layer 3 interface, it has been switched to a Layer 2 interface using the portswitch command.
  • You must run the port link-type { hybrid | trunk } command to set the link type of an Ethernet interface to hybrid or trunk.

    By default, the link type of an Ethernet interface is hybrid.

Example

# Enable VLAN stacking on GE 0/1/1 and configure GE 0/1/1 to add the outer VLAN ID 20 to packets carrying VLAN IDs 40 to 50.
<HUAWEI> system-view
[~HUAWEI] vlan batch 40 to 50 20
[*HUAWEI] interface GigabitEthernet 0/1/1
[*HUAWEI-GigabitEthernet0/1/1] portswitch
[*HUAWEI-GigabitEthernet0/1/1] port vlan-stacking vlan 40 to 50 stack-vlan 20
Copyright ? Huawei Technologies Co., Ltd.
Copyright ? Huawei Technologies Co., Ltd.
< Previous topic Next topic >