< Home

port vlan-stacking

Function

The port vlan-stacking command configures VLAN stacking.

The undo port vlan-stacking command cancels the configuration.

By default, VLAN stacking is not configured.

Format

port vlan-stacking vlan vlan-id1 [ to vlan-id2 ] stack-vlan vlan-id3 [ remark-8021p 8021p-value1 ]

port vlan-stacking vlan vlan-id1 stack-vlan vlan-id3 [ remark-8021p 8021p-value1 ] map-vlan vlan-id4 [ remark-inner-8021p 8021p-value2 ]

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

undo port vlan-stacking all

Parameters

Parameter

Description

Value

vlan vlan-id1 [ to vlan-id2 ]

Specifies the VLAN ID in a received tagged frame.
  • vlan-id1 specifies the start VLAN ID.
  • to vlan-id2 specifies the end VLAN ID. The value of vlan-id2 must be larger than the value of vlan-id1. vlan-id1 and vlan-id2 identify a VLAN range.

The value of vlan-id1 is an integer that ranges from 1 to 4094.

The value of vlan-id2 is an integer that ranges from 1 to 4094.

stack-vlan vlan-id3

Specifies the outer VLAN ID added to a frame.

The value is an integer that ranges from 1 to 4094.

remark-8021p 8021p-value1

Specifies the re-marked 802.1p priority in the outer tag added to a frame.

The value is an integer that ranges from 0 to 7. A larger value indicates a higher priority.

map-vlan vlan-id4

Specifies the mapped VLAN ID in the stacked inner tag.

The value is an integer that ranges from 1 to 4094.

remark-inner-8021p 8021p-value2

Specifies the re-marked 802.1p priority in the mapped inner tag.

The value is an integer that ranges from 0 to 7. A larger value indicates a higher priority.

all

Deletes all VLAN stacking configurations on the interface.

-

Views

Ethernet interface view, GE interface view, XGE interface view, 40GE interface view, 100GE interface view, MultiGE interface view, Eth-Trunk interface view, port group view, 25GE interface view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

VLAN stacking, also called selective QinQ, is a Layer 2 technology that enables a device to add outer VLAN tags based on VLAN IDs.

When frames are transmitted on the ISP network, the frames are differentiated based on user applications, access sites, or access devices. A device enabled with VLAN stacking adds outer tags to user frames based on the inner tags or priorities in the user frames so that traffic from different users are differentiated. A VLAN stacking interface has the following features:
  • A VLAN stacking port can be configured with multiple outer VLAN tags so that the port can add different outer VLAN tags to different VLAN frames.

  • A VLAN stacking interface can add the outer tag to received frames. After an interface joins the stacked VLAN in untagged mode, the interface removes the outer tag from outgoing frames.

When a network edge device needs to act as a user-side device and the received single-tagged packets are from one type of service, the same service from different users needs to be sent in different VLANs. That is, 1:1 VLAN mapping is implemented. After mapped VLAN tags enter the carrier network, VLAN stacking needs to be enabled on the network edge device to distinguish different users and services, because the number of VLANs that can be provided by the carrier network is limited. In addition, specified tags need to be added to packets of different users and services. Outer tags are the same as those provided by the carrier network and can be transmitted over the carrier network, and inner tags are transparently transmitted over the carrier network, enabling communication between different users. You need to run the port vlan-stackingvlanvlan-id1stack-vlanvlan-id2 [ remark-8021p8021p-value1 ] map-vlanvlan-id4 [ remark-inner-8021p8021p-value2 ] command to enable both VLAN mapping and VLAN stacking functions. remark-8021p8021p-value1 and remark-inner-8021p8021p-value2 specify 802.1p priorities of inner and outer VLAN tags.

If you want to implement both VLAN mapping and VLAN stacking, you cannot enable them separately by running the corresponding commands. This is because the VLAN ID that is mapped based on VLAN mapping cannot be mapped again based on VLAN stacking. For example, if port vlan-stacking vlan 210 stack-vlan 2010 and port vlan-mapping vlan 10 map-vlan 210 are configured on a device, the device maps VLAN 10 to VLAN 210 based on port vlan-mapping vlan 10 map-vlan 210. However, VLAN 210 after mapping will not be mapped to VLAN 2010 based on port vlan-stacking vlan 210 stack-vlan 2010. To implement both VLAN stacking and VLAN mapping, run the port vlan-stacking vlanvlanid1stack-vlanvlanid2map-vlanvlanid3 command.

When remark-8021p 8021p-value is not specified:
  • On the S2720-EI, S5720I-SI, S5720-LI, S5735-L, S5735S-L, S5735S-L-M, S5720S-LI, S5720S-SI, S5720-SI, S5735-S, S5735S-S, S5735-S-I, S5730S-EI, S5730-SI, S6720-LI, S6720S-LI, S6720S-SI, and S6720-SI, the 802.1p priority in the outer VLAN tag is the same as the interface priority. If trust 8021p is configured on the interface, the 802.1p priority in the outer VLAN tag is the same as the 802.1p priority in the inner VLAN tag.
  • On other models, the 802.1p priority in the outer VLAN tag is the same as the 802.1p priority in the inner VLAN tag.

Precautions

When you configure selective QinQ, note the following points:
  • Selective QinQ is recommended to be enabled on a hybrid interface. Selective QinQ can take effect on the interface only in the inbound direction.
  • The outer VLAN must be created before VLAN stacking is performed.
  • When an interface configured with VLAN stacking needs to remove the outer tag from outgoing frames, the interface must join the VLAN specified by stack-vlan in untagged mode. If the outer VLAN does not need to be removed, the interface must join the VLAN specified by stack-vlan in tagged mode.

  • When map-vlan vlan-id4 is configured to perform VLAN stacking and VLAN mapping concurrently, on switches other than the S5720-EI, S5720-HI, S5730-HI, S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6720-EI, S6720-HI, S6720S-EI, S6730-H, S6730S-H, S6730-S, and S6730S-S, the same outer VLAN tag cannot be added to packets from different user VLANs. On the S5720-EI, S5720-HI, S5730-HI, S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6720-EI, S6720-HI, S6720S-EI, S6730-H, S6730S-H, S6730-S, and S6730S-S, the same outer VLAN tag cannot be added to packets from different user VLANs, and different inner VLAN tags in packets from different user VLANs cannot be matched to the same VLAN tag. For example, if packets containing VLAN IDs 10 and 20 respectively are received on an interface, the port vlan-stacking vlan 10 stack-vlan 100 map-vlan 200 and port vlan-stacking vlan 20 stack-vlan 100 map-vlan 200 commands cannot be configured together.

  • On the S5735-L, S5735S-L, S5735S-L-M, S5735-S, S5735-S-I, and S5735S-S, after the port vlan-stacking command is run on an interface, IP packets cannot be forwarded on the interface.

Example

# On GE0/0/1, configure selective QinQ and outer VLAN tag 100 to the tagged frames with the inner VLAN tags 10 to 13.

<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] port link-type hybrid
[HUAWEI-GigabitEthernet0/0/1] qinq vlan-translation enable
[HUAWEI-GigabitEthernet0/0/1] port hybrid untagged vlan 100
[HUAWEI-GigabitEthernet0/0/1] port vlan-stacking vlan 10 to 13 stack-vlan 100
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >