No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search


To have a better experience, please upgrade your IE browser.


AR100-S, AR110-S, AR120-S, AR150-S, AR160-S, AR200-S, AR1200-S, AR2200-S, and AR3200-S V200R009 CLI-based Configuration Guide - Ethernet Switching

Rate and give feedback:
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
Configuring VLAN ID-based VLAN Mapping

Configuring VLAN ID-based VLAN Mapping

When packets are sent from one LAN to another, if VLAN ID plans are different, their VLAN IDs need to be changed. You can configure VLAN ID-based VLAN mapping on the LAN edge device to map VLAN IDs in received packets. Then the LAN edge device forwards packets based on mapped VLAN IDs.


  • Configure VLAN ID-based VLAN mapping on a sub-interface.
    1. Run system-view

      The system view is displayed.

    2. Run bridge bridge-id

      A bridge group is created and the bridge group view is displayed.

    3. Run quit

      Exit from the bridge group view.

    4. Run interface { ethernet | gigabitethernet } interface-number.subinterface-number

      The Ethernet sub-interface view is displayed.


      Sub-interfaces can only be created on Layer 3 Ethernet interfaces. If an interface works in Layer 2 mode and supports switching between Layer 2 and Layer 3 modes, run the undo portswitch command to switch the interface in Layer 3 mode before creating a sub-interface on the interface.

    5. Run bridge bridge-id

      The Ethernet sub-interface is added to the bridge group.

    6. Run bridge vlan-transmit enable

      The Ethernet sub-interface is enabled to transparently transmit VLAN IDs.

    7. Run vlan allow-pass { vid vlan-id1 [ to vlan-id2 ] | default }

      The VLANs allowed by the Ethernet sub-interface are configured.


      VLANs allowed by all sub-interfaces of a main interface cannot overlap.

      The vlan allow-pass default command can be executed only on a sub-interface among all sub-interfaces of each main interface. Packets are forwarded through the default sub-interface when the packets do not match other QinQ or VLAN mapping entries on a sub-interface.

    8. Run vlan mapping vid vlan-id1 map-vlan vlan-id2

      VLAN ID-based VLAN mapping is configured.


      The sub-interface has been added to a bridge group and the VLANs allowed by the sub-interface has been configured using the vlan allow-pass command.

      The VLANs allowed by the sub-interface include VLANs specified by vlan-id1 in vlan mapping vid vlan-id1 map-vlan vlan-id2.

      When the vlan mapping vid command is executed multiple times, vlan-id2 in the vlan mapping vid command on a sub-interface must be different from vlan-id1 and vlan-id2 in the vlan mapping vid command on other sub-interfaces of the same main interface.

  • Configure VLAN ID-based VLAN mapping on a Layer 2 VE interface.
    1. Run system-view

      The system view is displayed.

    2. Run interface virtual-ethernet ve-number

      A VE interface is created and the VE interface view is displayed.

    3. Run portswitch

      The VE interface is switched from Layer 3 to Layer 2.

      By default, a VE interface works in Layer 3 mode.

    4. Run port link-type { access | hybrid | trunk }

      The link type of the interface is configured as hybrid or trunk.

      By default, the link type of an interface is hybrid.

    5. Run vlan mapping vid vid-value1 map-vlan vid-value2 [ remark-8021p 8021p-val ]

      VLAN ID-based VLAN mapping is configured on the Layer 2 VE interface.

      • The VLAN ID in the tag of the received frame on an interface must be different from the mapped VLAN ID.
      • The mapped outer VLAN must exist and the interface must join the original and mapped VLANs in tagged mode.
      • VLAN stacking and VLAN mapping can take effect, but VLAN IDs of multiple CEs must be unique, VLAN IDs in the original and mapped tags must be different, and VLAN IDs of multiple PEs must be unique.
      • Layer 2 Ethernet interfaces support only VLAN ID-based VLAN mapping, and do not support VLAN mapping based on 802.1p priorities or VLAN IDs and 802.1p priorities.
      • This command can be configured on an interface multiple times, and a maximum of 128 VLAN mapping entries can be configured on all interfaces.

Updated: 2019-05-17

Document ID: EDOC1000174108

Views: 56301

Downloads: 42

Average rating:
This Document Applies to these Products
Related Documents
Related Version
Previous Next