< Home

Example for Configuring VLAN ID-based 2 to 2 VLAN Mapping

Networking Requirements

QinQ is used to send double-tagged packets, which prevents the conflict between C-VLAN IDs and S-VLAN IDs and differentiates services and users. However, the interface will discard the packets because C-VLAN IDs are different from S-VLAN IDs. To ensure communication continuity, configure 2:2 VLAN mapping on the PE and replace double C-VLAN tags with double S-VLAN tags.

In Figure 1, users send double-tagged packets to the ISP network. These packets cannot be sent successfully because the VLAN IDs are different from the S-VLAN IDs. To solve this problem, ensure that the users of the Switch5 and Switch6 can communicate.

Figure 1 Networking diagram for configuring 2:2 VLAN mapping

Configuration Roadmap

The configuration roadmap is as follows:

  1. Add switch ports connecting to users to VLAN 10 and VLAN 30.

  2. Configure the QinQ function on Switch1 and Switch4 so that packets sent to the ISP network are double-tagged.

  3. Configure 2:2 VLAN mapping on switches connected to the ISP network.

Procedure

  1. Add downlink interfaces on switches to specified VLANs.

    # Configure Switch5.

    <HUAWEI> system-view
    [HUAWEI] sysname Switch5
    [Switch5] vlan 10
    [Switch5-vlan10] quit
    [Switch5] interface gigabitethernet 0/0/1
    [Switch5-GigabitEthernet0/0/1] port link-type access
    [Switch5-GigabitEthernet0/0/1] port default vlan 10
    [Switch5-GigabitEthernet0/0/1] quit
    [Switch5] interface gigabitethernet 0/0/2
    [Switch5-GigabitEthernet0/0/2] port link-type trunk
    [Switch5-GigabitEthernet0/0/2] port trunk allow-pass vlan 10

    # Configure Switch6.

    <HUAWEI> system-view
    [HUAWEI] sysname Switch6
    [Switch6] vlan 30
    [Switch6-vlan30] quit
    [Switch6] interface gigabitethernet 0/0/1
    [Switch6-GigabitEthernet0/0/1] port link-type access
    [Switch6-GigabitEthernet0/0/1] port default vlan 30
    [Switch6-GigabitEthernet0/0/1] quit
    [Switch6] interface gigabitethernet 0/0/2
    [Switch6-GigabitEthernet0/0/2] port link-type trunk
    [Switch6-GigabitEthernet0/0/2] port trunk allow-pass vlan 30

  2. Configure the QinQ function on Switch1 and Switch4 so that packets sent to the ISP network are double-tagged.

    # Configure Switch 1.

    <HUAWEI> system-view
    [HUAWEI] sysname Switch1
    [Switch1] vlan 20
    [Switch1-vlan20] quit
    [Switch1] interface gigabitethernet 0/0/1
    [Switch1-GigabitEthernet0/0/1] port link-type hybrid
    [Switch1-GigabitEthernet0/0/1] port hybrid untagged vlan 20
    [Switch1-GigabitEthernet0/0/1] qinq vlan-translation enable
    [Switch1-GigabitEthernet0/0/1] port vlan-stacking vlan 10 stack-vlan 20
    [Switch1-GigabitEthernet0/0/1] quit
    [Switch1] interface gigabitethernet 0/0/2
    [Switch1-GigabitEthernet0/0/2] port link-type trunk
    [Switch1-GigabitEthernet0/0/2] port trunk allow-pass vlan 20
    [Switch1-GigabitEthernet0/0/2] quit

    # Configure Switch 4.

    <HUAWEI> system-view
    [HUAWEI] sysname Switch4
    [Switch4] vlan 40
    [Switch4-vlan40] quit
    [Switch4] interface gigabitethernet 0/0/1
    [Switch4-GigabitEthernet0/0/1] port link-type hybrid
    [Switch4-GigabitEthernet0/0/1] port hybrid untagged vlan 40
    [Switch4-GigabitEthernet0/0/1] qinq vlan-translation enable
    [Switch4-GigabitEthernet0/0/1] port vlan-stacking vlan 30 stack-vlan 40
    [Switch4-GigabitEthernet0/0/1] quit
    [Switch4] interface gigabitethernet 0/0/2
    [Switch4-GigabitEthernet0/0/2] port link-type trunk
    [Switch4-GigabitEthernet0/0/2] port trunk allow-pass vlan 40
    [Switch4-GigabitEthernet0/0/2] quit

  3. Configure 2:2 VLAN mapping on the switch connecting to the ISP network.

    # Configure Switch2.

    <HUAWEI> system-view
    [HUAWEI] sysname Switch2
    [Switch2] interface gigabitethernet 0/0/1
    [Switch2-GigabitEthernet0/0/1] port link-type hybrid
    [Switch2-GigabitEthernet0/0/1] port hybrid tagged vlan 50
    [Switch2-GigabitEthernet0/0/1] qinq vlan-translation enable
    [Switch2-GigabitEthernet0/0/1] port vlan-mapping vlan 20 inner-vlan 10 map-vlan 50 map-inner-vlan 60

    # Configure Switch3.

    <HUAWEI> system-view
    [HUAWEI] sysname Switch3
    [Switch3] interface gigabitethernet 0/0/1
    [Switch3-GigabitEthernet0/0/1] port link-type hybrid
    [Switch3-GigabitEthernet0/0/1] port hybrid tagged vlan 50
    [Switch3-GigabitEthernet0/0/1] qinq vlan-translation enable
    [Switch3-GigabitEthernet0/0/1] port vlan-mapping vlan 40 inner-vlan 30 map-vlan 50 map-inner-vlan 60

  4. Verify the configurations.

    Verify that users connected to Switch5 and users connected to Switch6 can communicate with each other.

