- Table of Contents
-
- 03-Layer 2—LAN Switching Configuration Guide
- 00-Preface
- 01-MAC address table configuration
- 02-Ethernet link aggregation configuration
- 03-Port isolation configuration
- 04-VLAN configuration
- 05-MVRP configuration
- 06-QinQ configuration
- 07-VLAN mapping configuration
- 08-Loop detection configuration
- 09-Spanning tree configuration
- 10-LLDP configuration
- 11-L2PT configuration
- 12-Loopback, null, and inloopback interface configuration
- 13-PPPoE configuration
- 14-Ethernet interface configuration
- 15-Bulk interface configuration
- Related Documents
-
Title | Size | Download |
---|---|---|
07-VLAN mapping configuration | 313.58 KB |
Contents
VLAN mapping application scenarios
Restrictions and guidelines: VLAN mapping configuration
VLAN mapping tasks at a glance
Configuring one-to-one VLAN mapping
Configuring many-to-one VLAN mapping
About many-to-one VLAN mapping
Configuring one-to-two VLAN mapping
Display and maintenance commands for VLAN mapping
VLAN mapping configuration examples
Example: Configuring one-to-one VLAN mapping
Example: Configuring many-to-one VLAN mapping
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-one VLAN mapping—Replaces one VLAN tag with another.
· Many-to-one VLAN mapping—Replaces multiple VLAN tags with the same VLAN tag.
· One-to-two VLAN mapping—Tags single-tagged packets with an outer VLAN tag.
VLAN mapping application scenarios
One-to-one and many-to-one VLAN mapping
One-to-one and many-to-one VLAN mapping are typically used by a community for broadband Internet access, as shown in Figure 1.
Figure 1 Application scenario of one-to-one and many-to-one VLAN mapping
As shown in Figure 1, the network is implemented as follows:
· Each home gateway uses different VLANs to transmit the PC, VoD, and VoIP services.
· To further subclassify each type of traffic by customer, configure one-to-one VLAN mapping on the wiring-closet switches. This feature assigns a separate VLAN to each type of traffic from each customer. The required total number of VLANs in the network can be very large.
One-to-two VLAN mapping
One-to-two VLAN mapping are typically used to implement communication usingSP networks, as shown in Figure 2.
Figure 2 Application scenario of one-to-two VLAN mapping
As shown in Figure 2,
Site 1 and Site 2 of VPN A are in different locations. Users in Site 1 and Site 2 transmit two different types of data by using VLAN 2 and VLAN 3 respectively. The SP network assigns VLAN 10 and VLAN 20 to VPN A. When a packet sent in VLAN 2 from Site 1 arrives at SP 1, PE 1 tags the packet with VLAN 10. When a packet in VLAN 3 arrives at SP 1, PE 1 tags the packet with VLAN 20.
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.
VLAN mapping implementations
Figure 3 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 3 Basic VLAN mapping terms
One-to-one VLAN mapping
As shown in Figure 4, one-to-one VLAN mapping is implemented on the customer-side port and replaces VLAN tags as follows:
· Replaces the CVLAN with the SVLAN for the uplink traffic.
· Replaces the SVLAN with the CVLAN for the downlink traffic.
Figure 4 One-to-one VLAN mapping implementation
Many-to-one VLAN mapping in common mode
As shown in Figure 5, many-to-one VLAN mapping is implemented on both the customer-side and network-side ports as follows:
· For the uplink traffic, the customer-side many-to-one VLAN mapping replaces multiple CVLANs with the same SVLAN.
· For the downlink traffic, the device performs the following operations:
a. Searches the MAC address table for an entry that matches the destination MAC address of the downlink packets.
b. Replaces the SVLAN tag with a CVLAN tag based on the matching many-to-one mapping entry.
For more information about the MAC address table, see "Configuring the MAC address table."
Figure 5 Many-to-one VLAN mapping implementation in common mode
Figure 6 Many-to-one VLAN mapping implementation in common mode (IPv6)
Figure 7 Many-to-one VLAN mapping in enhanced mode for Layer 3 downlink IPv6 traffic
One-to-two VLAN mapping
As shown in Figure 8, 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 8 One-to-two VLAN mapping implementation
Restrictions and guidelines: VLAN mapping configuration
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."
To add or replace VLAN tags for packets, you can configure both VLAN mapping and a QoS policy. The QoS policy takes effect if a configuration conflict occurs. For information about QoS policies, see ACL and QoS Configuration Guide.
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-one VLAN mapping
Configure one-to-one VLAN mapping on the wiring-closet switch, as shown in Figure 1.
· Configuring many-to-one VLAN mapping
Configure many-to-one VLAN mapping on the campus switch, as shown in Figure 1.
· Configuring one-to-two VLAN mapping
Configure one-to-two VLAN mapping on PE 1 and PE 4, as shown in Figure 2, through which traffic from customer networks enters the service provider networks.
Prerequisites
Before you configure VLAN mapping, create original and translated VLANs.
Configuring one-to-one VLAN mapping
About this task
Configure one-to-one VLAN mapping on the customer-side ports of wiring-closet switches (see Figure 1) to isolate traffic of the same service type from different homes.
Procedure
1. Enter system view.
system-view
2. Enter interface view.
¡ Enter Layer 2 Ethernet interface view.
interface interface-type interface-number
¡ Enter Layer 2 aggregate interface view.
interface bridge-aggregation 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 VLAN and the translated VLAN.
¡ Assign the trunk port to the original VLAN and the translated VLAN.
port trunk permit vlan vlan-id-list
By default, a trunk port is assigned to VLAN 1.
¡ Assign the hybrid port to the original VLAN and the translated VLAN 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 one-to-one VLAN mapping.
vlan mapping vlan-id translated-vlan vlan-id
By default, no VLAN mapping is configured on an interface.
Configuring many-to-one VLAN mapping
About many-to-one VLAN mapping
About this task
Configure many-to-one VLAN mapping on campus switches (see Figure 1) to transmit the same type of traffic from different users in one VLAN.
Restrictions and guidelines for many-to-one VLAN mapping
· The device supports a maximum of 170 many-to-one mapping entries.
· You can configure only one many-to-one VLAN mapping on the same interface. To modify the many-to-one VLAN mapping, perform the following tasks:
a. Execute the undo vlan mapping command to delete the existing many-to-one VLAN mapping.
b. Configure another many-to-one VLAN mapping.
· To ensure correct traffic forwarding from the service provider network to the customer network, do not configure many-to-one VLAN mapping together with the following reatures:
¡ uRPF.
¡ Disabling MAC address learning.
¡ Setting the MAC learning limit.
For more information about uRPF, see Security Configuration Guide. For more information about MAC address learning, see "Configuring the MAC address table."
Many-to-one VLAN mapping tasks at a glance
1. Configuring the customer-side port
2. Configuring the network-side port
Configuring the customer-side port
1. Enter system view.
system-view
2. Enter Layer 2 Ethernet interface view.
interface interface-type 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.
¡ Assign the trunk port to the original 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 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 many-to-one VLAN mapping.
vlan mapping uni { range vlan-range-list | single vlan-id-list } translated-vlan vlan-id
By default, no VLAN mapping is configured on an interface.
Configuring the network-side port
1. Enter system view.
system-view
2. Enter Layer 2 Ethernet interface view.
interface interface-type 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 translated VLAN.
¡ Assign the trunk port to the translated VLAN.
port trunk permit vlan vlan-id-list
By default, a trunk port is assigned to VLAN 1.
¡ Assign the hybrid port to the translated VLAN 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.
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 2. 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 interface view.
¡ Enter Layer 2 Ethernet interface view.
interface interface-type interface-number
¡ Enter Layer 2 aggregate interface view.
interface bridge-aggregation 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.
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-one VLAN mapping
Network configuration
As shown in Figure 9:
· Each household subscribes to PC, VoD, and VoIP services.
· On the home gateways, VLANs 1, 2, and 3 are assigned to PC, VoD, and VoIP traffic, respectively.
To isolate traffic of the same service type from different households, configure one-to-one VLAN mappings on the wiring-closet switches. This feature assigns one VLAN to each type of traffic from each household.
Procedure
1. Configure Switch A:
# Create the original VLANs.
<SwitchA> system-view
[SwitchA] vlan 2 to 3
# Create the translated VLANs.
[SwitchA] vlan 101 to 102
[SwitchA] vlan 201 to 202
[SwitchA] vlan 301 to 302
# Configure customer-side port GigabitEthernet 1/0/1 as a trunk port.
<SwitchA> system-view
[SwitchA] interface gigabitethernet 1/0/1
[SwitchA-GigabitEthernet1/0/1] port link-type trunk
# Assign GigabitEthernet 1/0/1 to all original VLANs and translated VLANs.
[SwitchA-GigabitEthernet1/0/1] port trunk permit vlan 1 2 3 101 201 301
# Configure one-to-one VLAN mappings on GigabitEthernet 1/0/1 to map VLANs 1, 2, and 3 to VLANs 101, 201, and 301, respectively.
[SwitchA-GigabitEthernet1/0/1] vlan mapping 1 translated-vlan 101
[SwitchA-GigabitEthernet1/0/1] vlan mapping 2 translated-vlan 201
[SwitchA-GigabitEthernet1/0/1] vlan mapping 3 translated-vlan 301
[SwitchA-GigabitEthernet1/0/1] quit
# Configure customer-side port GigabitEthernet 1/0/2 as a trunk port.
[SwitchA] interface gigabitethernet 1/0/2
[SwitchA-GigabitEthernet1/0/2] port link-type trunk
# Assign GigabitEthernet 1/0/2 to all original VLANs and translated VLANs.
[SwitchA-GigabitEthernet1/0/2] port trunk permit vlan 1 2 3 102 202 302
# Configure one-to-one VLAN mappings on GigabitEthernet 1/0/2 to map VLANs 1, 2, and 3 to VLANs 102, 202, and 302, respectively.
[SwitchA-GigabitEthernet1/0/2] vlan mapping 1 translated-vlan 102
[SwitchA-GigabitEthernet1/0/2] vlan mapping 2 translated-vlan 202
[SwitchA-GigabitEthernet1/0/2] vlan mapping 3 translated-vlan 302
[SwitchA-GigabitEthernet1/0/2] quit
# Configure the network-side port (GigabitEthernet 1/0/3) as a trunk port.
[SwitchA] interface gigabitethernet 1/0/3
[SwitchA-GigabitEthernet1/0/3] port link-type trunk
# Assign GigabitEthernet 1/0/3 to the translated VLANs.
[SwitchA-GigabitEthernet1/0/3] port trunk permit vlan 101 201 301 102 202 302
[SwitchA-GigabitEthernet1/0/3] quit
2. Configure Switch B in the same way Switch A is configured. (Details not shown.)
Verifying the configuration
# Verify VLAN mapping information on the wiring-closet switches, for example, Switch A.
[SwitchA] display vlan mapping
Interface GigabitEthernet1/0/1:
Outer VLAN Inner VLAN Translated Outer VLAN Translated Inner VLAN
1 N/A 101 N/A
2 N/A 201 N/A
3 N/A 301 N/A
Interface GigabitEthernet1/0/2:
Outer VLAN Inner VLAN Translated Outer VLAN Translated Inner VLAN
1 N/A 102 N/A
2 N/A 202 N/A
3 N/A 302 N/A
Example: Configuring many-to-one VLAN mapping
Network configuration
As shown in Figure 10:
· Create VLAN 2, VLAN 3, and VLAN 4 on the wiring-closet switches to isolate traffic of the same service type from different households.
· Configure many-to-one VLAN mappings on the campus switch. This feature assigns one VLAN to each type of traffic from different households.
Procedure
1. Configure Switch A:
# Create VLAN 2 as an original VLAN.
<SwitchA> system-view
[SwitchA] vlan 2
[SwitchA-vlan2] quit
# Assign ports GigabitEthernet 1/0/1 and GigabitEthernet 1/0/2 to VLAN 2.
[SwitchA] interface range gigabitethernet 1/0/1 to gigabitethernet 1/0/2
[SwitchA-if-range] port access vlan 2
[SwitchA-if-range] quit
2. Configure Switch B and Switch C in the same way Switch A is configured. (Details not shown.)
3. Configure Switch D:
# Create VLANs 2, 3, and 4 as original VLANs.
<SwitchD> system-view
[SwitchD] vlan 2 to 4
# Assign ports GigabitEthernet 1/0/1 to VLAN 2, GigabitEthernet 1/0/2 to VLAN 3, and GigabitEthernet 1/0/3 to VLAN 4.
[SwitchD] interface gigabitethernet 1/0/1
[SwitchD-GigabitEthernet1/0/1] port access vlan 2
[SwitchD-GigabitEthernet1/0/1] quit
[SwitchD] interface gigabitethernet 1/0/2
[SwitchD-GigabitEthernet1/0/2] port access vlan 3
[SwitchD-GigabitEthernet1/0/2] quit
[SwitchD] interface gigabitethernet 1/0/3
[SwitchD-GigabitEthernet1/0/3] port access vlan 4
[SwitchD-GigabitEthernet1/0/3] quit
# Configure port GigabitEthernet 1/0/4 as a trunk port.
[SwitchD] interface gigabitethernet 1/0/4
[SwitchD-GigabitEthernet1/0/4] port link-type trunk
# Assign GigabitEthernet 1/0/4 to the original VLANs.
[SwitchD-GigabitEthernet1/0/4] port trunk permit vlan 2 to 4
[SwitchD-GigabitEthernet1/0/4] quit
4. Configure Switch E:
# Create VLANs 2, 3, and 4 as original VLANs.
<SwitchE> system-view
[SwitchE] vlan 2 to 4
# Configure the customer-side port (GigabitEthernet 1/0/1) as a trunk port.
<SwitchE> system-view
[SwitchE] interface gigabitethernet 1/0/1
[SwitchE-GigabitEthernet1/0/1] port link-type trunk
# Assign GigabitEthernet 1/0/1 to the original VLANs.
[SwitchE-GigabitEthernet1/0/1] port trunk permit vlan 2 to 4
# Configure many-to-one VLAN mapping on GigabitEthernet 1/0/1, which replaces VLAN tag 2 through VLAN tag 4 with VLAN tag 10.
[SwitchE-GigabitEthernet1/0/1] vlan mapping uni range 2 to 4 translated-vlan 10
[SwitchE-GigabitEthernet1/0/1] quit
Verifying the configuration
# Verify VLAN mapping information on Switch E.
[SwitchE] display vlan mapping
Interface GigabitEthernet1/0/1:
Outer VLAN Inner VLAN Translated Outer VLAN Translated Inner VLAN
2-4 N/A 10 N/A