One-to-two and two-to-two VLAN mapping configuration example

Network requirements

As shown in Figure 71:

Configure one-to-two VLAN mapping and two-to-two VLAN mapping to enable the two branches to communicate across networks SP 1 and SP 2.

Figure 71: Network diagram

Configuration procedure

  1. Configure PE 1:

    # Configure a one-to-two VLAN mapping on the customer-side port Ten-GigabitEthernet 1/0/1 to add SVLAN tag 100 to traffic from VLAN 5.

    <PE1> system-view
    [PE1] interface ten-gigabitethernet 1/0/1
    [PE1-Ten-GigabitEthernet1/0/1] vlan mapping nest single 5 nested-vlan 100
    

    # Configure Ten-GigabitEthernet 1/0/1 as a hybrid port. Assign the port to VLAN 5 and VLAN 100 as a tagged member and an untagged member, respectively.

    [PE1-Ten-GigabitEthernet1/0/1] port link-type hybrid
    [PE1-Ten-GigabitEthernet1/0/1] port hybrid vlan 5 tagged
    [PE1-Ten-GigabitEthernet1/0/1] port hybrid vlan 100 untagged
    [PE1-Ten-GigabitEthernet1/0/1] quit
    

    # Configure the network-side port Ten-GigabitEthernet 1/0/2 as a trunk port, and assign the port to VLAN 100.

    [PE1] interface ten-gigabitethernet 1/0/2
    [PE1-Ten-GigabitEthernet1/0/2] port link-type trunk
    [PE1-Ten-GigabitEthernet1/0/2] port trunk permit vlan 100
    [PE1-Ten-GigabitEthernet1/0/2] quit
    
  2. Configure PE 2:

    # Configure Ten-GigabitEthernet 1/0/1 as a trunk port, and assign the port to VLAN 100.

    <PE2> system-view
    [PE2] interface ten-gigabitethernet 1/0/1
    [PE2-Ten-GigabitEthernet1/0/1] port link-type trunk
    [PE2-Ten-GigabitEthernet1/0/1] port trunk permit vlan 100
    [PE2-Ten-GigabitEthernet1/0/1] quit
    

    # Configure Ten-GigabitEthernet 1/0/2 as a trunk port, and assign the port to VLAN 100.

    [PE2] interface ten-gigabitethernet 1/0/2
    [PE2-Ten-GigabitEthernet1/0/2] port link-type trunk
    [PE2-Ten-GigabitEthernet1/0/2] port trunk permit vlan 100
    [PE2-Ten-GigabitEthernet1/0/2] quit
    
  3. Configure PE 3:

    # Configure Ten-GigabitEthernet 1/0/1 as a trunk port, and assign the port to VLANs 100 and 200.

    <PE3> system-view
    [PE3] interface ten-gigabitethernet 1/0/1
    [PE3-Ten-GigabitEthernet1/0/1] port link-type trunk
    [PE3-Ten-GigabitEthernet1/0/1] port trunk permit vlan 100 200
    

    # Configure a two-to-two VLAN mapping on Ten-GigabitEthernet 1/0/1 to map SVLAN 100 and CVLAN 5 to SVLAN 200 and CVLAN 6.

    [PE3-Ten-GigabitEthernet1/0/1] vlan mapping tunnel 100 5 translated-vlan 200 6
    [PE3-Ten-GigabitEthernet1/0/1] quit
    

    # Configure Ten-GigabitEthernet 1/0/2 as a trunk port, and assign the port to VLAN 200.

    [PE3] interface ten-gigabitethernet 1/0/2
    [PE3-Ten-GigabitEthernet1/0/2] port link-type trunk
    [PE3-Ten-GigabitEthernet1/0/2] port trunk permit vlan 200
    [PE3-Ten-GigabitEthernet1/0/2] quit
    
  4. Configure PE 4:

    # Configure the network-side port Ten-GigabitEthernet 1/0/1 as a trunk port, and assign the port to VLAN 200.

    <PE4> system-view
    [PE4] interface ten-gigabitethernet 1/0/1
    [PE4-Ten-GigabitEthernet1/0/1] port link-type trunk
    [PE4-Ten-GigabitEthernet1/0/1] port trunk permit vlan 200
    [PE4-Ten-GigabitEthernet1/0/1] quit
    

    # Configure the customer-side port Ten-GigabitEthernet 1/0/2 as a hybrid port. Assign the port to VLAN 6 and VLAN 200 as a tagged member and an untagged member, respectively.

    [PE4] interface ten-gigabitethernet 1/0/2
    [PE4-Ten-GigabitEthernet1/0/2] port link-type hybrid
    [PE4-Ten-GigabitEthernet1/0/2] port hybrid vlan 6 tagged
    [PE4-Ten-GigabitEthernet1/0/2] port hybrid vlan 200 untagged
    

    # Configure a one-to-two VLAN mapping on the customer-side port Ten-GigabitEthernet 1/0/2 to add SVLAN tag 200 to traffic from VLAN 6.

    [PE4-Ten-GigabitEthernet1/0/2] vlan mapping nest single 6 nested-vlan 200
    [PE4-Ten-GigabitEthernet1/0/2] quit
    

Verifying the configuration

# Verify VLAN mapping information on PE 1.

[PE1] display vlan mapping
Interface Ten-GigabitEthernet1/0/1:
  Outer VLAN    Inner VLAN    Translated Outer VLAN    Translated Inner VLAN
  5             N/A           100                      5

# Verify VLAN mapping information on PE 3.

[PE3] display vlan mapping
Interface Ten-GigabitEthernet1/0/1:
  Outer VLAN    Inner VLAN    Translated Outer VLAN    Translated Inner VLAN
  100           5             200                      6

# Verify VLAN mapping information on PE 4.

[PE4] display vlan mapping
Interface Ten-GigabitEthernet1/0/2:
  Outer VLAN    Inner VLAN    Translated Outer VLAN    Translated Inner VLAN
  6             N/A           200                      6