04-Layer 2 - LAN Switching Command Reference

HomeSupportSwitchesS7500E SeriesReference GuidesCommand ReferencesH3C S7500E Switch Series Command References-Release758X-6W10004-Layer 2 - LAN Switching Command Reference
08-VLAN mapping commands
Title Size Download
08-VLAN mapping commands 74.00 KB

VLAN mapping commands

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-GigabitEthernet1/0/2:

  Outer VLAN    Inner VLAN    Translated Outer VLAN    Translated Inner VLAN

  1024-4094     N/A           100                      N/A

 

Interface Ten-GigabitEthernet1/0/5:

  Outer VLAN    Inner VLAN    Translated Outer VLAN    Translated Inner VLAN

  50            60            70                       N/A

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, two-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, two-to-one VLAN mapping, and many-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 { range vlan-range-list | single vlan-id-list } nested-vlan vlan-id [ dot1p priority ] | nni | 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 [ enhanced ] }

undo vlan mapping { vlan-id translated-vlan vlan-id | all | nest { range vlan-range-list | single vlan-id-list } nested-vlan vlan-id [ dot1p priority ] | nni | 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 [ enhanced ] }

Default

No VLAN mapping is configured on an interface.

Views

Layer 2 Ethernet interface view

Layer 2 aggregate interface view

OLT port view

ONU port 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.

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 in common mode on the customer-side port. The vlan-range-list argument specifies a space-separated list of up to eight 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 in common mode on the customer-side port. The vlan-id-list argument specifies a space-separated list of up to eight 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.

uni range vlan-range-list translated-vlan vlan-id enhanced: Specifies the original VLAN ranges and the translated VLAN for a many-to-one VLAN mapping in enhanced mode on the customer-side port. The vlan-range-list argument specifies a space-separated list of up to eight 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 enhanced: Specifies the original VLANs and the translated VLAN for a many-to-one VLAN mapping in enhanced mode on the customer-side port. The vlan-id-list argument specifies a space-separated list of up to eight 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.

nni: Configures the network-side port to use the original VLAN tags of the many-to-one mapping to replace the VLAN tags of the packets destined for the user network.

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 eight 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 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.

dot1p priority: Specifies the 802.1p priority in the SVLAN tag added by a one-to-two VLAN mapping, in the range of 0 to 7. The default value is 0. A greater value represents a higher priority.

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

Only OLT ports support the dot1p priority option.

ONU ports support only one-to-one VLAN mapping.

VLAN mapping takes effect only on VLAN-tagged packets received on an interface.

 

The original and translated VLANs in VLAN mappings on the same 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 translated CVLAN and SVLAN of a two-to-two VLAN mapping cannot be the same as the original CVLAN and SVLAN of a two-to-one VLAN mapping.

If an 802.1p priority is specified in a one-to-two VLAN mapping, you must specify the same 802.1p priority for this mapping when you cancel the mapping configuration.

Many-to-one VLAN mapping supports the following modes:

·     Common mode—Applicable to scenarios where only Layer 3 packets are received on the network-side port. The device finds matching original VLANs for the downlink traffic by looking up the ARP snooping table or DHCP snooping table.

·     Enhanced mode—Applicable to scenarios where both Layer 2 and Layer 3 packets are received on the network-side port. The original VLAN translation for Layer 3 downlink traffic is the same as the original VLAN translation in common mode. The device uses the automatically issued ACL rules to determine original VLANs for Layer 2 downlink traffic.

When you configure many-to-one VLAN mappings, following these restrictions and guidelines:

·     For many-to-one VLAN mapping in common mode to take effect, configure many-to-one VLAN mapping in pairs on both the customer side and the network side. When you configure many-to-one VLAN mapping in enhanced mode, configure many-to-one VLAN mapping in pairs on both the customer side and the network side if the network-side port receives both Layer 2 and Layer 3 packets. If the network-side port receives only Layer 2 packets, the network-side configuration is not required.

·     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 uRPF. For more information about uRPF, see Security Configuration Guide.

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.

If you use both transparent VLANs and VLAN mappings on an interface, the transparent VLANs cannot be the following VLANs:

·     Original or translated VLANs of one-to-one, many-to-one, and one-to-two VLAN mappings.

·     Original or translated outer VLANs of two-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 on the service provider network.

Examples

# Configure a one-to-one VLAN mapping on Ten-GigabitEthernet 1/0/1 to map VLAN 1 to VLAN 101.

<Sysname> system-view

[Sysname] interface ten-gigabitethernet 1/0/1

[Sysname-Ten-GigabitEthernet1/0/1] vlan mapping 1 translated-vlan 101

# Configure many-to-one VLAN mappings in common mode on the customer-side port (Ten-GigabitEthernet 1/0/2) to map VLANs 1 through 50 and VLAN 80 to VLAN 101. Configure the network-side port (Ten-GigabitEthernet 1/0/3) to use the original VLAN tags of the many-to-one mappings to replace the VLAN tags of the packets destined for the user network.

