vlan mapping

Use vlan mapping to configure VLAN mapping on an interface.

Use undo vlan mapping to cancel the VLAN mapping configuration.

Syntax

vlan mapping { vlan-id translated-vlan vlan-id | nest { range vlan-range-list | single vlan-id-list } nested-vlan vlan-id | nni | tunnel outer-vlan-id inner-vlan-id translated-vlan outer-vlan-id inner-vlan-id | uni { range vlan-range-list | single vlan-id-list } translated-vlan vlan-id }

undo vlan mapping { vlan-id translated-vlan vlan-id | all | nest { range vlan-range-list | single vlan-id-list } nested-vlan vlan-id | nni | tunnel outer-vlan-id inner-vlan-id translated-vlan outer-vlan-id inner-vlan-id | uni { range vlan-range-list | single vlan-id-list } translated-vlan vlan-id }

Default

No VLAN mapping is configured on an interface.

Views

Layer 2 Ethernet interface view

Layer 2 aggregate interface view

Predefined user roles

network-admin

Parameters

vlan-id translated-vlan vlan-id: Specifies the original VLAN and translated VLAN for a one-to-one VLAN mapping. The value range for the vlan-id argument is 1 to 4094. The original VLAN and the translated VLAN cannot be the same.

uni range vlan-range-list translated-vlan vlan-id: Specifies the original VLAN ranges and the translated VLAN for a many-to-one VLAN mapping on the customer-side port. The vlan-range-list argument specifies a space-separated list of up to 10 VLAN items. Each item specifies a VLAN ID or a range of VLAN IDs in the form of vlan-id1 to vlan-id2. The value range for VLAN IDs is 1 to 4094. The value for the vlan-id2 argument must be greater than the value for the vlan-id1 argument. The value range for the vlan-id argument is 1 to 4094. Different VLAN ranges cannot overlap. Any of the original VLANs cannot be the same as the translated VLAN.

uni single vlan-id-list translated-vlan vlan-id: Specifies the original VLANs and the translated VLAN for a many-to-one VLAN mapping on the customer-side port. The vlan-id-list argument specifies a space-separated list of up to 10 VLAN IDs, each of which is in the range of 1 to 4094. The value range for the vlan-id argument is 1 to 4094. Any of the original VLANs cannot be the same as the translated VLAN.

nni: Configures the network-side port to use the original VLAN tags of the many-to-one mapping to replace the VLAN tags of the packets destined for the user network.

nest range vlan-range-list nested-vlan vlan-id: Specifies the CVLAN ranges and the SVLAN for a one-to-two VLAN mapping. The vlan-range-list argument specifies a space-separated list of up to 10 CVLAN items. Each item specifies a CVLAN ID or a range of CVLAN IDs in the format of vlan-id1 to vlan-id2. The value range for CVLAN IDs is 1 to 4094. The value for the vlan-id2 argument must be greater than the value for the vlan-id1 argument. Different CVLAN ranges cannot overlap. The vlan-id argument specifies the SVLAN ID in the range of 1 to 4094.

nest single vlan-id-list nested-vlan vlan-id: Specifies the CVLANs and the SVLAN for a one-to-two VLAN mapping. The vlan-id-list argument specifies a space-separated list of up to 10 CVLAN IDs, each of which is in the range of 1 to 4094. The vlan-id argument specifies the SVLAN ID in the range of 1 to 4094.

tunnel outer-vlan-id inner-vlan-id translated-vlan outer-vlan-id inner-vlan-id: Specifies the original outer VLAN ID, original inner VLAN ID, translated outer VLAN ID, and translated inner VLAN ID for a two-to-two VLAN mapping. The value ranges for the outer-vlan-id argument and the inner-vlan-id argument are both 1 to 4094.

all: Deletes all VLAN mapping configurations from the interface.

Usage guidelines

VLAN mapping takes effect only on VLAN-tagged packets received on an interface.

The original and translated VLANs in VLAN mappings on an interface must meet the following requirements:

When you configure many-to-one VLAN mappings, following these restrictions and guidelines:

The configuration restrictions between QinQ and VLAN mappings are as follows:

If you use both transparent VLANs and VLAN mappings on an interface, the transparent VLANs cannot be the following VLANs:

The MTU of an interface is 1500 bytes by default. After a VLAN tag is added to a packet, the packet length is added by 4 bytes. As a best practice, set the MTU to a minimum of 1504 bytes for ports on the forwarding path of the packet on the service provider network.

Examples

# Configure a one-to-one VLAN mapping on to map VLAN 1 to VLAN 101.

<Sysname> system-view
[Sysname] interface 
[Sysname-] vlan mapping 1 translated-vlan 101

# Configure many-to-one VLAN mappings on the customer-side port () to map VLANs 1 through 50 and VLAN 80 to VLAN 101. Configure the network-side port () to use the original VLAN tags of the many-to-one mappings to replace the VLAN tags of the packets destined for the user network.

<Sysname> system-view
[Sysname] interface 
[Sysname-] vlan mapping uni range 1 to 50 translated-vlan 101
[Sysname-] vlan mapping uni single 80 translated-vlan 101
[Sysname-] quit
[Sysname] interface 
[Sysname-] vlan mapping nni

# Configure one-to-two VLAN mappings on to add SVLAN tag 101 to packets carrying VLAN tags 1 through 10 and VLAN tag 80.

<Sysname> system-view
[Sysname] interface 
[Sysname-] vlan mapping nest range 1 to 10 nested-vlan 101
[Sysname-] vlan mapping nest single 80 nested-vlan 101

# Configure a two-to-two VLAN mapping on to map SVLAN 101 and CVLAN 1 to SVLAN 201 and CVLAN 10.

<Sysname> system-view
[Sysname] interface 
[Sysname-] vlan mapping tunnel 101 1 translated-vlan 201 10

Related commands

display vlan mapping