No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

S12700 V200R013C00 Command Reference

This document describes all the configuration commands of the device, including the command function, syntax, parameters, views, default level, usage guidelines, examples, and related commands.
Rate and give feedback:
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
VLAN Mapping Configuration Commands

VLAN Mapping Configuration Commands

Command Support

Commands provided in this section and all the parameters in the commands are supported by all switch models by default, unless otherwise specified. For details, see specific commands.

port vlan-mapping 8021p

Function

The port vlan-mapping 8021p command configures the 802.1p priority-based VLAN mapping function on the primary interface.

The undo port vlan-mapping 8021p command disables the 802.1p priority-based VLAN mapping function on the primary interface.

By default, the 802.1p priority-based VLAN mapping function is not configured on the primary interface.

Format

port vlan-mapping 8021p 8021p-value1 map-vlan vlan-id [ remark-8021p 8021p-value2 ]

undo port vlan-mapping 8021p 8021p-value1 [ map-vlan vlan-id ]

undo port vlan-mapping all

Parameters

Parameter

Description

Setting

8021p 8021p-value1

Specifies 802.1p priority of the outer VLAN.

The value is an integer that ranges from 0 to 7. A larger value indicates a higher priority.

map-vlan vlan-id

Specifies the VLAN ID mapped to the original VLAN ID.

The value is an integer that ranges from 1 to 4094.

remark-8021p 8021p-value2

Specifies the re-marked 802.1p priority of the mapped tag.

The 802.1p priority is specified by a 3-bit PRI (priority) field in an 802.1Q packet. When congestion occurs on a switch, packets with a higher priority are sent first.

If the parameter remark-8021p is configured, the interface changes the value of 8021p-value1 in the packet to the value of 8021p-value2 specified by users.

The value is an integer that ranges from 0 to 7. A larger value indicates a higher priority.

all

Specifies all VLAN mapping entries configured on the primary interface.

-

Views

GE interface view, XGE interface view, 40GE interface view, 100GE interface view, Eth-Trunk interface view, port group view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

After this command is executed, the interface maps the VLAN ID in a received tagged packet to an S-VLAN ID based on the 802.1p priority of the packet and changes the 802.1p priority in the mapped packet.

Precautions

802.1p priority-based VLAN mapping takes effect only to packets on inbound interfaces.

Priority-based VLAN mapping can be enabled only on a trunk or hybrid interface.

The SA cards of S series do not support this command.

Example

# Configure 802.1p priority-based VLAN mapping on the GE1/0/1 and map the VLAN ID of a packet whose 802.1p priority is 5 to 200.

<HUAWEI> system-view
[HUAWEI] interface gigabitethernet1/0/1
[HUAWEI-GigabitEthernet1/0/1] port link-type hybrid
[HUAWEI-GigabitEthernet1/0/1] port vlan-mapping 8021p 5 map-vlan 200

port vlan-mapping vlan 8021p

Function

The port vlan-mapping vlan 8021p command configures VLAN mapping based on the VLAN ID and 802.1p priority on the primary interface.

The undo port vlan-mapping vlan 8021p command disables VLAN mapping based on the VLAN ID and 802.1p priority on the primary interface.

By default, VLAN mapping based on the VLAN ID and 802.1p priority is not configured on the primary interface.

Format

port vlan-mapping vlan vlan-id1 [ to vlan-id2 ] 8021p 8021p-value1 [ to 8021p-value2 ] map-vlan vlan-id3 [ remark-8021p 8021p-value3 ]

undo port vlan-mapping vlan vlan-id1 [ to vlan-id2 ] [ 8021p 8021p-value1 [ to 8021p-value2 ] ] [ map-vlan vlan-id3 ]

undo port vlan-mapping all

Parameters

Parameter

Description

Setting

vlan vlan-id1 [ to vlan-id2 ]

Specifies the VLAN ID in a received packet.
  • vlan-id1: specifies the start value of the VLAN ID range of the tag.
  • to vlan-id2: specifies the end value of the VLAN ID range of the tag. The value of vlan-id2 must be greater than that of vlan-id1.

The value of vlan-id1 or vlan-id2 is an integer that ranges from 1 to 4094.

8021p 8021p-value1 [ to 8021p-value2 ]

Specifies the range of 802.1p priorities in the VLAN tags of a received packet.
  • 8021p-value1: specifies the lower threshold of the 802.1p priority value.
  • to 8021p-value2: specifies the upper threshold of the 802.1p priority value. The value of 8021p-value2 must be greater than that of 8021p-value1.

The value of 8021p-value1 or 8021p-value2 is an integer that ranges from 1 to 7.

map-vlan vlan-id3

Specifies the VLAN ID mapped to the original VLAN ID.

The value is an integer that ranges from 1 to 4094.