Configuration Files

  • Switch1 configuration file

    #
    sysname Switch1
    #
    vlan batch 20
    #
    interface GigabitEthernet0/0/1
     port link-type hybrid
     qinq vlan-translation enable
     port hybrid untagged vlan 20
     port vlan-stacking vlan 10 stack-vlan 20
    #
    interface GigabitEthernet0/0/2
     port link-type trunk
     port trunk allow-pass vlan 20
    #
    return
  • Switch2 configuration file

    #
    sysname Switch2
    #
    interface GigabitEthernet0/0/1
     port link-type hybrid
     qinq vlan-translation enable
     port hybrid tagged vlan 50
     port vlan-mapping vlan 20 inner-vlan 10 map-vlan 50 map-inner-vlan 60
    #
    return
  • Switch3 configuration file

    #
    sysname Switch3
    #
    interface GigabitEthernet0/0/1
     port link-type hybrid
     qinq vlan-translation enable
     port hybrid tagged vlan 50
     port vlan-mapping vlan 40 inner-vlan 30 map-vlan 50 map-inner-vlan 60
    #
    return
  • Switch4 configuration file

    #
    sysname Switch4
    #
    vlan batch 40
    #
    interface GigabitEthernet0/0/1
     port link-type hybrid
     qinq vlan-translation enable
     port hybrid untagged vlan 40
     port vlan-stacking vlan 30 stack-vlan 40
    #
    interface GigabitEthernet0/0/2
     port link-type trunk
     port trunk allow-pass vlan 40
    #
    return
  • Switch5 configuration file

    #
    sysname Switch5
    #
    vlan batch 10
    #
    interface GigabitEthernet0/0/1
     port link-type access
     port default vlan 10
    #
    interface GigabitEthernet0/0/2
     port link-type trunk
     port trunk allow-pass vlan 10
    #
    return
  • Switch6 configuration file

    #
    sysname Switch6
    #
    vlan batch 30
    #
    interface GigabitEthernet0/0/1
     port link-type access
     port default vlan 30
    #
    interface GigabitEthernet0/0/2
     port link-type trunk
     port trunk allow-pass vlan 30
    #
    return
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic