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.
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. |
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:
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:
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.<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