- Table of Contents
-
- 02-Layer 2—LAN Switching Command Reference
- 00-Preface
- 01-MAC address table commands
- 02-Bulk interface commands
- 03-Ethernet interface commands
- 04-Ethernet link aggregation commands
- 05-Port isolation commands
- 06-VLAN commands
- 07-Loopback, null, and inloopback interface commands
- 08-VLAN mapping commands
- 09-VLAN termination commands
- 10-Loop detection commands
- 11-LLDP commands
- 12-L2PT commands
- 13-Service loopback group commands
- 14-Spanning tree commands
- 15-Cut-through Layer 2 forwarding commands
- Related Documents
-
Title | Size | Download |
---|---|---|
08-VLAN mapping commands | 81.81 KB |
Contents
VLAN mapping commands
display qinq
Use display qinq to display QinQ-enabled interfaces.
|
NOTE: This command is supported only in Release 3608 and later. |
Syntax
display qinq [ interface interface-type interface-number ]
Views
Any view
Predefined user roles
network-admin
network-operator
Parameters
interface interface-type interface-number: Specifies an interface by its type and number. If you do not specify an interface, this command displays all QinQ-enabled interfaces.
Usage guidelines
If QinQ is not enabled on any interfaces, this command does not provide any output.
Examples
# Enable QinQ on Hundredgige 1/0/1. Then, verify that QinQ is enabled on the interface.
<Sysname> system-view
[Sysname] interface hundredgige 1/0/1
[Sysname-Hundredgige1/0/1] qinq enable
[Sysname-Hundredgige1/0/1] display qinq interface hundredgige 1/0/1
Interface
Hundredgige1/0/1
# Enable QinQ on Hundredgige 1/0/1 and Hundredgige 1/0/2. Then, verify that QinQ is enabled on the interfaces.
<Sysname> system-view
[Sysname] interface hundredgige 1/0/1
[Sysname-Hundredgige1/0/1] qinq enable
[Sysname-Hundredgige1/0/1] quit
[Sysname] interface hundredgige 1/0/2
[Sysname-Hundredgige1/0/2] qinq enable
[Sysname-Hundredgige1/0/2] display qinq
Interface
Hundredgige1/0/1
Hundredgige1/0/2
Related commands
qinq enable
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
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 HundredGigE1/0/1:
Outer VLAN Inner VLAN Translated Outer VLAN Translated Inner VLAN
10 N/A 120 N/A
Outer VLAN Inner VLAN Nested VLAN
200 100 300
Interface HundredGigE1/0/2:
Outer VLAN Inner VLAN Translated Outer VLAN Translated Inner VLAN
1024-4094 N/A 100 N/A
Interface HundredGigE1/0/3:
Outer VLAN Inner VLAN Translated Outer VLAN Translated Inner VLAN
12 N/A 110 12
Interface HundredGigE1/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, many-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, many-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 and many-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 and many-to-one VLAN mapping. · This field indicates the CVLAN to be added for zero-to-two VLAN mapping. |
Nested VLAN |
Outermost VLAN for two-to-three VLAN mapping. |
Related commands
vlan mapping
qinq enable
Use qinq enable to enable QinQ on an interface.
Use undo qinq enable to disable QinQ on an interface.
Use display qinq to display QinQ-enabled interfaces.
|
NOTE: This command is supported only in Release 3608 and later. |
Syntax
qinq enable
undo qinq enable
Default
QinQ is disabled on interfaces.
Views
Layer 2 Ethernet interface view
Layer 2 aggregate interface view
Predefined user roles
network-admin
Usage guidelines
Use this command together with VLAN mapping. To configure VLAN mapping for the customer-side port, assign the port to the original VLANs and the translated VLANs. If you configure VLAN mapping on the customer-side port with QinQ enabled by using the qinq enable command, you do not need to assign the port to the original VLANs.
Do not execute the qinq enable command or its undo form on a interface if the interface has configured VLAN mapping. Otherwise, the command execution fails.
Examples
# Enable QinQ on Hundredgige1/0/1.
<Sysname> system-view
[Sysname] interface hundredgige 1/0/1
[Sysname-Hundredgige1/0/1] qinq enable
Related commands
display qinq
vlan mapping
vlan mapping double-tagged
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 { range vlan-range-list | single vlan-id-list } nested-vlan vlan-id | tunnel outer-vlan-id inner-vlan-id translated-vlan outer-vlan-id inner-vlan-id | uni { range vlan-range-list | single vlan-id-list } translated-vlan vlan-id }
undo vlan mapping { vlan-id translated-vlan vlan-id | all | nest { range vlan-range-list | single vlan-id-list } nested-vlan vlan-id | tunnel outer-vlan-id inner-vlan-id translated-vlan outer-vlan-id inner-vlan-id | uni { range vlan-range-list | single vlan-id-list } translated-vlan 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
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.
uni range vlan-range-list translated-vlan vlan-id: Specifies the original VLAN ranges and the translated VLAN for a many-to-one VLAN mapping on the customer-side port. The vlan-range-list argument specifies a space-separated list of up to 10 VLAN items. Each item specifies a VLAN ID or a range of VLAN IDs in the form of vlan-id1 to vlan-id2. The value range for VLAN IDs is 1 to 4094. The value for the vlan-id2 argument must be greater than the value for the vlan-id1 argument. The value range for the vlan-id argument is 1 to 4094. Different VLAN ranges cannot overlap. Any of the original VLANs cannot be the same as the translated VLAN.
uni single vlan-id-list translated-vlan vlan-id: Specifies the original VLANs and the translated VLAN for a many-to-one VLAN mapping on the customer-side port. The vlan-id-list argument specifies a space-separated list of up to 10 VLAN IDs, each of which is in the range of 1 to 4094. The value range for the vlan-id argument is 1 to 4094. Any of the original VLANs cannot be the same as the translated VLAN.
nest range vlan-range-list nested-vlan vlan-id: Specifies the CVLAN ranges and the SVLAN for a one-to-two VLAN mapping. The vlan-range-list argument specifies a space-separated list of up to 10 CVLAN items. Each item specifies a CVLAN ID or a range of CVLAN IDs in the format of vlan-id1 to vlan-id2. The value range for CVLAN IDs is 1 to 4094. The value for the vlan-id2 argument must be greater than the value for the vlan-id1 argument. Different CVLAN ranges cannot overlap. The vlan-id argument specifies the SVLAN ID in the range of 1 to 4094.
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 10 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
VLAN mapping takes effect only on VLAN-tagged packets received on an interface.
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, only the first configuration takes effect.
When you configure many-to-one VLAN mappings, following these restrictions and guidelines:
· An interface cannot be configured as the customer-side port and network-side port of many-to-one VLAN mapping at the same time.
· After you configure an interface as the network-side interface of many-to-one VLAN mapping, do not configure the other types of VLAN mapping on the interface.
· To ensure correct traffic forwarding from the service provider network to the customer network, do not configure many-to-one VLAN mappings together with the following features:
¡ uRPF.
¡ Disabling MAC address learning.
For more information about uRPF, see Security Configuration Guide. For more information about MAC address learning, see MAC address table configuration in Layer 2—LAN Switching Configuration Guide.
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 HundredGigE 1/0/1 to map VLAN 1 to VLAN 101.
<Sysname> system-view
[Sysname] interface hundredgige 1/0/1
[Sysname-HundredGigE1/0/1] vlan mapping 1 translated-vlan 101
# Configure many-to-one VLAN mappings on (HundredGigE 1/0/2) to map VLANs 1 through 50 and VLAN 80 to VLAN 101.
<Sysname> system-view
[Sysname] interface hundredgige 1/0/2
[Sysname-HundredGigE1/0/2] vlan mapping uni range 1 to 50 translated-vlan 101
[Sysname-HundredGigE1/0/2] vlan mapping uni single 80 translated-vlan 101
# Configure one-to-two VLAN mappings on HundredGigE 1/0/4 to add SVLAN tag 101 to packets carrying VLAN tags 1 through 10 and VLAN tag 80.
<Sysname> system-view
[Sysname] interface hundredgige 1/0/4
[Sysname-HundredGigE1/0/4] vlan mapping nest range 1 to 10 nested-vlan 101
[Sysname-HundredGigE1/0/4] vlan mapping nest single 80 nested-vlan 101
# Configure a two-to-two VLAN mapping on HundredGigE 1/0/5 to map SVLAN 101 and CVLAN 1 to SVLAN 201 and CVLAN 10.
<Sysname> system-view
[Sysname] interface hundredgige 1/0/5
[Sysname-HundredGigE1/0/5] vlan mapping tunnel 101 1 translated-vlan 201 10
Related commands
display vlan mapping
vlan mapping double-tagged
Use vlan mapping double-tagged to configure two-to-three VLAN mapping on an interface.
Use undo vlan mapping double-tagged to remove the two-to-three VLAN mapping configuration.
|
NOTE: This command is supported only in Release 3608 and later. |
Syntax
vlan mapping double-tagged { outer-vlan outer-vlan-id inner-vlan inner-vlan-id | outer-vlan-range vlan-id-list inner-vlan inner-vlan-id | outer-vlan outer-vlan-id inner-vlan-range vlan-id-list } nested-vlan nested-vlan
undo vlan mapping double-tagged { outer-vlan outer-vlan-id inner-vlan inner-vlan-id | outer-vlan-range vlan-id-list inner-vlan inner-vlan-id | outer-vlan outer-vlan-id inner-vlan-range vlan-id-list } nested-vlan nested-vlan
Default
No two-to-three VLAN mapping is configured on an interface.
Views
Layer 2 Ethernet interface view
Layer 2 aggregate interface view
Predefined user roles
network-admin
Parameters
outer-vlan outer-vlan-id: Specifies the original SVLAN ID in the range of 1 to 4094.
outer-vlan-range vlan-id-list: Specifies a range of original SVLAN IDs in the format of vlan-id1 to vlan-id2. The value range for SVLAN IDs is 1 to 4094. The value for the vlan-id2 argument must be greater than the value for the vlan-id1 argument.
inner-vlan inner-vlan-id: Specifies the original CVLAN ID in the range of 1 to 4094.
inner-vlan-range vlan-id-list: Specifies a range of original CVLAN IDs in the format of vlan-id1 to vlan-id2. The value range for CVLAN IDs is 1 to 4094. The value for the vlan-id2 argument must be greater than the value for the vlan-id1 argument.
nested-vlan nested-vlan: Specifies the outermost VLAN ID in the range of 1 to 4094.
Usage guidelines
A two-to-three VLAN mapping cannot have the same original SVLAN and CVLAN as those of an existing two-to-two VLAN mapping.
Two-to-three VLAN mappings that have the same SVLAN and CVLAN cannot be configured with different outermost VLANs. To modify the outermost VLAN for a two-to-three VLAN mapping on an interface, first remove the mapping by using the undo command, and then configure the new VLAN mapping.
As a best practice, set the MTU to a minimum of 1508 bytes for ports on the forwarding path of the triple-tagged packet in the service provider network.
Examples
# Configure a two-to-three VLAN mapping on HundredGigE 1/0/1 to add the outermost VLAN 300 to double-tagged packets with the SVLAN 200 and CVLAN 100.
<Sysname> system-view
[Sysname] interface hundredgige 1/0/1
[Sysname-HundredGigE1/0/1]vlan mapping double-tagged outer-vlan 200 inner-vlan 100 nested-vlan 300
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.
|
NOTE: This command is supported only in Release 3608 and later. |
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
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 HundredGigE 1/0/1 to add SVLAN 200 and CVLAN 100 to untagged packets.
<Sysname> system-view
[Sysname] interface hundredgige 1/0/1
[Sysname-HundredGigE1/0/1] vlan mapping untagged nested-outer-vlan 200 nested-inner-vlan 100
Related commands
display vlan mapping