< Home

Example for Configuring VLAN ID-based 1:1 VLAN Mapping

Networking Requirements

This example configures the 1:1 mode for 1 to 1 VLAN mapping.

Users in different communities use the same services, such as the web, IPTV, and VoIP services. To facilitate management, the network administrator of each community adds different services to different VLANs. For communities in different VLANs to use the same services, communication between VLANs must be implemented.

In Figure 1, community 1 and community 2 have the same services, but belong to different VLANs. Communication between them needs to be implemented with low costs.

Figure 1 Networking diagram for configuring 1:1 VLAN mapping

Configuration Roadmap

The configuration roadmap is as follows:

  1. Add the switch port connecting to community 1 to VLAN6 and add the switch port connecting to community 2 to VLAN5.

  2. Configure VLAN mapping on GE0/0/1 of PE1 and PE2 and map C-VLAN IDs to S-VLAN IDs so that users in different VLANs can communicate with each other.

Procedure

  1. Add downlink interfaces on switches to specified VLANs.

    # Configure CE1.

    <HUAWEI> system-view
    [HUAWEI] sysname CE1
    [CE1] vlan 6
    [CE1-vlan6] quit
    [CE1] interface gigabitethernet 0/0/1
    [CE1-GigabitEthernet0/0/1] port link-type access
    [CE1-GigabitEthernet0/0/1] port default vlan 6
    [CE1-GigabitEthernet0/0/1] quit
    [CE1] interface gigabitethernet 0/0/2
    [CE1-GigabitEthernet0/0/2] port link-type access
    [CE1-GigabitEthernet0/0/2] port default vlan 6
    [CE1-GigabitEthernet0/0/2] quit
    [CE1] interface gigabitethernet 0/0/3
    [CE1-GigabitEthernet0/0/3] port link-type trunk
    [CE1-GigabitEthernet0/0/3] port trunk allow-pass vlan 6
    [CE1-GigabitEthernet0/0/3] quit

    # Configure CE2.

    <HUAWEI> system-view
    [HUAWEI] sysname CE2
    [CE2] vlan 5
    [CE2-vlan5] quit
    [CE2] interface gigabitethernet 0/0/1
    [CE2-GigabitEthernet0/0/1] port link-type access
    [CE2-GigabitEthernet0/0/1] port default vlan 5
    [CE2-GigabitEthernet0/0/1] quit
    [CE2] interface gigabitethernet 0/0/2
    [CE2-GigabitEthernet0/0/2] port link-type access
    [CE2-GigabitEthernet0/0/2] port default vlan 5
    [CE2-GigabitEthernet0/0/2] quit
    [CE2] interface gigabitethernet 0/0/3
    [CE2-GigabitEthernet0/0/3] port link-type trunk
    [CE2-GigabitEthernet0/0/3] port trunk allow-pass vlan 5
    [CE2-GigabitEthernet0/0/3] quit

  2. Configure VLAN mapping on the GE0/0/1 of PE1 and PE2.

    # Configure PE1.

    <HUAWEI> system-view
    [HUAWEI] sysname PE1
    [PE1] vlan 10
    [PE1-vlan10] quit
    [PE1] interface gigabitethernet 0/0/1
    [PE1-GigabitEthernet0/0/1] port link-type trunk
    [PE1-GigabitEthernet0/0/1] port trunk allow-pass vlan 10
    [PE1-GigabitEthernet0/0/1] qinq vlan-translation enable
    [PE1-GigabitEthernet0/0/1] port vlan-mapping vlan 6 map-vlan 10
    [PE1-GigabitEthernet0/0/1] quit

    # Configure PE2.

    <HUAWEI> system-view
    [HUAWEI] sysname PE2
    [PE2] vlan 10
    [PE2-vlan10] quit
    [PE2] interface gigabitethernet 0/0/1
    [PE2-GigabitEthernet0/0/1] port link-type trunk
    [PE2-GigabitEthernet0/0/1] port trunk allow-pass vlan 10
    [PE2-GigabitEthernet0/0/1] qinq vlan-translation enable
    [PE2-GigabitEthernet0/0/1] port vlan-mapping vlan 5 map-vlan 10
    [PE2-GigabitEthernet0/0/1] quit

  3. Verify the configurations.

    Verify that users in community 1 and community 2 can communicate with each other.

Configuration Files

  • CE1 configuration file

    #
    sysname CE1
    #
    vlan batch 6
    #
    interface GigabitEthernet0/0/1
     port link-type access
     port default vlan 6
    #
    interface GigabitEthernet0/0/2
     port link-type access
     port default vlan 6
    #
    interface GigabitEthernet0/0/3
     port link-type trunk
     port trunk allow-pass vlan 6
    #
    return
  • CE2 configuration file

    #
    sysname CE2
    #
    vlan batch 5
    #
    interface GigabitEthernet0/0/1
     port link-type access
     port default vlan 5
    #
    interface GigabitEthernet0/0/2
     port link-type access
     port default vlan 5
    #
    interface GigabitEthernet0/0/3
     port link-type trunk
     port trunk allow-pass vlan 5
    #
    return
  • PE1 configuration file

    #
    sysname PE1
    #
    vlan batch 10
    #
    interface GigabitEthernet0/0/1
     port link-type trunk
     qinq vlan-translation enable
     port trunk allow-pass vlan 10
     port vlan-mapping vlan 6 map-vlan 10
    #
    return
  • PE2 configuration file

    #
    sysname PE2
    #
    vlan batch 10
    #
    interface GigabitEthernet0/0/1
     port link-type trunk
     qinq vlan-translation enable
     port trunk allow-pass vlan 10
     port vlan-mapping vlan 5 map-vlan 10
    #
    return
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
Next topic >