- Table of Contents
-
- H3C Low-End and Mid-Range Ethernet Switches Configuration Examples(V1.01)
- 00-1Cover
- 01-Login Configuration Guide
- 02-VLAN Configuration Guide
- 03-GVRP Configuration Guide
- 04-Voice VLAN Configuration Guide
- 05-IP Addressing and Performance Configuration Guide
- 06-QinQ Configuration Guide
- 07-BPDU Tunnel Configuration Guide
- 08-VLAN Mapping Configuration Guide
- 09-MAC Address Table Management Configuration Guide
- 10-Link Aggregation Configuration Guide
- 11-IP Source Guard Configuration Guide
- 12-DLDP Configuration Guide
- 13-MSTP Configuration Guide
- 14-IPv4 Routing Configuration Guide
- 15-IPv6 Configuration Guide
- 16-IPv6 Routing Configuration Guide
- 17-IPv4 Multicast Configuration Guide
- 18-IPv6 Multicast Configuration Examples
- 19-802.1x Configuration Guide
- 20-AAA Configuration Guide
- 21-MAC Authentication Configuration Guide
- 22-Portal Configuration Guide
- 23-ARP Configuration Guide
- 24-DHCP Configuration Guide
- 25-ACL Configuration Guide
- 26-QoS Configuration Guide
- 27-Port Mirroring Configuration Guide
- 28-Cluster Management Configuration Guide
- 29-SNMP-RMON Configuration Guide
- 30-NTP Configuration Guide
- 31-FTP-TFTP Configuration Guide
- 32-UDP Helper Configuration Guide
- 33-Information Center Configuration Guide
- 34-DNS Configuration Guide
- 35-File System Management Configuration Guide
- 36-Remote Upgrade Configuration Guide
- 37-NQA Configuration Guide
- 38-VRRP Configuration Guide
- 39-SSH Configuration Guide
- 40-Port Security Configuration Guide
- 41-Port Isolation Configuration Guide
- 42-LLDP Configuration Guide
- 43-MCE Configuration Guide
- 44-PoE Configuration Guide
- 45-OAM Configuration Guide
- 46-Connectivity Fault Detection Configuration Guide
- 47-RRPP Configuration Guide
- 48-sFlow Configuration Guide
- 49-SSL-HTTPS Configuration Guide
- 50-PKI Configuration Guide
- 51-Track Configuration Guide
- 52-EPON-OLT Configuration Guide
- 53-Smart Link Configuration Guide
- 54-MPLS Configuration Guide
- Related Documents
-
Title | Size | Download |
---|---|---|
08-VLAN Mapping Configuration Guide | 171.11 KB |
1 VLAN Mapping Configuration Examples
One-to-One/Many-to-One VLAN Mapping Configuration Example
Networking and Configuration Requirements
One-to-One/Many-to-One VLAN Mapping Configuration Example
Network Diagram
Figure 1-1 Scenario for one-to-one/multiple-to-one VLAN mapping
Networking and Configuration Requirements
In a multi-service intelligent campus, each household has three service applications, including PC, IPTV, and VoIP. Each service terminal gets an IP address from the DHCP server at the distribution layer.
The home gateway of each household sends traffic of the three applications to the corresponding corridor switch in VLAN 1, VLAN 2, and VLAN 3 respectively, and then the campus switches send the traffic to the distribution network. To subdivide multiple services of multiple users, use one-to-one VLAN mapping and many-to-one VLAN mapping to satisfy the following requirements:
l Configure one-to-one VLAN mapping on each corridor switch to differentiate packets of the same VLAN but from different home gateways.
l Configure many-to-one VLAN mapping on each campus switch to classify all user packets into three classes by service type and send these packets to the switch at the distribution layer.
Applicable Product Matrix
Product series |
Software version |
Hardware version |
S7500E Series Ethernet Switches |
Release 6100, Release 6300 |
All versions |
Of the VLAN mapping types, only one-to-one VLAN mapping is supported by release 6100 of the S7500E switches.
Configuration Procedure
1) Configuration on Switch A
l Configure VLANs and ports
# Create the customer VLANs (CVLANs) and the service VLANs (SVLANs).
<SwitchA> system-view
[SwitchA] vlan 2 to 3
[SwitchA] vlan 101 to 102
[SwitchA] vlan 201 to 202
[SwitchA] vlan 301 to 302
# Assign GigabitEthernet 2/0/1 to the first household’s CVLANs and corresponding SVLANs.
[SwitchA] interface gigabitethernet 2/0/1
[SwitchA-GigabitEthernet2/0/1] port link-type trunk
[SwitchA-GigabitEthernet2/0/1] port trunk permit vlan 1 2 3 101 201 301
# Enable basic QinQ on GigabitEthernet 2/0/1.
[SwitchA-GigabitEthernet2/0/1] qinq enable
[SwitchA] quit
# Assign GigabitEthernet 2/0/2 to the second household’s CVLANs and corresponding SVLANs.
[SwitchA] interface gigabitethernet 2/0/2
[SwitchA-GigabitEthernet2/0/2] port link-type trunk
[SwitchA-GigabitEthernet2/0/2] port trunk permit vlan 1 2 3 102 202 302
# Enable basic QinQ on GigabitEthernet 2/0/2.
[SwitchA-GigabitEthernet2/0/2] qinq enable
[SwitchA] quit
l Configure uplink policies.
# Configure traffic classes c1, c2, and, c3 to respectively match the CVLANs sent out by the home gateway, that is, VLAN 1, VLAN2, and VLAN 3.
[SwitchA] traffic classifier c1
[SwitchA-classifier-c1] if-match customer-vlan-id 1
[SwitchA-classifier-c1] traffic classifier c2
[SwitchA-classifier-c2] if-match customer-vlan-id 2
[SwitchA-classifier-c2] traffic classifier c3
[SwitchA-classifier-c3] if-match customer-vlan-id 3
[SwitchA-classifier-c3] quit
# Configure traffic behaviors b1, b2, b3, b4, b5, and b6 to define the action of marking traffic with SVLAN 1, SVLAN 2, SVLAN 3, SVLAN 4, SVLAN 5, and SVLAN 6 respectively.
[SwitchA] traffic behavior b1
[SwitchA-behavior-b1] remark service-vlan-id 101
[SwitchA-behavior-b1] traffic behavior b2
[SwitchA-behavior-b2] remark service-vlan-id 201
[SwitchA-behavior-b2] traffic behavior b3
[SwitchA-behavior-b3] remark service-vlan-id 301
[SwitchA-behavior-b3] traffic behavior b4
[SwitchA-behavior-b4] remark service-vlan-id 102
[SwitchA-behavior-b4] traffic behavior b5
[SwitchA-behavior-b5] remark service-vlan-id 202
[SwitchA-behavior-b5] traffic behavior b6
[SwitchA-behavior-b6] remark service-vlan-id 302
[SwitchA-behavior-b6] quit
# Configure QoS policies p1 and p2, and associate traffic classes with traffic behaviors according to the network plan.
[SwitchA] qos policy p1
[SwitchA-policy-p1] classifier c1 behavior b1
[SwitchA-policy-p1] classifier c2 behavior b2
[SwitchA-policy-p1] classifier c3 behavior b3
[SwitchA-policy-p1] quit
[SwitchA] qos policy p2
[SwitchA-policy-p2] classifier c1 behavior b4
[SwitchA-policy-p2] classifier c2 behavior b5
[SwitchA-policy-p2] classifier c3 behavior b6
[SwitchA-policy-p2] quit
l Configure downlink policies.
# Configure downlink policies to map the SVLANs to the original CVLANs. The configuration considerations are similar to those for configuring uplink policies and thus omitted here.
[SwitchA] traffic classifier c11
[SwitchA-classifier-c11] if-match service-vlan-id 101
[SwitchA-classifier-c11] traffic classifier c22
[SwitchA-classifier-c22] if-match service-vlan-id 201
[SwitchA-classifier-c22] traffic classifier c33
[SwitchA-classifier-c33] if-match service-vlan-id 301
[SwitchA-classifier-c33] traffic classifier c44
[SwitchA-classifier-c44] if-match service-vlan-id 102
[SwitchA-classifier-c44] traffic classifier c55
[SwitchA-classifier-c55] if-match service-vlan-id 202
[SwitchA-classifier-c55] traffic classifier c66
[SwitchA-classifier-c66] if-match service-vlan-id 302
[SwitchA-classifier-c66] quit
[SwitchA] traffic behavior b11
[SwitchA-behavior-b11] remark customer-vlan-id 1
[SwitchA-behavior-b11] traffic behavior b22
[SwitchA-behavior-b22] remark customer-vlan-id 2
[SwitchA-behavior-b22] traffic behavior b33
[SwitchA-behavior-b33] remark customer-vlan-id 3
[SwitchA-behavior-b33] quit
[SwitchA] qos policy p11
[SwitchA-policy-p11] classifier c11 behavior b11
[SwitchA-policy-p11] classifier c22 behavior b22
[SwitchA-policy-p11] classifier c33 behavior b33
[SwitchA-policy-p11] quit
[SwitchA] qos policy p22
[SwitchA-policy-p22] classifier c44 behavior b11
[SwitchA-policy-p22] classifier c55 behavior b22
[SwitchA-policy-p22] classifier c66 behavior b33
[SwitchA-policy-p22] quit
l Apply QoS policies to port.
# Apply the uplink policy p1 to the inbound direction of GigabitEthernet 2/0/1.
[SwitchA] interface GigabitEthernet 2/0/1
[SwitchA-GigabitEthernet2/0/1] qos apply policy p1 inbound
# Apply the downlink policy p11 to the outbound direction of GigabitEthernet 2/0/1.
[SwitchA-GigabitEthernet2/0/1] qos apply policy p11 outbound
[SwitchA-GigabitEthernet2/0/1] quit
# Apply the uplink policy p2 to the inbound direction of GigabitEthernet 2/0/2.
[SwitchA] interface GigabitEthernet 2/0/2
[SwitchA-GigabitEthernet2/0/2] qos apply policy p2 inbound
# Apply the downlink policy p22 to the outbound direction of GigabitEthernet 2/0/2.
[SwitchA-GigabitEthernet2/0/2] qos apply policy p22 outbound
[SwitchA-GigabitEthernet2/0/2] quit
l Configure uplink ports.
# Configure GigabitEthernet 2/0/3 to permit frames of the specified SVLANs to pass through.
[SwitchA] interface gigabitethernet 2/0/3
[SwitchA-GigabitEthernet2/0/3] port link-type trunk
[SwitchA-GigabitEthernet2/0/3] port trunk permit vlan 101 201 301 102 202 302
2) Configuration on Switch B
l Configure VLANs and ports.
# Create the CVLANs and the SVLANs.
<SwitchB> system-view
[SwitchB] vlan 2 to 3
[SwitchB] vlan 111 to 112
[SwitchB] vlan 211 to 212
[SwitchB] vlan 311 to 312
# Assign GigabitEthernet 2/0/1 to the specified CVLANs and SVLANs.
[SwitchB] interface gigabitethernet 2/0/1
[SwitchB-GigabitEthernet2/0/1] port link-type trunk
[SwitchB-GigabitEthernet2/0/1] port trunk permit vlan 1 2 3 111 211 311
# Enable basic QinQ on GigabitEthernet 2/0/1.
[SwitchB-GigabitEthernet2/0/1] qinq enable
[SwitchB] quit
# Assign GigabitEthernet 2/0/2 to the specified CVLANs and SVLANs.
[SwitchB] interface gigabitethernet 2/0/2
[SwitchB-GigabitEthernet2/0/2] port link-type trunk
[SwitchB-GigabitEthernet2/0/2] port trunk permit vlan 1 2 3 112 212 312
# Enable basic QinQ on GigabitEthernet 2/0/2.
[SwitchB-GigabitEthernet2/0/2] qinq enable
[SwitchB] quit
l Configure uplink policies.
# Configure uplink policies to map the CVLANs to the SVLANs. The configuration considerations are similar to those on Switch A and thus are omitted.
[SwitchB] traffic classifier c1
[SwitchB-classifier-c1] if-match customer-vlan-id 1
[SwitchB-classifier-c1] traffic classifier c2
[SwitchB-classifier-c2] if-match customer-vlan-id 2
[SwitchB-classifier-c2] traffic classifier c3
[SwitchB-classifier-c3] if-match customer-vlan-id 3
[SwitchB-classifier-c3] quit
[SwitchB] traffic behavior b1
[SwitchB-behavior-b1] remark service-vlan-id 111
[SwitchB-behavior-b1] traffic behavior b2
[SwitchB-behavior-b2] remark service-vlan-id 211
[SwitchB-behavior-b2] traffic behavior b3
[SwitchB-behavior-b3] remark service-vlan-id 311
[SwitchB-behavior-b3] traffic behavior b4
[SwitchB-behavior-b4] remark service-vlan-id 112
[SwitchB-behavior-b4] traffic behavior b5
[SwitchB-behavior-b5] remark service-vlan-id 212
[SwitchB-behavior-b5] traffic behavior b6
[SwitchB-behavior-b6] remark service-vlan-id 312
[SwitchB-behavior-b6] quit
[SwitchB] qos policy p1
[SwitchB-policy-p1] classifier c1 behavior b1
[SwitchB-policy-p1] classifier c2 behavior b2
[SwitchB-policy-p1] classifier c3 behavior b3
[SwitchB-policy-p1] quit
[SwitchB] qos policy p2
[SwitchB-policy-p2] classifier c1 behavior b4
[SwitchB-policy-p2] classifier c2 behavior b5
[SwitchB-policy-p2] classifier c3 behavior b6
[SwitchB-policy-p2] quit
l Configure downlink policies.
# Configure downlink policies to map the SVLANs to the original CVLANs. The configuration considerations are similar to those on Switch A and thus are omitted.
[SwitchB] traffic classifier c11
[SwitchB-classifier-c11] if-match service-vlan-id 111
[SwitchB-classifier-c11] traffic classifier c22
[SwitchB-classifier-c22] if-match service-vlan-id 211
[SwitchB-classifier-c22] traffic classifier c33
[SwitchB-classifier-c33] if-match service-vlan-id 311
[SwitchB-classifier-c33] traffic classifier c44
[SwitchB-classifier-c44] if-match service-vlan-id 112
[SwitchB-classifier-c44] traffic classifier c55
[SwitchB-classifier-c55] if-match service-vlan-id 212
[SwitchB-classifier-c55] traffic classifier c66
[SwitchB-classifier-c66] if-match service-vlan-id 312
[SwitchB-classifier-c66] quit
[SwitchB] traffic behavior b11
[SwitchB-behavior-b11] remark customer-vlan-id 1
[SwitchB-behavior-b11] traffic behavior b22
[SwitchB-behavior-b22] remark customer-vlan-id 2
[SwitchB-behavior-b22] traffic behavior b33
[SwitchB-behavior-b33] remark customer-vlan-id 3
[SwitchB-behavior-b33] quit
[SwitchB] qos policy p11
[SwitchB-policy-p11] classifier c11 behavior b11
[SwitchB-policy-p11] classifier c22 behavior b22
[SwitchB-policy-p11] classifier c33 behavior b33
[SwitchB-policy-p11] quit
[SwitchB] qos policy p22
[SwitchB-policy-p22] classifier c44 behavior b11
[SwitchB-policy-p22] classifier c55 behavior b22
[SwitchB-policy-p22] classifier c66 behavior b33
[SwitchB-policy-p22] quit
l Apply policies to ports.
# Apply the uplink policy p1 to the inbound direction of GigabitEthernet 2/0/1.
[SwitchB] interface GigabitEthernet 2/0/1
[SwitchB-GigabitEthernet2/0/1] qos apply policy p1 inbound
# Apply the downlink policy p11 to the outbound direction of GigabitEthernet 2/0/1.
[SwitchB-GigabitEthernet2/0/1] qos apply policy p11 outbound
[SwitchB-GigabitEthernet2/0/1] quit
# Apply the uplink policy p2 to the inbound direction of GigabitEthernet 2/0/2.
[SwitchB-GigabitEthernet2/0/2] qos apply policy p2 inbound
# Apply the downlink policy p22 to the outbound direction of GigabitEthernet 2/0/2.
[SwitchB-GigabitEthernet2/0/2] qos apply policy p22 outbound
[SwitchB-GigabitEthernet2/0/2] quit
l Configure uplink ports.
# Configure GigabitEthernet 2/0/3 to permit frames of the specified SVLANs to pass through.
[SwitchB] interface gigabitethernet 2/0/3
[SwitchB-GigabitEthernet2/0/3] port link-type trunk
[SwitchB-GigabitEthernet2/0/3] port trunk permit vlan 111 211 311 112 212 312
3) Configuration on Switch C
l Configure VLANs and ports.
# Create CVLANs for the traffic flows to be sent to or received from the corridor switches, and create SVLANs 501, 502, and 503. The configuration procedure is omitted here.
# Configure GigabitEthernet 2/0/1 to permit frames of the specified CVLANs and SVLANs to pass through.
<SwitchC> system-view
[SwitchC] interface gigabitethernet 2/0/1
[SwitchC-GigabitEthernet2/0/1] port link-type trunk
[SwitchC-GigabitEthernet2/0/1] port trunk permit vlan 101 201 301 102 202 302 501 502 503
# Enable customer-side QinQ on GigabitEthernet 2/0/1.
[SwitchC-GigabitEthernet2/0/1] qinq enable downlink
# Configure GigabitEthernet 2/0/2 to permit frames of the specified CVLANs and SVLANs to pass through.
[SwitchC] interface gigabitethernet 2/0/2
[SwitchC-GigabitEthernet2/0/2] port link-type trunk
[SwitchC-GigabitEthernet2/0/2] port trunk permit vlan 111 211 311 112 212 312 501 502 503
# Enable customer-side QinQ on GigabitEthernet 2/0/2.
[SwitchC-GigabitEthernet2/0/2] qinq enable downlink
l Configure DHCP snooping and ARP detection
# Enable DHCP snooping. DHCP snooping maintains mappings of IP address, MAC address, CVLAN, and SVLAN for DHCP clients. When the switch receives a downlink packet, it looks up this mapping table based on the SVLAN for a match and replaces the SVLAN with the matching CVLAN.
[SwitchC] dhcp-snooping
# Enable ARP detection on each VLAN involved in VLAN mapping, so that VLAN mapping can be performed for ARP packets.
[SwitchC] vlan 101
[SwitchC-vlan101] arp detection enable
[SwitchC-vlan101] vlan 201
[SwitchC-vlan201] arp detection enable
[SwitchC-vlan201] vlan 301
[SwitchC-vlan301] arp detection enable
[SwitchC-vlan301] vlan 102
[SwitchC-vlan102] arp detection enable
[SwitchC-vlan102] vlan 202
[SwitchC-vlan202] arp detection enable
[SwitchC-vlan202] vlan 302
[SwitchC-vlan302] arp detection enable
[SwitchC-vlan302] vlan 111
[SwitchC-vlan111] arp detection enable
[SwitchC-vlan111] vlan 211
[SwitchC-vlan211] arp detection enable
[SwitchC-vlan211] vlan 311
[SwitchC-vlan311] arp detection enable
[SwitchC-vlan311] vlan 112
[SwitchC-vlan112] arp detection enable
[SwitchC-vlan112] vlan 212
[SwitchC-vlan212] arp detection enable
[SwitchC-vlan212] vlan 312
[SwitchC-vlan312] arp detection enable
[SwitchC-vlan312] vlan 501
[SwitchC-vlan501] arp detection enable
[SwitchC-vlan501] vlan 502
[SwitchC-vlan502] arp detection enable
[SwitchC-vlan502] vlan 503
[SwitchC-vlan503] arp detection enable
[SwitchC-vlan503] quit
l Configure uplink policies.
# Configure uplink policies to map the CVLANs for the same service of different users to the same SVLAN.
[SwitchC] traffic classifier c1
[SwitchC-classifier-c1] if-match customer-vlan-id 101 to 200
[SwitchC-classifier-c1] traffic classifier c2
[SwitchC-classifier-c2] if-match customer-vlan-id 201 to 300
[SwitchC-classifier-c2] traffic classifier c3
[SwitchC-classifier-c3] if-match customer-vlan-id 301 to 400
[SwitchC-classifier-c3] traffic classifier c4
[SwitchC-classifier-c4] if-match customer-vlan-id 111 to 210
[SwitchC-classifier-c4] traffic classifier c5
[SwitchC-classifier-c5] if-match customer-vlan-id 211 to 310
[SwitchC-classifier-c5] traffic classifier c6
[SwitchC-classifier-c6] if-match customer-vlan-id 311 to 410
[SwitchC-classifier-c6] quit
[SwitchC] traffic behavior b1
[SwitchC-behavior-b1] remark service-vlan-id 501
[SwitchC-behavior-b1] traffic behavior b2
[SwitchC-behavior-b2] remark service-vlan-id 502
[SwitchC-behavior-b2] traffic behavior b3
[SwitchC-behavior-b3] remark service-vlan-id 503
[SwitchC-behavior-b3] quit
[SwitchC] qos policy p1
[SwitchC-policy-p1] classifier c1 behavior b1 mode dot1q-tag-manipulation
[SwitchC-policy-p1] classifier c2 behavior b2 mode dot1q-tag-manipulation
[SwitchC-policy-p1] classifier c3 behavior b3 mode dot1q-tag-manipulation
[SwitchC-policy-p1] classifier c4 behavior b1 mode dot1q-tag-manipulation
[SwitchC-policy-p1] classifier c5 behavior b2 mode dot1q-tag-manipulation
[SwitchC-policy-p1] classifier c6 behavior b3 mode dot1q-tag-manipulation
[SwitchC-policy-p1] quit
l Apply policies to ports.
# Apply the uplink policy p1 to the inbound direction of GigabitEthernet 2/0/1.
[SwitchC] interface GigabitEthernet 2/0/1
[SwitchC-GigabitEthernet2/0/1] qos apply policy p1 inbound
[SwitchC-GigabitEthernet2/0/1] quit
# Apply the uplink policy p2 to the inbound direction of GigabitEthernet 2/0/2.
[SwitchC] interface GigabitEthernet 2/0/2
[SwitchC-GigabitEthernet2/0/2] qos apply policy p2 inbound
[SwitchC-GigabitEthernet2/0/2] quit
l Configure the uplink port
# Configure GigabitEthernet 2/0/3 to permit frames of the specified SVLANs to pass through.
[SwitchC] interface gigabitethernet 2/0/3
[SwitchC-GigabitEthernet2/0/3] port link-type trunk
[SwitchC-GigabitEthernet2/0/3] port trunk permit vlan 501 502 503
# Configure GigabitEthernet 2/0/3 as a DHCP snooping trusted port.
[SwitchC-GigabitEthernet2/0/3] dhcp-snooping trust
# Configure GigabitEthernet 2/0/3 as an ARP trusted port.
[SwitchC-GigabitEthernet2/0/3] arp detection trust
# Enable SP-side QinQ on GigabitEthernet 2/0/3.
[SwitchC-GigabitEthernet2/0/3] qinq enable uplink
4) Configuration on Switch D
# Create SVLANs 501, 502, and 503. The configuration procedure is omitted.
# Enable DHCP snooping.
<SwitchD> system-view
[SwitchD] dhcp-snooping
# Configure GigabitEthernet 2/0/1 to permit frames of the specified SVLANs to pass through.
[SwitchD] interface gigabitethernet 2/0/1
[SwitchD-GigabitEthernet2/0/1] port link-type trunk
[SwitchD-GigabitEthernet2/0/1] port trunk permit vlan 501 502 503
# Configure GigabitEthernet 2/0/1 as a DHCP snooping trusted port and disable DHCP snooping to record the IP-to-MAC bindings for DHCP clients on it.
[SwitchD-GigabitEthernet2/0/1] dhcp-snooping trust no-user-binding
Complete Configuration
l Configuration on Switch A
#
vlan 2 to 3
#
vlan 101 to 102
#
vlan 201 to 202
#
vlan 301 to 302
#
traffic classifier c2 operator and
if-match customer-vlan-id 2
traffic classifier c3 operator and
if-match customer-vlan-id 3
traffic classifier c1 operator and
if-match customer-vlan-id 1
traffic classifier c11 operator and
if-match service-vlan-id 101
traffic classifier c22 operator and
if-match service-vlan-id 201
traffic classifier c33 operator and
if-match service-vlan-id 301
traffic classifier c44 operator and
if-match service-vlan-id 102
traffic classifier c55 operator and
if-match service-vlan-id 202
traffic classifier c66 operator and
if-match service-vlan-id 302
#
traffic behavior b11
remark customer-vlan-id 1
traffic behavior b22
remark customer-vlan-id 2
traffic behavior b33
remark customer-vlan-id 3
traffic behavior b6
remark service-vlan-id 302
traffic behavior b4
remark service-vlan-id 102
traffic behavior b2
remark service-vlan-id 201
traffic behavior test
traffic behavior b5
remark service-vlan-id 202
traffic behavior b3
remark service-vlan-id 301
traffic behavior b1
remark service-vlan-id 101
#
qos policy p11
classifier c11 behavior b11
classifier c22 behavior b22
classifier c33 behavior b33
qos policy p22
classifier c44 behavior b11
classifier c55 behavior b22
classifier c66 behavior b33
qos policy p2
classifier c1 behavior b4
classifier c2 behavior b5
classifier c3 behavior b6
qos policy p1
classifier c1 behavior b1
classifier c2 behavior b2
classifier c3 behavior b3
#
interface GigabitEthernet2/0/1
port link-type trunk
port trunk permit vlan 1 to 3 101 201 301
qinq enable
qos apply policy p1 inbound
qos apply policy p11 outbound
#
interface GigabitEthernet2/0/2
port link-type trunk
port trunk permit vlan 1 to 3 102 202 302
qinq enable
qos apply policy p2 inbound
qos apply policy p22 outbound
#
interface GigabitEthernet2/0/3
port link-type trunk
port trunk permit vlan 1 101 to 102 201 to 202 301 to 302
l Configuration on Switch B
#
vlan 2 to 3
#
vlan 111 to 112
#
vlan 211 to 212
#
vlan 311 to 312
#
traffic classifier c1 operator and
if-match customer-vlan-id 1
traffic classifier c2 operator and
if-match customer-vlan-id 2
traffic classifier c3 operator and
if-match customer-vlan-id 3
traffic classifier c11 operator and
if-match service-vlan-id 111
traffic classifier c22 operator and
if-match service-vlan-id 211
traffic classifier c33 operator and
if-match service-vlan-id 311
traffic classifier c44 operator and
if-match service-vlan-id 112
traffic classifier c55 operator and
if-match service-vlan-id 212
traffic classifier c66 operator and
if-match service-vlan-id 312
#
traffic behavior b11
remark customer-vlan-id 1
traffic behavior b22
remark customer-vlan-id 2
traffic behavior b33
remark customer-vlan-id 3
traffic behavior b6
remark service-vlan-id 312
traffic behavior b4
remark service-vlan-id 112
traffic behavior b2
remark service-vlan-id 211
traffic behavior test
traffic behavior b5
remark service-vlan-id 212
traffic behavior b3
remark service-vlan-id 311
traffic behavior b1
remark service-vlan-id 111
#
qos policy p11
classifier c11 behavior b11
classifier c22 behavior b22
classifier c33 behavior b33
qos policy p22
classifier c44 behavior b11
classifier c55 behavior b22
classifier c66 behavior b33
qos policy p2
classifier c1 behavior b4
classifier c2 behavior b5
classifier c3 behavior b6
qos policy p1
classifier c1 behavior b1
classifier c2 behavior b2
classifier c3 behavior b3
#
interface GigabitEthernet2/0/1
port link-type trunk
port trunk permit vlan 1 to 3 111 211 311
qinq enable
qos apply policy p1 inbound
qos apply policy p11 outbound
#
interface GigabitEthernet2/0/2
port link-type trunk
port trunk permit vlan 1 to 3 112 212 312
qinq enable
qos apply policy p2 inbound
qos apply policy p22 outbound
#
interface GigabitEthernet2/0/3
port link-type trunk
port trunk permit vlan 1 111 to 112 211 to 212 311 to 312
l Configuration on Switch C
#
dhcp-snooping
#
vlan 101
arp detection enable
#
vlan 102
arp detection enable
#
vlan 111
arp detection enable
#
vlan 112
arp detection enable
#
vlan 201
arp detection enable
#
vlan 202
arp detection enable
#
vlan 211
arp detection enable
#
vlan 212
arp detection enable
#
vlan 301
arp detection enable
#
vlan 302
arp detection enable
#
vlan 311
arp detection enable
#
vlan 312
arp detection enable
#
vlan 501
arp detection enable
#
vlan 502
arp detection enable
#
vlan 503
arp detection enable
#
#
traffic classifier c6 operator and
if-match customer-vlan-id 311 to 410
traffic classifier c4 operator and
if-match customer-vlan-id 111 to 210
traffic classifier c2 operator and
if-match customer-vlan-id 201 to 300
traffic classifier c5 operator and
if-match customer-vlan-id 211 to 310
traffic classifier c3 operator and
if-match customer-vlan-id 301 to 400
traffic classifier c1 operator and
if-match customer-vlan-id 101 to 200
#
traffic behavior b2
remark service-vlan-id 502
traffic behavior b3
remark service-vlan-id 503
traffic behavior b1
remark service-vlan-id 501
#
qos policy p1
classifier c1 behavior b1 mode dot1q-tag-manipulation
classifier c2 behavior b2 mode dot1q-tag-manipulation
classifier c3 behavior b3 mode dot1q-tag-manipulation
classifier c4 behavior b1 mode dot1q-tag-manipulation
classifier c5 behavior b2 mode dot1q-tag-manipulation
classifier c6 behavior b3 mode dot1q-tag-manipulation
#
interface GigabitEthernet2/0/1
port link-type trunk
port trunk permit vlan 1 101 to 102 201 to 202 301 to 302 501 to 503
qinq enable downlink
qos apply policy p1 inbound
#
interface GigabitEthernet2/0/2
port link-type trunk
port trunk permit vlan 1 111 to 112 211 to 212 311 to 312 501 to 503
qinq enable downlink
qos apply policy p1 inbound
#
interface GigabitEthernet2/0/3
port link-type trunk
port trunk permit vlan 1 501 to 503
qinq enable uplink
dhcp-snooping trust
arp detection trust
l Configuration on Switch D
#
dhcp-snooping
#
vlan 501 to 503
#
interface GigabitEthernet2/0/1
port link-type trunk
port trunk permit vlan 1 501 to 503
dhcp-snooping trust no-user-binding
Precautions
l The CVLAN-to-SVLAN mappings have been planned.
l Before applying a QoS policy to the downlink port, enable customer-side QinQ on the port; before disabling customer-side QinQ on the downlink port, remove the QoS policy.
l To change a many-to-one VLAN mapping configuration, you must first use the reset dhcp-snooping command to clear the corresponding DHCP snooping entry, and then modify the VLAN mapping relationship in the QoS policies.
l When configuring many-to-one VLAN mapping, you cannot create VLAN interfaces for the involved SVLANs and CVLANs on the switch.
One-to-Two/Two-to-Two VLAN Mapping Configuration Example
Network Diagram
Figure 1-2 Network diagram for one-to-two/two-to-two VLAN mapping configuration
Network Requirements
As shown in the network diagram, a VPN1 connection is created for two branches of a company in two cities to communicate across the networks of two service providers (SP 1 and SP 2). The packets from the branches are sent tagged with VLAN 10 and VLAN 30 respectively to the service providers.
Configure one-to-two and two-to-two VLAN mapping on devices of the two service providers to satisfy the following requirements:
l SP 1 tags the user packets with VLAN 100 and SP2 tags the user packets with VLAN 200 to have the traffic of the two branches travel the service provider networks double tagged. In addition, configure the edge devices between the two service provider networks to modify the outer label of each user packet to adapt to the VLAN plan of the network that the packet is sent to.
l In the VPN1 network, different VLANs in different cities can communicate.
Applicable Product Matrix
Product series |
Software version |
Hardware version |
S7500E series Ethernet switches |
Release 6300 |
All versions |
Configuration Procedure
1) Configuration on Device A
# Create VLAN 100.
<DeviceA> system-view
[DeviceA] vlan 100
[DeviceA-vlan100] quit
# Configure an uplink policy to add VLAN tag 200 to the packets with VLAN tag 10.
[DeviceA] traffic classifier nest
[DeviceA-classifier-nest] if-match customer-vlan-id 10
[DeviceA-classifier-nest] quit
[DeviceA] traffic behavior nest
[DeviceA-behavior-nest] nest top-most vlan-id 100
[DeviceA-behavior-nest] quit
[DeviceA] qos policy nest
[DeviceA-qospolicy-nest] classifier nest behavior nest
[DeviceA-qospolicy-nest] quit
# Configure GigabitEthernet 2/0/1 as a hybrid port, and assign the port to VLAN 100 in untagged mode.
[DeviceA] interface gigabitethernet 2/0/1
[DeviceA-GigabitEthernet2/0/1] port link-type hybrid
[DeviceA-GigabitEthernet2/0/1] port hybrid vlan 100 untagged
# Enable basic QinQ on GigabitEthernet 2/0/1.
[DeviceA-GigabitEthernet2/0/1] qinq enable
# Apply the uplink policy test in the inbound direction of GigabitEthernet 2/0/1.
[DeviceA-GigabitEthernet2/0/1] qos apply policy nest inbound
[DeviceA-GigabitEthernet2/0/1] quit
# Configure the uplink port GigabitEthernet 2/0/2 as a trunk port, and assign it to VLAN 100.
[DeviceA] interface gigabitethernet 2/0/2
[DeviceA-GigabitEthernet2/0/2] port link-type trunk
[DeviceA-GigabitEthernet2/0/2] port trunk permit vlan 100
2) Configuration on Device B
# Create VLAN 100.
<DeviceB> system-view
[DeviceB] vlan 100
[DeviceB-vlan100] quit
# Configure GigabitEthernet 2/0/1 as a trunk port, and assign it to VLAN 100.
[DeviceB] interface gigabitethernet 2/0/1
[DeviceB-GigabitEthernet2/0/1] port link-type trunk
[DeviceB-GigabitEthernet2/0/1] port trunk permit vlan 100
[DeviceB-GigabitEthernet2/0/1] quit
# Configure GigabitEthernet 2/0/2 as a trunk port, and assign it to VLAN 100.
[DeviceB] interface gigabitethernet 2/0/2
[DeviceB-GigabitEthernet2/0/2] port link-type trunk
[DeviceB-GigabitEthernet2/0/2] port trunk permit vlan 100
3) Configuration on Device C
# Create VLAN200.
<DeviceC> system-view
[DeviceC] vlan 200
[DeviceC-vlan200] quit
# Create a class downlink_in to match packets with inner VLAN tag 10 and outer VLAN tag 100.
[DeviceC] traffic classifier downlink_in
[DeviceC-classifier-downlink_in] if-match customer-vlan-id 10
[DeviceC-classifier-downlink_in] if-match service-vlan-id 100
[DeviceC-classifier-downlink_in] quit
# Create a traffic behavior downlink_in to replace the outer VLAN tags with VLAN tag 200.
[DeviceC] traffic behavior downlink_in
[DeviceC-behavior-downlink_in] remark service-vlan-id 200
[DeviceC-behavior-downlink_in] quit
# Create a policy downlink_in to associate the class downlink_in with the traffic behavior downlink_in.
[DeviceC] qos policy downlink_in
[DeviceC-qospolicy-downlink_in] classifier downlink_in behavior downlink_in
[DeviceC-qospolicy-downlink_in] quit
# Create a class downlink_out to match packets with inner VLAN tag 30 and outer VLAN tag 200.
[DeviceC] traffic classifier downlink_out
[DeviceC-classifier-downlink_out] if-match customer-vlan-id 30
[DeviceC-classifier-downlink_out] if-match service-vlan-id 200
[DeviceC-classifier-downlink_out] quit
# Create a traffic behavior downlink_out to replace the inner VLAN tags with VLAN tag 10 and outer VLAN tags with VLAN tag 100.
[DeviceC] traffic behavior downlink_out
[DeviceC-behavior-downlink_out] remark customer-vlan-id 10
[DeviceC-behavior-downlink_out] remark service-vlan-id 100
[DeviceC-behavior-downlink_out] quit
# Create a policy downlink_out to associate class downlink_out with traffic behavior downlink_out.
[DeviceC] qos policy downlink_out
[DeviceC-qospolicy-downlink_out] classifier downlink_out behavior downlink_out
[DeviceC-qospolicy-downlink_out] quit
# Create a class uplink_out to match traffic with inner VLAN tag 10 and outer VLAN tag 200.
[DeviceC] traffic classifier uplink_out
[DeviceC-classifier-uplink_out] if-match customer-vlan-id 10
[DeviceC-classifier-uplink_out] if-match service-vlan-id 200
[DeviceC-classifier-uplink_out] quit
# Create a traffic behavior uplink_out to replace the inner VLAN tag with VLAN tag 30.
[DeviceC] traffic behavior uplink_out
[DeviceC-behavior-uplink_out] remark customer-vlan-id 30
[DeviceC-behavior-uplink_out] quit
# Create a policy uplink_out to associate the class uplink_out with the traffic behavior uplink_out.
[DeviceC] qos policy uplink_out
[DeviceC-qospolicy-uplink_out] classifier uplink_out behavior uplink_out
[DeviceC-qospolicy-uplink_out] quit
# Apply the policy downlink_in to the inbound direction of GigabitEthernet 2/0/1, the policy downlink_out to the outbound direction of GigabitEthernet 2/0/1, and the policy uplink_out to the outbound direction of GigabitEthernet 2/0/2.
[DeviceC] interface gigabitethernet 2/0/1
[DeviceB-GigabitEthernet2/0/1] port link-type trunk
[DeviceB-GigabitEthernet2/0/1] port trunk permit vlan 200
[DeviceC-GigabitEthernet2/0/1] qos apply policy downlink_in inbound
[DeviceC-GigabitEthernet2/0/1] qos apply policy downlink_out outbound
[DeviceC-GigabitEthernet2/0/1] quit
[DeviceC] interface gigabitethernet 2/0/2
[DeviceB-GigabitEthernet2/0/2] port link-type trunk
[DeviceB-GigabitEthernet2/0/2] port trunk permit vlan 200
[DeviceC-GigabitEthernet2/0/2] qos apply policy uplink_out outbound
[DeviceC-GigabitEthernet2/0/2] quit
4) Configuration on Device D
# Create VLAN 200.
<DeviceD> system-view
[DeviceD] vlan 200
[DeviceD-vlan200] quit
# Configure an uplink policy to add outer VLAN tag 200 to packets with inner VLAN tag 30.
[DeviceD] traffic classifier nest
[DeviceD-classifier-nest] if-match customer-vlan-id 30
[DeviceD-classifier-nest] quit
[DeviceD] traffic behavior nest
[DeviceD-behavior-nest] nest top-most vlan-id 200
[DeviceD-behavior-nest] quit
[DeviceD] qos policy nest
[DeviceD-qospolicy-nest] classifier nest behavior nest
[DeviceD-qospolicy-nest] quit
# Configure GigabitEthernet 2/0/1 as a trunk port and assign it to VLAN 200.
[DeviceD] interface gigabitethernet 2/0/1
[DeviceD-GigabitEthernet2/0/1] port link-type trunk
[DeviceD-GigabitEthernet2/0/1] port trunk permit vlan 200
# Configure GigabitEthernet 2/0/2 as a hybrid port, and assign it to VLAN 200 in untagged mode.
[DeviceD] interface gigabitethernet 2/0/2
[DeviceD-GigabitEthernet2/0/2] port link-type hybrid
[DeviceD-GigabitEthernet2/0/2] port hybrid vlan 200 untagged
# Enable basic QinQ on GigabitEthernet 2/0/2.
[DeviceD-GigabitEthernet2/0/2] qinq enable
# Apply the uplink policy test to the inbound direction of GigabitEthernet 2/0/2.
[DeviceD-GigabitEthernet2/0/2] qos apply policy nest inbound
[DeviceD-GigabitEthernet2/0/2] quit
Complete Configuration
l Configuration on Device A
#
vlan 100
#
traffic classifier nest operator and
if-match customer-vlan-id 10
#
traffic behavior nest
nest top-most vlan-id 100
#
qos policy nest
classifier nest behavior nest
#
interface GigabitEthernet2/0/1
port link-type hybrid
port hybrid vlan 1 100 untagged
qinq enable
qos apply policy nest inbound
#
interface GigabitEthernet2/0/2
port link-type trunk
port trunk permit vlan 1 100
l Configuration on Device B
#
vlan 100
#
interface GigabitEthernet2/0/1
port link-type trunk
port trunk permit vlan 1 100
#
interface GigabitEthernet2/0/2
port link-type trunk
port trunk permit vlan 1 100
l Configuration on Device C
#
vlan 200
#
traffic classifier uplink_out operator and
if-match customer-vlan-id 10
if-match service-vlan-id 200
traffic classifier downlink_in operator and
if-match customer-vlan-id 10
if-match service-vlan-id 100
traffic classifier downlink_out operator and
if-match customer-vlan-id 30
if-match service-vlan-id 200
#
traffic behavior uplink_out
remark customer-vlan-id 30
traffic behavior downlink_in
remark service-vlan-id 200
traffic behavior downlink_out
remark customer-vlan-id 10
remark service-vlan-id 100
#
qos policy uplink_out
classifier uplink_out behavior uplink_out
qos policy downlink_in
classifier downlink_in behavior downlink_in
qos policy downlink_out
classifier downlink_out behavior downlink_out
#
interface GigabitEthernet2/0/1
port link-type trunk
port trunk permit vlan 1 200
qos apply policy downlink_in inbound
qos apply policy downlink_out outbound
#
interface GigabitEthernet2/0/2
port link-type trunk
port trunk permit vlan 1 200
qos apply policy uplink_out outbound
l Configuration on Device D
#
vlan 100
#
traffic classifier nest operator and
if-match customer-vlan-id 30
#
traffic behavior nest
nest top-most vlan-id 200
#
qos policy nest
classifier nest behavior nest
#
interface GigabitEthernet2/0/1
port link-type trunk
port trunk permit vlan 1 200
#
interface GigabitEthernet2/0/2
port link-type hybrid
port hybrid vlan 1 200 untagged
qinq enable
qos apply policy nest inbound
Precautions
l For detailed information about QoS policies, refer to the QoS Operation Manual(Release 6300) for your switch.