port vlan-mapping

Function

The port vlan-mapping command configures an interface to map a single VLAN tag to a specified tag.

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

By default, VLAN mapping is disabled on interfaces.

Format

port vlan-mapping vlan vlan-id1 [ to vlan-id2 ] map-vlan vlan-id3

undo port vlan-mapping { vlan vlan-id1 [ to vlan-id2 ] [ map-vlan vlan-id3 ] }

Parameters

Parameter Description Value
vlan-id2

Specifies a VLAN range carried in received frames.

highVid specifies the end value of the VLAN ID range of the tag carried in the received packet.

The value is an integer ranging from 1 to 4094.

map-vlan vlan-id3

Specifies the VLAN ID to be mapped to.

If double-tagged packets are received, this parameter specifies the outer VLAN ID to be mapped to.

The value is an integer ranging from 1 to 4094.

vlan vlan-id1

Specifies a VLAN range carried in received frames.

lowVid specifies the start VLAN ID in the VLAN tag carried in the received packet.

The value is an integer ranging from 1 to 4094.

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

A network needs to be expanded with the growth of access users and data services, which poses the following challenges to the administrator:

  • Existing and new sites assigned different VLAN IDs need to communicate.
  • Inconsistent VLAN plans among sites access the public network causes VLAN ID conflicts. Therefore, VLANs at a site need to be isolated with those at another site.
  • Sites that access to the public network have asymmetrical VLAN planning.

    To prevent these problems, you can run the port vlan-mapping command to configure VLAN mapping on edge devices of the public network to map the user VLAN tag to the public VLAN tag to implement inter-VLAN communication.

Prerequisites

A Layer 3 interface has been switched to a Layer 2 interface using the portswitch command.

Configuration Impact

VLAN mapping is implemented after packets are received on an inbound interface and before packets are sent out from an outbound interface. After VLAN mapping is enabled:

  • Service VLAN IDs and user VLAN IDs change.
  • Private network VLAN IDs and public VLAN IDs change.

    VLAN mapping implements the communication between VLANs without any Layer 3 route. VLAN mapping is also called VLAN translation. The port vlan-mapping command maps a single tag carried in frames to a specified tag, which is called VLAN mapping 1 to 1 function.

Precautions

When VLAN mapping is used to implement inter-VLAN communication, the IP addresses of the devices in the two VLANs must be on the same network segment. If the IP addresses of the devices in the two VLANs are on different network segments, the devices need to communicate with each other through Layer 3 routes. In this case, VLAN mapping does not take effect.

The configuration of port vlan-mapping on a main interface is similar to the configuration of qinq mapping vid map-vlan vid on a sub-interface. The difference is that VLAN mapping is configured on a main interface to implement communication between users in different VLANs on a Layer 2 metro network. QinQ mapping on a sub-interface is mainly used to access the L2VPN. QinQ mapping saves a large number of physical ports.

If the command is run more than once, all configurations take effect.

Example

# Configure 1 to 1 VLAN mapping to map VLAN 100 of received packets to VLAN 10 before the packets are forwarded.
<HUAWEI> system-view
[~HUAWEI] vlan 100
[*HUAWEI-vlan100] quit
[*HUAWEI] vlan 10
[*HUAWEI-vlan10] quit
[*HUAWEI] interface GigabitEthernet 0/1/1
[*HUAWEI-GigabitEthernet0/1/1] portswitch
[*HUAWEI-GigabitEthernet0/1/1] port vlan-mapping vlan 100 map-vlan 10
Copyright ? Huawei Technologies Co., Ltd.
Copyright ? Huawei Technologies Co., Ltd.
< Previous topic Next topic >