04-Layer 2—LAN Switching Configuration Guide

HomeSupportRoutersMSR5600 Series(Comware V7)Configure & DeployConfiguration GuidesH3C MSR 5600 Routers Configuration Guides(V7)-R6749-6W10004-Layer 2—LAN Switching Configuration Guide
06-VLAN mapping configuration
Title Size Download
06-VLAN mapping configuration 197.45 KB

Configuring VLAN mapping

About VLAN mapping

VLAN mapping re-marks VLAN traffic with new VLAN IDs.

VLAN mapping types

H3C provides the following types of VLAN mapping:

·     One-to-two VLAN mapping—Tags single-tagged packets with an outer VLAN tag.

·     Zero-to-two VLAN mapping—Adds double VLAN tags to untagged packets.

·     Two-to-two VLAN mapping—Replaces the outer and inner VLAN IDs of double tagged traffic with a new pair of VLAN IDs.

VLAN mapping application scenarios

One-to-two and two-to-two VLAN mapping

One-to-two and two-to-two VLAN mapping are typically used to implement communication across different SP networks, as shown in Figure 1.

Figure 1 Application scenario of one-to-two and two-to-two VLAN mapping

As shown in Figure 1, Site 1 and Site 2 of VPN A are in VLAN 2 and VLAN 3, respectively. The SP 1 network assigns SVLAN 10 to Site 1. The SP 2 network assigns SVLAN 20 to Site 2. When the packet from Site 1 arrives at PE 1, PE 1 tags the packet with SVLAN 10 by using one-to-two VLAN mapping.

When the double-tagged packet from the SP 1 network arrives at the SP 2 network interface, PE 3 processes the packet as follows:

·     Replaces SVLAN tag 10 with SVLAN tag 20.

·     Replaces CVLAN tag 2 with CVLAN tag 3.

One-to-two VLAN mapping provides the following benefits:

·     Enables a customer network to plan its CVLAN assignment without conflicting with SVLANs.

·     Adds a VLAN tag to a tagged packet and expands the number of available VLANs to 4094 × 4094.

·     Reduces the stress on the SVLAN resources, which were 4094 VLANs in the SP network before the mapping process was initiated.

Zero-to-two VLAN mapping

The application scenario of zero-to-two VLAN mapping is similar to the scenario of one-to-two VLAN mapping. Zero-to-two VLAN mapping is used on the customer-side port of a PE to add double tags to untagged packets.

VLAN mapping implementations

Figure 2 shows a simplified network that illustrates basic VLAN mapping terms.

Basic VLAN mapping terms include the following:

·     Uplink traffic—Traffic transmitted from the customer network to the service provider network.

·     Downlink traffic—Traffic transmitted from the service provider network to the customer network.

·     Network-side port—A port connected to or closer to the service provider network.

·     Customer-side port—A port connected to or closer to the customer network.

Figure 2 Basic VLAN mapping terms

One-to-two VLAN mapping

As shown in Figure 3, one-to-two VLAN mapping is implemented on the customer-side port to add the SVLAN tag for the uplink traffic.

For the downlink traffic to be correctly sent to the customer network, make sure the SVLAN tag is removed on the customer-side port before transmission. Use one of the following methods to remove the SVLAN tag from the downlink traffic:

·     Configure the customer-side port as a hybrid port and assign the port to the SVLAN as an untagged member.

·     Configure the customer-side port as a trunk port and set the port PVID to the SVLAN.

Figure 3 One-to-two VLAN mapping implementation

Zero-to-two VLAN mapping

As shown in Figure 4, zero-to-two VLAN mapping is implemented on the customer-side port to add double tags to untagged uplink traffic. For zero-to-two VLAN mapping to take effect, the port PVID must be VLAN 1.

For correct downlink traffic transmission, the downlink traffic must be untagged or tagged with VLAN 1 when it is sent out of the customer-side port.

To tag the downlink traffic with VLAN 1:

1.     Configure the network-side port to allow the traffic from the SVLAN to pass through.

2.     If the CVLAN of the traffic is not VLAN 1, configure a two-to-two VLAN mapping on the network-side port to replace the CVLAN ID with VLAN 1.

3.     Assign the customer-side port to the SVLAN as an untagged member.

Figure 4 Zero-to-two VLAN mapping implementation

Two-to-two VLAN mapping

As shown in Figure 5, two-to-two VLAN mapping is implemented on the customer-side port and replaces VLAN tags as follows:

