- Table of Contents
-
- 04-Layer 2—LAN Switching Command Reference
- 00-Preface
- 01-MAC address table commands
- 02-Ethernet link aggregation commands
- 03-M-LAG commands
- 04-Port isolation commands
- 05-VLAN commands
- 06-MVRP commands
- 07-QinQ commands
- 08-VLAN mapping commands
- 09-Loop detection commands
- 10-Spanning tree commands
- 11-LLDP commands
- 12-Service loopback group commands
- 13-Layer 2 forwarding commands
- Related Documents
-
Title | Size | Download |
---|---|---|
08-VLAN mapping commands | 57.48 KB |
VLAN mapping commands
MDC is supported only on the device operating in standalone mode. For more information about the standalone mode and MDC hardware compatibility, see Virtual Technologies Configuration Guide.
display vlan mapping
Use display vlan mapping to display VLAN mapping information.
Syntax
display vlan mapping [ interface interface-type interface-number ]
Views
Any view
Predefined user roles
network-admin
network-operator
mdc-admin
mdc-operator
Parameters
interface interface-type interface-number: Specifies an interface by its type and number. If you do not specify an interface, the command displays VLAN mapping information on all interfaces.
Examples
# Display VLAN mapping information on all interfaces.
<Sysname> display vlan mapping
Interface Ten-GigabitEthernet3/0/1:
Outer VLAN Inner VLAN Translated Outer VLAN Translated Inner VLAN
10 N/A 120 N/A
Interface Ten-GigabitEthernet3/0/3:
Outer VLAN Inner VLAN Translated Outer VLAN Translated Inner VLAN
12 N/A 110 12
Interface Ten-GigabitEthernet3/0/4:
Outer VLAN Inner VLAN Translated Outer VLAN Translated Inner VLAN
11 30 130 40
Table 1 Command output
Field |
Description |
Outer VLAN |
Original outer VLAN. This field indicates the original VLAN for one-to-one VLAN mapping and one-to-two VLAN mapping. This field displays N/A for zero-to-two VLAN mapping. |
Inner VLAN |
Original inner VLAN. This field displays N/A for one-to-one VLAN mapping and one-to-two VLAN mapping. This field displays N/A for zero-to-two VLAN mapping. |
Translated Outer VLAN |
Translated outer VLAN. This field indicates the translated VLAN for one-to-one VLAN mapping. This field indicates the SVLAN to be added for zero-to-two VLAN mapping. |
Translated Inner VLAN |
Translated inner VLAN. This field displays N/A for one-to-one VLAN mapping. This field indicates the CVLAN to be added for zero-to-two VLAN mapping. |
Related commands
vlan mapping
vlan mapping
Use vlan mapping to configure VLAN mapping on an interface.
Use undo vlan mapping to cancel the VLAN mapping configuration.
Syntax
vlan mapping { vlan-id translated-vlan vlan-id | nest single vlan-id-list nested-vlan vlan-id | tunnel outer-vlan-id inner-vlan-id translated-vlan outer-vlan-id inner-vlan-id }
undo vlan mapping { vlan-id translated-vlan vlan-id | all | nest single vlan-id-list nested-vlan vlan-id | tunnel outer-vlan-id inner-vlan-id translated-vlan outer-vlan-id inner-vlan-id }
Default
No VLAN mapping is configured on an interface.
Views
Layer 2 Ethernet interface view
Layer 2 aggregate interface view
Predefined user roles
network-admin
mdc-admin
Parameters
vlan-id translated-vlan vlan-id: Specifies the original VLAN and translated VLAN for a one-to-one VLAN mapping. The value range for the vlan-id argument is 1 to 4094. The original VLAN and the translated VLAN cannot be the same.
nest single vlan-id-list nested-vlan vlan-id: Specifies the CVLANs and the SVLAN for a one-to-two VLAN mapping. The vlan-id-list argument specifies a space-separated list of up to eight CVLAN IDs, each of which is in the range of 1 to 4094. The vlan-id argument specifies the SVLAN ID in the range of 1 to 4094.
tunnel outer-vlan-id inner-vlan-id translated-vlan outer-vlan-id inner-vlan-id: Specifies the original outer VLAN ID, original inner VLAN ID, translated outer VLAN ID, and translated inner VLAN ID for a two-to-two VLAN mapping. The value ranges for the outer-vlan-id argument and the inner-vlan-id argument are both 1 to 4094.
all: Deletes all VLAN mapping configurations from the interface.
Usage guidelines
The original and translated VLANs in VLAN mappings on an interface must meet the following requirements:
· Different types of VLAN mapping entries cannot include the same original VLANs or translated VLANs.
· Different one-to-one or two-to-two VLAN mapping entries cannot include the same translated VLANs. If you configure multiple one-to-one or two-to-two VLAN mapping entries for the same original VLANs, the most recent configuration takes effect.
The one-to-one VLAN mapping configuration takes effect only on the single-tagged packets.
The configuration restrictions between QinQ and VLAN mappings are as follows:
· Before you enable or disable QinQ on a port, you must remove all VLAN mappings on the port.
· You cannot configure two-to-two VLAN mappings on a QinQ-enabled port.
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 on the service provider network.
Examples
# Configure a one-to-one VLAN mapping on Ten-GigabitEthernet 3/0/1 to map VLAN 1 to VLAN 101.
<Sysname> system-view
[Sysname] interface ten-gigabitethernet 3/0/1
[Sysname-Ten-GigabitEthernet3/0/1] vlan mapping 1 translated-vlan 101
# Configure one-to-two VLAN mappings on Ten-GigabitEthernet 3/0/4 to add SVLAN tag 101 to packets carrying VLAN tag 80.
<Sysname> system-view
[Sysname] interface ten-gigabitethernet 3/0/4
[Sysname-Ten-GigabitEthernet3/0/4] vlan mapping nest single 80 nested-vlan 101
# Configure a two-to-two VLAN mapping on Ten-GigabitEthernet 3/0/5 to map SVLAN 101 and CVLAN 1 to SVLAN 201 and CVLAN 10.
<Sysname> system-view
[Sysname] interface ten-gigabitethernet 3/0/5
[Sysname-Ten-GigabitEthernet3/0/5] vlan mapping tunnel 101 1 translated-vlan 201 10
Related commands
display vlan mapping
vlan mapping untagged
Use vlan mapping untagged to configure zero-to-two VLAN mapping on an interface.
Use undo vlan mapping untagged to remove the zero-to-two VLAN mapping configuration.
Syntax
vlan mapping untagged nested-outer-vlan outer-vlan-id nested-inner-vlan inner-vlan-id
undo vlan mapping untagged
Default
No zero-to-two VLAN mapping is configured on an interface.
Views
Layer 2 Ethernet interface view
Layer 2 aggregate interface view
Predefined user roles
network-admin
mdc-admin
Parameters
nested-outer-vlan outer-vlan-id: Specifies the SVLAN ID in the range of 1 to 4094.
nested-inner-vlan inner-vlan-id: Specifies the CVLAN ID in the range of 1 to 4094.
Usage guidelines
This command takes effect only on ports that use VLAN 1 as the PVID.
Before you modify a zero-to-two VLAN mapping, first execute the undo vlan mapping untagged command to remove the previous configuration.
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.
Examples
# Configure a zero-to-two VLAN mapping on Ten-GigabitEthernet 3/0/1 to add SVLAN 200 and CVLAN 100 to untagged packets.
<Sysname> system-view
[Sysname] interface ten-gigabitethernet 3/0/1
[Sysname-Ten-GigabitEthernet3/0/1] vlan mapping untagged nested-outer-vlan 200 nested-inner-vlan 100
Related commands
display vlan mapping