The port vlan-mapping vlan inner-vlan command enables the interface to replace the outer VLAN tag or both VLAN tags of a double-tagged packet.
The undo port vlan-mapping vlan inner-vlan command disables the interface to replace the outer VLAN tag or both VLAN tags of a double-tagged packet.
By default, the interface does not map tags of packets.
Only the S5720-EI, S5720-HI, S5730-HI, S5730S-EI, S5730-SI, S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6720-EI, S6720-HI, S6720-LI, S6720S-EI, S6720S-LI, S6720S-SI, S6720-SI, S6730-H, S6730S-H, S6730-S, and S6730S-S support this command.
You can run this command for multiple times to map different outer VLAN tags of double-tagged packets to the same VLAN tag only on the S5720-EI, S6720-EI, and S6720S-EI.
port vlan-mapping vlan vlan-id1 inner-vlan vlan-id2 [ to vlan-id3 ] map-vlan vlan-id4 [ remark-8021p 8021p-value ]
port vlan-mapping vlan vlan-id1 inner-vlan vlan-id2 map-vlan vlan-id4 [ map-inner-vlan vlan-id5 ] [ remark-8021p 8021p-value ]
undo port vlan-mapping { all | vlan vlan-id1 inner-vlan vlan-id2 [ to vlan-id3 ] [ map-vlan vlan-id4 ] }
undo port vlan-mapping vlan vlan-id1 inner-vlan vlan-id2 map-vlan vlan-id4 map-inner-vlan vlan-id5
Parameter |
Description |
Setting |
---|---|---|
vlan vlan-id1 |
Specifies the VLAN ID of the outer tag in a received packet. |
The value is an integer that ranges from 1 to 4094. |
inner-vlan vlan-id2 [ to vlan-id3 ] |
Specifies the VLAN ID of the inner tag in a received packet.
|
The value of vlan-id2 or vlan-id3 is an integer that ranges from 1 to 4094. |
map-vlan vlan-id4 |
Specifies the VLAN ID that replaces the VLAN ID of the outer tag in a packet. |
The value is an integer that ranges from 1 to 4094. |
map-inner-vlan vlan-id5 |
Specifies the VLAN ID that replaces the VLAN ID of the inner tag in a packet. If the parameter map-inner-vlan is configured, the interface maps the VLAN ID of the inner tag in the packet to the value of vlan-id5 specified by users. |
The value is an integer that ranges from 1 to 4094. |
remark-8021p 8021p-value |
Specifies the re-marked 802.1p priority of the outer tag. The 802.1p priority is specified by a 3-bit PRI (priority) field in an 802.1Q packet. When congestion occurs on a switch, packets with a higher priority are sent first. If the parameter remark-8021p is configured, the interface changes the 802.1p priority in the packet to the value of 8021p-value specified by users. |
The value is an integer that ranges from 0 to 7. A larger value indicates a higher priority. |
all |
Specifies all VLAN mapping entries configured on the primary interface. |
- |
Ethernet interface view, GE interface view, XGE interface view, 40GE interface view, 100GE interface view, Eth-Trunk interface view, MultiGE interface view, port group view, 25GE interface view
Usage Scenario
When provider edges (PEs) receive double-tagged packets, the inner tag in the packets indicates the user, and the outer tag indicates the service. To differentiate services entering the ISP network, you can configure 2 to 1 VLAN mapping on PEs. To allow users to communicate with each other, the interface maps tags of different services to outer tags, and inner tags are transparently transmitted to the ISP network.
This command allows an interface to map the VLAN ID in a tagged packet to an S-VLAN ID.
Precautions
VLAN mapping can be configured only on a trunk or hybrid interface, and the hybrid interfaces on the devices except the must be added to the translated VLAN in tagged mode.
When inner-vlan is set to a VLAN ID range, the interface cannot replace the VLAN ID of the inner tag in packets.
If VLAN mapping and DHCP are configured on the same interface, the interface must be added to the original VLANs (VLANs before mapping) in tagged mode.
When the VLAN tags of a packet match both a single-tag VLAN mapping entry and a double-tag VLAN mapping entry, the double-tag VLAN mapping takes effect.
# Configure 2 to 1 VLAN mapping, map VLAN 10 in the outer tag of a packet (with VLAN 10 in the outer tag and VLAN 20 in the inner tag) to VLAN 100.
<HUAWEI> system-view [HUAWEI] interface gigabitethernet0/0/1 [HUAWEI-GigabitEthernet0/0/1] port link-type trunk [HUAWEI-GigabitEthernet0/0/1] port trunk allow-pass vlan 100 [HUAWEI-GigabitEthernet0/0/1] qinq vlan-translation enable [HUAWEI-GigabitEthernet0/0/1] port vlan-mapping vlan 10 inner-vlan 20 map-vlan 100