·     Replaces the CVLAN and the SVLAN with the CVLAN' and the SVLAN' for the uplink traffic.

·     Replaces the SVLAN' and CVLAN' with the SVLAN and the CVLAN for the downlink traffic.

Figure 5 Two-to-two VLAN mapping implementation

Restrictions and guidelines: VLAN mapping configuration

On a VEB interface, you can configure VLAN mapping for EoGRE. For more information about EoGRE, see GRE configuration in Layer 3—IP Services Configuration Guide.

To add VLAN tags to packets, you can configure both VLAN mapping and QinQ. VLAN mapping takes effect if a configuration conflict occurs. For more information about QinQ, see "Configuring QinQ."

VLAN mapping tasks at a glance

Use the appropriate VLAN mapping methods for the devices in the network.

To configure VLAN mapping, perform the following tasks:

·     Configuring one-to-two VLAN mapping

Configure one-to-two VLAN mapping on PE 1 and PE 4, as shown in Figure 1, through which traffic from customer networks enters the service provider networks.

·     Configuring zero-to-two VLAN mapping

Configure zero-to-two VLAN mapping on PE 1 and PE 4, as shown in Figure 1, through which traffic from customer networks enters the service provider networks.

·     Configuring two-to-two VLAN mapping

Configure two-to-two VLAN mapping on PE 3, as shown in Figure 1, which is an edge device of the SP 2 network.

Prerequisites

Before you configure VLAN mapping, create original and translated VLANs.

Configuring one-to-two VLAN mapping

About this task

Configure one-to-two VLAN mapping on the customer-side ports of edge devices from which customer traffic enters SP networks, for example, on PEs 1 and 4 in Figure 1. One-to-two VLAN mapping enables the edge devices to add an SVLAN tag to each incoming packet.

Restrictions and guidelines

Only one SVLAN tag can be added to packets from the same CVLAN. To add different SVLAN tags to different CVLAN packets on a port, set the port link type to hybrid and configure multiple one-to-two VLAN mappings.

The MTU of an interface is 1500 bytes by default. After a VLAN tag is added to a packet, the packet length is added by 4 bytes. As a best practice, set the MTU to a minimum of 1504 bytes for ports on the forwarding path of the packet in the service provider network.

Procedure

1.     Enter system view.

system-view

2.     Enter VEB interface view.

interface ve-bridge interface-number

3.     Set the link type of the port.

port link-type { hybrid | trunk }

By default, the link type of a port is access.

4.     Assign the port to the CVLANs.

¡     Assign the trunk port to the CVLANs.

port trunk permit vlan vlan-id-list

By default, a trunk port is assigned to VLAN 1.

¡     Assign the hybrid port to the CVLANs.

port hybrid vlan vlan-id-list { tagged | untagged }

By default, a hybrid port is an untagged member of the VLAN to which the port belongs when its link type is access.

5.     Configure the port to allow packets from the SVLAN to pass through untagged.

¡     Configure the SVLAN as the PVID of the trunk port and assign the trunk port to the SVLAN.

port trunk pvid vlan vlan-id

port trunk permit vlan { vlan-id-list | all }

¡     Assign the hybrid port to the SVLAN as an untagged member.

port hybrid vlan vlan-id-list untagged

6.     Configure a one-to-two VLAN mapping.

vlan mapping nest { range vlan-range-list | single vlan-id-list } nested-vlan vlan-id

By default, no VLAN mapping is configured on an interface.

Configuring zero-to-two VLAN mapping

About this task

Configure zero-to-two VLAN mapping on PE 1 and PE 4, as shown in Figure 1, through which traffic from customer networks enters the service provider networks.

Restrictions and guidelines

·     For zero-to-two VLAN mapping to take effect, set the PVID of the customer-side port to 1.

·     If the CVLAN ID of the downlink traffic is not VLAN 1, configure a two-to-two VLAN mapping on the network-side port to change the CVLAN ID to 1.

·     As a best practice, set the MTU to a minimum of 1504 bytes for ports on the forwarding path of the double-tagged packet in the service provider network.

Procedure

1.     Enter system view.

system-view

2.     Enter VEB interface view.

interface ve-bridge interface-number

3.     Set the port link type to hybrid.

port link-type hybrid

By default, the link type of a port is access.

4.     Set the port PVID to VLAN 1.

port hybrid pvid vlan 1

