The rewrite map command sets a traffic behavior to "map" for packets that an EVC Layer 2 sub-interface receives.
The undo rewrite command deletes a traffic behavior configured on an EVC Layer 2 sub-interface.
By default, no traffic behavior is configured on an EVC Layer 2 sub-interface. The EVC Layer 2 sub-interface transparently forwards all received packets without processing them.
rewrite map offset { increase | decrease } offset-vid
rewrite map { 1-to-1 | 2-to-1 } vid pe-vid
rewrite map { 1-to-1 | 2-to-1 } vid pe-vid 8021p pe-8021p-value
rewrite map { 1-to-2 | 2-to-2 } vid pe-vid ce-vid ce-vid
rewrite map { 1-to-2 | 2-to-2 } vid pe-vid [ 8021p pe-8021p-value ] ce-vid ce-vid ce-8021p ce-8021p-value
rewrite map { 1-to-2 | 2-to-2 } vid pe-vid 8021p pe-8021p-value ce-vid ce-vid [ ce-8021p ce-8021p-value ]
rewrite map single outbound
undo rewrite
undo rewrite map single outbound
Parameter | Description | Value |
---|---|---|
increase |
Enables an EVC Layer 2 sub-interface to increase a tag value in each received packet by valoffset. |
- |
decrease |
Enables an EVC Layer 2 sub-interface to decrease a tag value in each received packet by valoffset. |
- |
offset-vid |
Specifies the offset value. |
The value is an integer ranging from 1 to 4093. |
1-to-1 |
Configures 1 to 1 VLAN mapping to enable an EVC Layer 2 sub-interface to map a single tag in each received single-tagged packet or an outer tag in each received double-tagged packet to a specified tag. For example, an EVC Layer 2 sub-interface with 1 to 1 VLAN mapping configured receives double-tagged packets. The sub-interface maps the outer tag to a specified VLAN tag and the inner tag remains. |
- |
2-to-1 |
Configures 2 to 1 VLAN mapping to enable an EVC Layer 2 sub-interface to map two tags in each received packet to a specified tag. This parameter can be configured only after QinQ encapsulation is enabled using the encapsulation qinq vid pe-vid ce-vid { low-ce-vid [ to high-ce-vid ] | default } command on a specific EVC Layer 2 sub-interface. |
- |
vid pe-vid |
Specifies the VLAN ID in the single tag to which a single tag or double tags in each received packet are mapped when 1 to 1 or 2 to 1 VLAN tag mapping is used. |
The value is an integer ranging from 1 to 4094. |
8021p pe-8021p-value |
Specifies an 802.1p value for packets after a single tag or double tags in each received packet are mapped to a single tag. 802.1p is represented by a 3-bit PRI (priority) field in an 802.1q frame. If traffic is congested on a device, the device forwards frames in descending order by priority values. |
The value is an integer ranging from 0 to 7. |
1-to-2 |
Configures 1 to 2 VLAN mapping to enable an EVC Layer 2 sub-interface to map a single tag in each received single-tagged packet or an outer tag in each received double-tagged packet to the specified two tags. |
- |
2-to-2 |
Configures 2 to 2 VLAN mapping to enable an EVC Layer 2 sub-interface to map two tags in each received packet to the specified two tags. This parameter can be configured only after QinQ encapsulation is enabled using the encapsulation qinq vid pe-vid ce-vid { low-ce-vid [ to high-ce-vid ] | default } command on a specific EVC Layer 2 sub-interface. |
- |
ce-vid ce-vid |
Specifies the VLAN ID in the inner tag after a single tag or double tags in each received packet are mapped to two tags when 1 to 2 or 2 to 2 VLAN tag mapping is used. |
The value is an integer ranging from 1 to 4094. |
ce-8021p ce-8021p-value |
Specifies an 802.1p value for packets after a single tag or double tags in each received packet are mapped to two tags when 1 to 2 or 2 to 2 VLAN tag mapping is used. |
The value is an integer ranging from 0 to 7. |
single |
Specifies VLAN transparent transmission as the inbound direction of an EVC Layer 2 sub-interface on a PE. In the outbound direction of the PE, the VLAN ID of packets is mapped to the VLAN ID associated with the traffic encapsulation type on the EVC Layer 2 sub-interface. The mapping is as follows:
|
- |
offset |
Configures VLAN tag mapping based on a specified offset for an EVC Layer 2 sub-interface. |
- |
Usage Scenario
A network needs to be expanded with the growth of access users and data services, which poses the following challenges to the administrator:
Prerequisites
Precautions
A maximum of one traffic behavior can be specified on each EVC Layer 2 sub-interface. If a traffic behavior has been configured on an EVC Layer 2 sub-interface, perform the following operations on the EVC Layer 2 sub-interface to change the traffic behavior:
<HUAWEI> system-view [~HUAWEI] interface GigabitEthernet 0/1/1.2 mode l2 [*HUAWEI-GigabitEthernet0/1/1.2] rewrite map 1-to-2 vid 20 ce-vid 100 ce-8021p 4
<HUAWEI> system-view [~HUAWEI] interface GigabitEthernet 0/1/1.5 mode l2 [*HUAWEI-GigabitEthernet0/1/1.5] rewrite map offset increase 10
<HUAWEI> system-view [~HUAWEI] interface GigabitEthernet 0/1/1.4 mode l2 [*HUAWEI-GigabitEthernet0/1/1.4] rewrite map 2-to-2 vid 30 8021p 3 ce-vid 300 ce-8021p 4
<HUAWEI> system-view [~HUAWEI] interface GigabitEthernet 0/1/1.1 mode l2 [*HUAWEI-GigabitEthernet0/1/1.1] rewrite map 1-to-1 vid 10 8021p 4
<HUAWEI> system-view [~HUAWEI] interface GigabitEthernet 0/1/1.3 mode l2 [*HUAWEI-GigabitEthernet0/1/1.3] rewrite map 2-to-1 vid 10 8021p 2
<HUAWEI> system-view [~HUAWEI] interface GigabitEthernet 0/1/1.3 mode l2 [*HUAWEI-GigabitEthernet0/1/1.3] rewrite map single outbound