remark-8021p 8021p-value3

Specifies the re-marked 802.1p priority of the mapped tag.

The 802.1p priority is specified by a 3-bit PRI (priority) field in an 802.1Q packet. When congestion occurs on a switch, packets with a higher priority are sent first.

If the parameter remark-8021p is configured, the interface changes the 802.1p priority in the packet to the value of 8021p-value3 specified by users.

The value is an integer that ranges from 0 to 7. A larger value indicates a higher priority.

all

Specifies all VLAN mapping entries configured on the primary interface.

-

Views

GE interface view, XGE interface view, 40GE interface view, 100GE interface view, Eth-Trunk interface view, port group view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

After this command is executed, the interface maps the VLAN ID in the tagged packets that are received to an S-VLAN ID based on the VLAN ID and 802.1p priority of the packets and changes the 802.1p priority after mapping.

Precautions

VLAN mapping based on the VLAN ID and 802.1p priority is valid only to packets on inbound interfaces.

VLAN mapping based on the VLAN ID and 802.1p priority can be enabled only on a trunk or hybrid interface.

X series cards and ACU2 series cards do not support VLAN mapping based on multiple 802.1p priorities. In earlier versions, VLAN mapping based on multiple 802.1p priorities can be configured and the configuration exists in the configuration file, but the configuration does not take effect. After the switch is upgraded to the current version, the configuration still exists in the configuration file but is invalid. You can run the undo command to delete the configuration.

Example

# Configure VLAN mapping based on the VLAN ID and 802.1p priority on the GE1/0/1 and map the packet whose VLAN ID is 100 and 802.1p priority is 5 to the packet whose VLAN ID is 200, change the 802.1p priority after mapping to 1 before the packet is forwarded.

<HUAWEI> system-view
[HUAWEI] interface gigabitethernet1/0/1
[HUAWEI-GigabitEthernet1/0/1] port link-type hybrid
[HUAWEI-GigabitEthernet1/0/1] port vlan-mapping vlan 100 8021p 5 map-vlan 200 remark-8021p 1

port vlan-mapping vlan inner-vlan

Function

The port vlan-mapping vlan inner-vlan command enables the interface to replace the outer VLAN tag or both VLAN tags of a double-tagged packet.

The undo port vlan-mapping vlan inner-vlan command disables the interface to replace the outer VLAN tag or both VLAN tags of a double-tagged packet.

By default, the interface does not map tags of packets.

Format

port vlan-mapping vlan vlan-id1 inner-vlan vlan-id2 [ to vlan-id3 ] map-vlan vlan-id4 [ remark-8021p 8021p-value ]

port vlan-mapping vlan vlan-id1 inner-vlan vlan-id2 map-vlan vlan-id4 [ map-inner-vlan vlan-id5 ] [ remark-8021p 8021p-value ]

undo port vlan-mapping { all | vlan vlan-id1 inner-vlan vlan-id2 [ to vlan-id3 ] [ map-vlan vlan-id4 ] }

undo port vlan-mapping vlan vlan-id1 inner-vlan vlan-id2 map-vlan vlan-id4 map-inner-vlan vlan-id5

Parameters

Parameter

Description

Setting

vlan vlan-id1

Specifies the VLAN ID of the outer tag in a received packet.

The value is an integer that ranges from 1 to 4094.

inner-vlan vlan-id2 [ to vlan-id3 ]

Specifies the VLAN ID of the inner tag in a received packet.
  • vlan-id2: specifies the start value of the VLAN ID range of the inner tag in the received packet.
  • vlan-id3: specifies the end value of the VLAN ID range of the inner tag in the received packet. vlan-id3 is optional.
The value of vlan-id3 must be greater than that of vlan-id2.

The value of vlan-id2 or vlan-id3 is an integer that ranges from 1 to 4094.

map-vlan vlan-id4

Specifies the VLAN ID that replaces the VLAN ID of the outer tag in a packet.

The value is an integer that ranges from 1 to 4094.

map-inner-vlan vlan-id5

Specifies the VLAN ID that replaces the VLAN ID of the inner tag in a packet.

If the parameter map-inner-vlan is configured, the interface maps the VLAN ID of the inner tag in the packet to the value of vlan-id5 specified by users.

The value is an integer that ranges from 1 to 4094.

remark-8021p 8021p-value

Specifies the re-marked 802.1p priority of the outer tag.

The 802.1p priority is specified by a 3-bit PRI (priority) field in an 802.1Q packet. When congestion occurs on a switch, packets with a higher priority are sent first.

If the parameter remark-8021p is configured, the interface changes the 802.1p priority in the packet to the value of 8021p-value specified by users.

The value is an integer that ranges from 0 to 7. A larger value indicates a higher priority.

