Configuring VLAN Mapping
Configuring VLAN Mapping
One way to establish translated VLAN IDs (S-VLANs) is to map customer VLANs to service-provider VLANs
(called VLAN ID translation) on trunk ports connected to a customer network. Packets entering the port are
mapped to a service provider VLAN (S-VLAN) based on the port number and the packet’s original customer
VLAN-ID (C-VLAN).
Service providers’s internal assignments might conflict with a customer’s VLAN. To isolate customer traffic,
a service provider could decide to map a specific VLAN into another one while the traffic is in its cloud.
Deployment Example
In the below figure, the service provider provides Layer 2 VPN service to two different customers, A and B.
The service provider separates the data and control traffic between the two customers and from the providers’
own control traffic. The service provider network must also be transparent to the customer edge devices.
All forwarding operations on the Catalyst 9000 series switch are performed using S-VLAN and not C-VLAN
information because the VLAN ID is mapped to the S-VLAN on ingress.
Note When you configure features on a port configured for VLAN mapping, you always use the S-VLAN rather
than the customer VLAN-ID (C-VLAN).
On an interface configured for VLAN mapping, the specified C-VLAN packets are mapped to the specified
S-VLAN when they enter the port. Symmetrical mapping to the customer C-VLAN occurs when packets exit
the port.
The switch supports these types of VLAN mapping on trunk ports:
• One-to-one VLAN mapping.
Figure shows a topology where a customer uses the same VLANs in multiple sites on different sides of a
service-provider network. You map the customer VLAN IDs to service-provider VLAN IDs for packet travel
across the service-provider backbone. The customer VLAN IDs are retrieved at the other side of the
service-provider backbone for use in the other customer site. Configure the same set of VLAN mappings at
a customer-connected port on each side of the service-provider network.
• Default native VLANs, user-configured native VLANs, and reserved VLANs (range 1002-1005) cannot
be used for VLAN mapping.
• The S-VLAN used for VLAN mapping cannot be a part of any other Layer 3 configurations like EVPN
or LISP.
• PVLAN support is not available when VLAN mapping is configured.
Note VLAN Mapping is supported only with the network-advantage license level.
To configure one-to-one VLAN mapping to map a customer VLAN ID to a service-provider VLAN ID,
perform this task:
Procedure
Step 5 switchport vlan mapping vlan-id Enters the VLAN IDs to be mapped:
translated-id
• vlan-id —the customer VLAN ID
Example: (C-VLAN) entering the switch from the
Device(config-if)# switchport vlan customer network. The range is from 1
mapping 2 102 to 4094.
• translated-id —the assigned
service-provider VLAN ID (S-VLAN).
The range is from 1 to 4094.
Step 7 spanning-tree bpdufilter enable Inserts a BPDU filter for spanning tree.
Example: Note To process control traffic
Device(config)# spanning-tree bpdufilter consistently, either enable Layer
enable 2 protocol tunneling
(recommended) or insert a BPDU
filter for spanning tree.
Example
Use no switchport vlan mapping command to remove the VLAN mapping information. Entering
no switchport vlan mapping all command deletes all mapping configurations.
This example shows how to map VLAN IDs 2 to 6 in the customer network to VLANs 101 to 105
in the service-provider network (Figure 3-5). You configure the same VLAN mapping commands
for a port in Switch A and Switch B; the traffic on all other VLAN IDs is forwarded as normal traffic.
Device> enable
Device# configure terminal
Device(config)# interface gigabiethernet0/1
Device(config-if)# switchport vlan mapping 2 101
Device(config-if)# switchport vlan mapping 3 102
Device(config-if)# switchport vlan mapping 4 103
Device(config-if)# switchport vlan mapping 5 104
Device(config-if)# switchport vlan mapping 6 105
Device(config-if)# exit
In the previous example, at the ingress of the service-provider network, VLAN IDs 2 to 6 in the
customer network are mapped to VLANs 101 to 105, in the service provider network. At the egress
of the service provider network, VLANs 101 to 105 in the service provider network are mapped to
VLAN IDs 2 to 6, in the customer network.
Note Packets with VLAN IDs other than the ones with configured VLAN Mapping are forwarded as
normal traffic.
Use show vlan mapping command to view information about configured vlans.
Device> enable
Device# configure terminal
Device(config)# show vlan mapping
Total no of vlan mappings configured: 1
Interface Po5:
VLANs on wire Translated VLAN Operation
------------------------------ --------------- --------------
20 30 1-to-1
Cisco IOS XE Gibraltar One-to-One VLAN One-to-One VLAN mapping allows to map
16.11.1 mapping customer VLANs to service-provider VLANs on
trunk ports connected to a customer network.
Cisco IOS XE Amsterdam Increase in VLAN The number of VLAN mappings one can configure
17.2.1 translation scale on the device has increased.
Use Cisco Feature Navigator to find information about platform and software image support. To access Cisco
Feature Navigator, go to http://www.cisco.com/go/cfn.