<Sysname> system-view

[Sysname] interface ten-gigabitethernet 1/0/2

[Sysname-Ten-GigabitEthernet1/0/2] vlan mapping uni range 1 to 50 translated-vlan 101

[Sysname-Ten-GigabitEthernet1/0/2] vlan mapping uni single 80 translated-vlan 101

[Sysname-Ten-GigabitEthernet1/0/2] quit

[Sysname] interface ten-gigabitethernet 1/0/3

[Sysname-Ten-GigabitEthernet1/0/3] vlan mapping nni

# Configure many-to-one VLAN mappings in enhanced mode on the customer-side port (Ten-GigabitEthernet 1/0/2) to map VLANs 60 through 70 to VLAN 102.

<Sysname> system-view

[Sysname] interface ten-gigabitethernet 1/0/2

[Sysname-Ten-GigabitEthernet1/0/2] vlan mapping uni range 60 to 70 translated-vlan 102 enhanced

# Configure one-to-two VLAN mappings on Ten-GigabitEthernet 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 ten-gigabitethernet 1/0/4

[Sysname-Ten-GigabitEthernet1/0/4] vlan mapping nest range 1 to 10 nested-vlan 101

[Sysname-Ten-GigabitEthernet1/0/4] vlan mapping nest single 80 nested-vlan 101

# Configure a two-to-two VLAN mapping on Ten-GigabitEthernet 1/0/5 to map SVLAN 101 and CVLAN 1 to SVLAN 201 and CVLAN 10.

<Sysname> system-view

[Sysname] interface ten-gigabitethernet 1/0/5

[Sysname-Ten-GigabitEthernet1/0/5] vlan mapping tunnel 101 1 translated-vlan 201 10

Related commands

display vlan mapping

vlan mapping egress

Use vlan mapping egress to configure a two-to-one VLAN mapping on an interface.

Use undo vlan mapping egress to remove the two-to-one VLAN mapping configuration.

Syntax

vlan mapping egress outer-vlan outer-vlan-id inner-vlan inner-vlan-id translated-vlan vlan-id

undo vlan mapping egress outer-vlan outer-vlan-id inner-vlan inner-vlan-id translated-vlan vlan-id

Default

No two-to-one VLAN mapping is configured on an interface.

Views

OLT port view

Layer 2 aggregate interface view

Predefined user roles

network-admin

mdc-admin

Parameters

outer-vlan outer-vlan-id: Specifies the original SVLAN ID in the range of 1 to 4094.

inner-vlan inner-vlan-id: Specifies the original CVLAN ID in the range of 1 to 4094.

translated-vlan vlan-id: Specifies the translated VLAN ID in the range of 1 to 4094.

Usage guidelines

After you configure a two-to-one VLAN mapping, the device will replace original SVLAN and CVLAN tags of the matching double-tagged packets with one translated VLAN tag. When the device receives packets with the translated VLAN tag, it does not replace the VLAN tag with the original VLAN tags.

On an interface, the original CVLAN and SVLAN of a two-to-one VLAN mapping cannot be the same as the translated CVLAN and SVLAN of a two-to-two or zero-to-two VLAN mapping.

You cannot specify multiple translated CVLANs for the same original CVLAN and SVLAN on an interface. To modify an existing two-to-one VLAN mapping on an interface, you must execute the undo vlan mapping egress command to remove it first and then configure a new mapping.

Examples

# Configure a two-to-one VLAN mapping on OLT 1/0/1 to replace SVLAN 20 and CVLAN 30 of the double-tagged packets with the translated VLAN 40.

<Sysname> system-view

[Sysname] interface olt 1/0/1

[Sysname-Olt1/0/1] vlan mapping egress outer-vlan 20 inner-vlan 30 translated-vlan 40

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

OLT port 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

Before you modify a zero-to-two VLAN mapping, first execute the undo vlan mapping untagged command to remove the previous configuration.

On an interface, the translated CVLAN and SVLAN of a zero-to-two VLAN mapping cannot be the same as the original CVLAN and SVLAN of a two-to-one VLAN mapping.

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 1/0/1 to add SVLAN 200 and CVLAN 100 to untagged packets.

<Sysname> system-view

[Sysname] interface ten-gigabitethernet 1/0/1

[Sysname-Ten-GigabitEthernet1/0/1] vlan mapping untagged nested-outer-vlan 200 nested-inner-vlan 100

Related commands

display vlan mapping

  • Cloud & AI
  • InterConnect
  • Intelligent Computing
  • Security
  • SMB Products
  • Intelligent Terminal Products
  • Product Support Services
  • Technical Service Solutions
All Services
  • Resource Center
  • Policy
  • Online Help
All Support
  • Become a Partner
  • Partner Resources
  • Partner Business Management
All Partners
  • Profile
  • News & Events
  • Online Exhibition Center
  • Contact Us
All About Us
新华三官网