By default, the PVID of a hybrid port is the ID of the VLAN to which the port belongs when its link type is access.

5.     Assign the port to VLAN 1.

port hybrid vlan vlan-id-list { tagged | untagged }

By default, a hybrid port is an untagged member of VLAN 1.

6.     Assign the port to the SVLAN as an untagged member.

port hybrid vlan vlan-id-list untagged

By default, a hybrid port is an untagged member of the VLAN to which the port belongs when its link type is access.

7.     Configure a zero-to-two VLAN mapping.

vlan mapping untagged nested-outer-vlan outer-vlan-id nested-inner-vlan inner-vlan-id

By default, no VLAN mapping is configured on an interface.

Configuring two-to-two VLAN mapping

About this task

Configure two-to-two VLAN mapping on the customer-side port of an edge device that connects two SP networks, for example, on PE 3 in Figure 1. Two-to-two VLAN mapping enables two sites in different VLANs to communicate at Layer 2 across two service provider networks that use different VLAN assignment schemes.

Procedure

1.     Enter system view.

system-view

2.     Enter VEB interface view.

interface ve-bridge interface-number

3.     Set the link type of the port.

port link-type { hybrid | trunk }

By default, the link type of a port is access.

4.     Assign the port to the original VLANs and the translated VLANs.

¡     Assign the trunk port to the original VLANs and the translated VLANs.

port trunk permit vlan vlan-id-list

By default, a trunk port is assigned to VLAN 1.

¡     Assign the hybrid port to the original VLANs and the translated VLANs as a tagged member.

port hybrid vlan vlan-id-list tagged

By default, a hybrid port is an untagged member of the VLAN to which the port belongs when its link type is access.

5.     Configure a two-to-two VLAN mapping.

vlan mapping tunnel outer-vlan-id inner-vlan-id translated-vlan outer-vlan-id inner-vlan-id

By default, no VLAN mapping is configured on an interface.

Display and maintenance commands for VLAN mapping

Execute display commands in any view.

 

Task

Command

Display VLAN mapping information.

display vlan mapping [ interface interface-type interface-number ]

VLAN mapping configuration examples

Example: Configuring one-to-two and two-to-two VLAN mapping

Network configuration

As shown in Figure 6:

·     Two VPN A branches, Site 1 and Site 2, are in VLAN 5 and VLAN 6, respectively.

·     The two sites use different VPN access services from different service providers, SP 1 and SP 2.

·     SP 1 assigns VLAN 100 to Site 1 and Site 2. SP 2 assigns VLAN 200 to Site 1 and Site 2.

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

Figure 6 Network diagram

Procedure

 

1.     Configure Router A:

# Create VLANs 5 and 100.

<RouterA> system-view

[RouterA] vlan 5

[RouterA-vlan5] quit

[RouterA] vlan 100

[RouterA-vlan100] quit

# Configure a one-to-two VLAN mapping on the VEB 1/0/1 to add SVLAN tag 100 to packets from VLAN 5.

[RouterA] interface ve-bridge 1/0/1

[RouterA-VE-Bridge1/0/1] vlan mapping nest single 5 nested-vlan 100

# Configure VEB 1/0/1 as a hybrid port.

[RouterA-VE-Bridge1/0/1] port link-type hybrid

# Assign VEB 1/0/1 to VLAN 5 as a tagged member.

[RouterA-VE-Bridge1/0/1] port hybrid vlan 5 tagged

# Assign VEB 1/0/1 to VLAN 100 as an untagged member.

[RouterA-VE-Bridge1/0/1] port hybrid vlan 100 untagged

[RouterA-VE-Bridge1/0/1] quit

# Configure VEB 1/0/2 as a trunk port.

[RouterA] interface ve-bridge 1/0/2

[RouterA-VE-Bridge1/0/2] port link-type trunk

# Assign VEB 1/0/2 to VLAN 100.

[RouterA-VE-Bridge1/0/2] port trunk permit vlan 100

[RouterA-VE-Bridge1/0/2] quit

2.     Configure Router B:

# Create VLAN 100.

<RouterB> system-view

[RouterB] vlan 100

[RouterB-vlan100] quit

# Configure VEB 1/0/1 as a trunk port.

[RouterB] interface ve-bridge 1/0/1

[RouterB-VE-Bridge1/0/1] port link-type trunk

# Assign VEB 1/0/1 to VLAN 100.

