S1720, S2700, S5700, and S6720 V200R011C10 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.
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.
VLAN Mapping Configuration Commands
port vlan-mapping ingress
Function
The port vlan-mapping ingress command configures VLAN mapping in the inbound direction.
The undo port vlan-mapping ingress command cancels the configuration.
By default, VLAN mapping is valid for both inbound and outbound directions.
Views
Ethernet interface view, GE interface view, 40GE interface view, MultiGE interface view, Eth-Trunk interface view, port group view
Usage Guidelines
Usage Scenario
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.
On the S1720GFR, S1720GW, S1720GWR, S1720X, S1720GW-E, S1720GWR-E, S1720X-E, S2750EI, S2720EI, S5700S-LI, S5700LI, S5720LI, S5720S-LI, S6720LI, S6720S-LI, S5710-X-LI, S5730SI, S5730S-EI, S6720SI, S6720S-SI, S5720SI, and S5720S-SI, outbound VLAN mapping cannot be used with a traffic policy containing CAR. You can run the port vlan-mapping ingress command to configure VLAN mapping in the inbound direction. The interface configured with VLAN mapping maps vlan-id1 [ to vlan-id2 ] to vlan-id3 in the inbound direction, and does not map vlan-id3 to vlan-id1 [ to vlan-id2 ] in the outbound direction.
Prerequisites
The qinq vlan-translation enable command has been executed.
Precautions
To make VLAN mapping take effect in the inbound direction only, configure the port vlan-mapping ingress and port vlan-mapping vlan map-vlan commands in sequence. To delete the VLAN mapping configuration, delete the port vlan-mapping vlan map-vlan and port vlan-mapping ingress commands in sequence.
Example
# Configure VLAN mapping in the inbound direction on GE0/0/1 to map VLAN 100 in received frames to VLAN 10.
<HUAWEI> system-view [HUAWEI] interface gigabitethernet0/0/1 [HUAWEI-GigabitEthernet0/0/1] port link-type trunk [HUAWEI-GigabitEthernet0/0/1] port trunk allow-pass vlan 10 [HUAWEI-GigabitEthernet0/0/1] qinq vlan-translation enable [HUAWEI-GigabitEthernet0/0/1] port vlan-mapping ingress [HUAWEI-GigabitEthernet0/0/1] port vlan-mapping vlan 100 map-vlan 10
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.
|
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
Ethernet interface view, GE interface view, XGE interface view, 40GE interface view, Eth-Trunk interface view, port group view
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 in tagged mode.
When inner-vlan is set to a VLAN ID range, the interface cannot replace the VLAN ID of the inner tag in packets.
If VLAN mapping and DHCP are configured on the same interface, the interface must be added to the original VLANs (VLANs before mapping) in tagged mode.
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 gigabitethernet0/0/1 [HUAWEI-GigabitEthernet0/0/1] port link-type trunk [HUAWEI-GigabitEthernet0/0/1] port trunk allow-pass vlan 100 [HUAWEI-GigabitEthernet0/0/1] qinq vlan-translation enable [HUAWEI-GigabitEthernet0/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 ]}
S5720HI does not support the N:1 VLAN Mapping.
Parameters
Parameter |
Description |
Setting |
---|---|---|
vlan vlan-id1 [ to vlan-id2 ] |
Specifies the VLAN ID in a received packet.
|
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
Ethernet interface view, GE interface view, XGE interface view, 40GE interface view, MultiGE interface view, Eth-Trunk interface view, port group view
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 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.
If VLAN mapping and DHCP are configured on the same interface, it is recommended to add the interface to the original VLANs (VLANs before mapping) in tagged mode.
N:1 VLAN mapping takes effect only when the packets with original VLANs are sent first. In this case, if packets are sent from the S-VLAN first, the C-VLAN to be mapped cannot be determined because no ACL entry is generated. As a result, the packets are discarded.
N:1 VLAN mapping is not supported in a stack scenario.
A maximum of 16 original VLAN IDs can be specified on an interface.
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 GE0/0/1 and map VLAN 100 of a received packet to VLAN 10 before the packet is forwarded.
<HUAWEI> system-view [HUAWEI] interface gigabitethernet0/0/1 [HUAWEI-GigabitEthernet0/0/1] port link-type trunk [HUAWEI-GigabitEthernet0/0/1] port trunk allow-pass vlan 10 [HUAWEI-GigabitEthernet0/0/1] qinq vlan-translation enable [HUAWEI-GigabitEthernet0/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.
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.
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.
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.
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 the remark vlan-id command is used on an inbound interface, on the S5720HI, S5720EI, S6720EI, and S6720S-EI, add the outbound interfaces to the replaced VLAN and the original VLAN. Otherwise, packets cannot be forwarded correctly. On other models, add the inbound and outbound interfaces to the replaced VLAN and the original VLAN. Otherwise, packets cannot be forwarded correctly.
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.
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.