all

Specifies all VLAN mapping entries configured on the primary interface.

-

Views

GE interface view, XGE interface view, 40GE interface view, 100GE interface view, Eth-Trunk interface view, port group view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

When provider edges (PEs) receive double-tagged packets, the inner tag in the packets indicates the user, and the outer tag indicates the service. To differentiate services entering the ISP network, you can configure 2 to 1 VLAN mapping on PEs. To allow users to communicate with each other, the interface maps tags of different services to outer tags, and inner tags are transparently transmitted to the ISP network.

This command allows an interface to map the VLAN ID in a tagged packet to an S-VLAN ID.

Precautions

VLAN mapping can be configured only on a trunk or hybrid interface, and the interface must be added to the map-vlan.

When inner-vlan is set to a VLAN ID range, the interface cannot replace the VLAN ID of the inner tag in packets.

When the VLAN tags of a packet match both a single-tag VLAN mapping entry and a double-tag VLAN mapping entry, the double-tag VLAN mapping takes effect.

Example

# Configure 2 to 1 VLAN mapping, map VLAN 10 in the outer tag of a packet (with VLAN 10 in the outer tag and VLAN 20 in the inner tag) to VLAN 100.

<HUAWEI> system-view
[HUAWEI] interface gigabitethernet1/0/1
[HUAWEI-GigabitEthernet1/0/1] port link-type trunk
[HUAWEI-GigabitEthernet1/0/1] port trunk allow-pass vlan 100
[HUAWEI-GigabitEthernet1/0/1] port vlan-mapping vlan 10 inner-vlan 20 map-vlan 100

port vlan-mapping vlan map-vlan

Function

The port vlan-mapping vlan map-vlan command enables the interface to map single tags of packets.

The undo port vlan-mapping command cancels the interface to map single tags of packets.

By default, the interface does not map tags of packets.

Format

port vlan-mapping vlan vlan-id1 [ to vlan-id2 ] map-vlan vlan-id3 [ remark-8021p 8021p-value ]

undo port vlan-mapping { all | vlan vlan-id1 [ to vlan-id2 ] [ map-vlan vlan-id3 ]}

Parameters

Parameter

Description

Setting

vlan vlan-id1 [ to vlan-id2 ]

Specifies the VLAN ID in a received packet.
  • vlan-id1: specifies the start value of the VLAN ID range of the tag.
  • to vlan-id2: specifies the end value of the VLAN ID range of the tag. The value of vlan-id2 must be greater than that of vlan-id1.

The value of vlan-id1 or vlan-id2 is an integer that ranges from 1 to 4094.

map-vlan vlan-id3

Specifies the VLAN ID in the mapped tag.

The value is an integer that ranges from 1 to 4094.

remark-8021p 8021p-value

Specifies the re-marked 802.1p priority of the mapped tag.

The 802.1p priority is specified by a 3-bit PRI (priority) field in an 802.1Q packet. When congestion occurs on a switch, packets with a higher priority are sent first.

If the parameter remark-8021p is configured, the interface changes the 802.1p priority in the packet to the value of 8021p-value specified by users.

The value is an integer that ranges from 0 to 7. A larger value indicates a higher priority.

all

Specifies all VLAN mapping entries configured on the interface.

-

Views

GE interface view, XGE interface view, 40GE interface view, 100GE interface view, Eth-Trunk interface view, port group view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

VLAN mapping, also called VLAN translation, implements communication between different VLANs. VLAN mapping takes effect after outbound interfaces on a switch forward the packets received by inbound interfaces. This command allows an interface to map the VLAN ID in a tagged packet to an S-VLAN ID.

After the port vlan-mapping vlan vlan-id1 [ to vlan-id2 ] map-vlan vlan-id3 [ remark-8021p 8021p-value ] command is used on an interface, vlan-id1 [ to vlan-id2 ] is mapped to vlan-id3 in the inbound direction, and vlan-id3 is mapped to vlan-id1 [ to vlan-id2 ] in the outbound direction.

Precautions

VLAN mapping can be configured only on a trunk or hybrid interface, and the interface must be added to the translated VLAN. The interfaces on the SA cards of S series must be added to the translated VLAN in tagged mode.

When N:1 VLAN mapping is configured (VLAN IDs can be incontiguous before mapping), the interface needs to be added to these VLANs in tagged mode, and the VLAN specified by map-vlan cannot be a VLAN corresponding to a VLANIF interface.

N:1 VLAN mapping takes effect only when the packets with original VLANs are sent first.

SA boards of S series, and X series cards do not support N:1 VLAN mapping.