[RouterB-VE-Bridge1/0/1] port trunk permit vlan 100

[RouterB-VE-Bridge1/0/1] quit

# Configure VEB 1/0/2 as a trunk port.

[RouterB] interface ve-bridge 1/0/2

[RouterB-VE-Bridge1/0/2] port link-type trunk

# Assign VEB 1/0/2 to VLAN 100.

[RouterB-VE-Bridge1/0/2] port trunk permit vlan 100

[RouterB-VE-Bridge1/0/2] quit

3.     Configure Router C:

# Create VLANs 5, 6, 100, and 200.

<RouterC> system-view

[RouterC] vlan 5 to 6

[RouterC] vlan 100

[RouterC-vlan100] quit

[RouterC] vlan 200

[RouterC-vlan200] quit

# Configure VEB 1/0/1 as a trunk port.

[RouterC] interface ve-bridge 1/0/1

[RouterC-VE-Bridge1/0/1] port link-type trunk

# Assign VEB 1/0/1 to VLANs 100 and 200.

[RouterC-VE-Bridge1/0/1] port trunk permit vlan 100 200

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

[RouterC-VE-Bridge1/0/1] vlan mapping tunnel 100 5 translated-vlan 200 6

[RouterC-VE-Bridge1/0/1] quit

# Configure VE-Bridge 1/0/2 as a trunk port.

[RouterC] interface ve-bridge 1/0/2

[RouterC-VE-Bridge1/0/2] port link-type trunk

# Assign VE-Bridge 1/0/2 to VLAN 200.

[RouterC-VE-Bridge1/0/2] port trunk permit vlan 200

[RouterC-VE-Bridge1/0/2] quit

4.     Configure Router D:

# Create VLANs 6 and 200.

<RouterD> system-view

[RouterD] vlan 6

[RouterD-vlan6] quit

[RouterD] vlan 200

[RouterD-vlan200] quit

# Configure the VEB 1/0/1 as a trunk port.

[RouterD] interface ve-bridge 1/0/1

[RouterD-VE-Bridge1/0/1] port link-type trunk

# Assign VEB 1/0/1 to VLAN 200.

[RouterD-VE-Bridge1/0/1] port trunk permit vlan 200

[RouterD-VE-Bridge1/0/1] quit

# Configure VEB 1/0/2 as a hybrid port.

[RouterD] interface ve-bridge 1/0/2

[RouterD-VE-Bridge1/0/2] port link-type hybrid

# Assign VEB 1/0/2 to VLAN 6 as a tagged member.

[RouterD-VE-Bridge1/0/2] port hybrid vlan 6 tagged

# Assign VEB 1/0/2 to VLAN 200 as an untagged member.

[RouterD-VE-Bridge1/0/2] port hybrid vlan 200 untagged

# Configure a one-to-two VLAN mapping on VE-Bridge 1/0/2 to add SVLAN tag 200 to packets from VLAN 6.

[RouterD-VE-Bridge1/0/2] vlan mapping nest single 6 nested-vlan 200

[RouterD-VE-Bridge1/0/2] quit

Verifying the configuration

# Verify VLAN mapping information on Router A.

[RouterA] display vlan mapping

Interface VE-Bridge1/0/1:

  Outer VLAN    Inner VLAN    Translated Outer VLAN    Translated Inner VLAN

  5             N/A           100                      5

# Verify VLAN mapping information on Router C.

[RouterC] display vlan mapping

Interface VE-Bridge1:

  Outer VLAN    Inner VLAN    Translated Outer VLAN    Translated Inner VLAN

  100           5             200                      6

# Verify VLAN mapping information on Router D.

[RouterD] display vlan mapping

Interface VE-Bridge2:

  Outer VLAN    Inner VLAN    Translated Outer VLAN    Translated Inner VLAN

  6             N/A           200                      6

  • Cloud & AI
  • InterConnect
  • Intelligent Computing
  • Intelligent Storage
  • Security
  • SMB Products
  • Intelligent Terminal Products
  • Product Support Services
  • Technical Service Solutions
All Services
  • Resource Center
  • Policy
  • Online Help
  • Technical Blogs
All Support
  • Become A Partner
  • Partner Policy & Program
  • Global Learning
  • Partner Sales Resources
  • Partner Business Management
  • Service Business
All Partners
  • Profile
  • News & Events
  • Online Exhibition Center
  • Contact Us
All About Us
新华三官网