If the VLANs before and after mapping are the same, return packets may fail to be forwarded. To solve the problem, map the VLAN to itself. For example, packets with VLAN 10 and VLAN 20 (before mapping) need to be sent to the network side and S-VLAN 20 (after mapping) is assigned to users, run the port vlan-mapping vlan 10 map-vlan 20 command. To ensure that return packets are correctly forwarded, run the port vlan-mapping vlan 20 map-vlan 20 command.

Example

# Configure VLAN mapping on the GE1/0/1 and map VLAN 100 of a received packet to VLAN 10 before the packet is forwarded.

<HUAWEI> system-view
[HUAWEI] interface gigabitethernet1/0/1
[HUAWEI-GigabitEthernet1/0/1] port link-type trunk
[HUAWEI-GigabitEthernet1/0/1] port trunk allow-pass vlan 10
[HUAWEI-GigabitEthernet1/0/1] port vlan-mapping vlan 100 map-vlan 10

remark cvlan-id

Function

The remark cvlan-id command configures an action of re-marking the inner VLAN tag in QinQ packets in a traffic behavior.

The undo remark cvlan-id command deletes the configuration.

By default, an action of re-marking the inner VLAN tag in QinQ packets is not configured in a traffic behavior.

Format

remark cvlan-id cvlan-id

undo remark cvlan-id

Parameters

Parameter

Description

Value

cvlan-id

Specifies the inner VLAN tag of QinQ packets to be re-marked.

The value is an integer that ranges from 1 to 4094.

Views

Traffic behavior view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

You can use the remark cvlan-id command to re-mark the inner VLAN tag in QinQ packets in a traffic behavior so that the downstream device can identify packets and provide differentiated services.

Follow-up Procedure

Run the traffic policy command to create a traffic policy and run the classifier behavior command in the traffic policy view to bind the traffic classifier to the traffic behavior containing the action of re-marking the inner VLAN tag in QinQ packets.

Precautions

The remark cvlan-id command is valid for only QinQ packets that carry two or more layers of tags.

When a traffic classifier defines if-match ipv6 acl { acl-number | acl-name, remark cvlan-id cannot be configured on the X series cards.

After the remark cvlan-id, remark 8021p, add-tag vlan-id, and remark vlan-id commands are used, the system modifies VLAN tags of packets according to the configuration. These actions are called VLAN-based actions.

You must configure the VLAN-based action and non-VLAN-based action in different traffic behaviors bound to the same traffic policy.

If you run the remark cvlan-id command in the same traffic classifier view multiple times, only the latest configuration takes effect.

Example

# Re-mark the inner VLAN tag in packets with 5 in the traffic behavior b1.

<HUAWEI> system-view
[HUAWEI] traffic behavior b1
[HUAWEI-behavior-b1] remark cvlan-id 5

remark vlan-id

Function

The remark vlan-id command configures an action of re-marking the VLAN tag in VLAN packets in a traffic behavior.

The undo remark vlan-id command deletes the configuration.

By default, an action of re-marking the VLAN tag in VLAN packets is not configured in a traffic behavior.

Format

remark vlan-id vlan-id

undo remark vlan-id

Parameters

Parameter

Description

Value

vlan-id

Specifies the VLAN tag of packets in a VLAN.

The value is an integer that ranges from 1 to 4094.

Views

Traffic behavior view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

You can use the remark vlan-id command to re-mark the VLAN tag in VLAN packets in a traffic behavior so that the downstream device can identify packets and provide differentiated services.

The remark vlan-id command re-marks only the outer VLAN tag of double-tagged packets.

Follow-up Procedure

Run the traffic policy command to create a traffic policy and run the classifier behavior command in the traffic policy view to bind the traffic classifier to the traffic behavior containing VLAN tag re-marking.

Precautions

If a traffic policy containing remark vlan-id is applied to the outbound direction on an interface, the VLAN that the interface belongs to must work in tag mode.

When a traffic classifier defines if-match ipv6 acl { acl-number | acl-name, remark vlan-id cannot be configured on the X series cards.

After the remark vlan-id, remark 8021p, remark cvlan-id command is used, the system modifies the VLAN tag of packets based on the device configuration. The behavior configured through these commands is called VLAN-based action.

To perform VLAN-based actions and non-VLAN-based actions in an upstream traffic policy, you need to configure VLAN-based actions and non-VLAN-based actions in different traffic behaviors.

If you run the remark vlan-id command in the same traffic behavior view multiple times, only the latest configuration takes effect.

Example

# Re-mark the VLAN tag of packets in a VLAN to 200.

<HUAWEI> system-view
[HUAWEI] traffic behavior tb
[HUAWEI-behavior-tb] remark vlan-id 200
Translation
Download
Updated: 2019-04-09

Document ID: EDOC1100065659

Views: 126223

Downloads: 88

Average rating:
This Document Applies to these Products
Related Version
Related Documents
Share
Previous Next