The rewrite push command sets a traffic behavior to "push" 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.
The rewrite pop command sets the traffic behavior to "pop" so that an EVC Layer 2 sub-interface removes VLAN tags from received packets.
The undo rewrite command deletes a traffic behavior configured on an EVC Layer 2 sub-interface.
The rewrite swap command sets the traffic behavior to "swap" so that an EVC Layer 2 sub-interface swaps inner and outer VLAN tags in received packets.
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 pop { single | double }
rewrite push { vid vid [ ce-vid ce-vid ] }
rewrite push { vid vid 8021p 8021p-value [ ce-vid ce-vid [ ce-8021p ce-8021p-value ] ] }
rewrite push { vid vid 8021p 8021p-value [ ce-vid ce-vid ce-8021p ce-8021p-value ] }
rewrite push { vid vid [ 8021p 8021p-value ] ce-vid ce-vid ce-8021p ce-8021p-value }
rewrite swap
Parameter | Description | Value |
---|---|---|
single |
Enables an EVC Layer 2 sub-interface to remove outer tags from single-tagged packets after receiving them. |
- |
double |
Enables an EVC Layer 2 sub-interface to remove double tags from packets after receiving them. |
- |
push |
Push one or more specified VLAN tags. |
- |
vid vid |
Enables an EVC Layer 2 sub-interface to add a tag with a specified VLAN ID to received packets. If an EVC Layer 2 sub-interface receives single-tagged packets, vid vid specifies the VLAN ID in the outer tag to be added to the packets. |
The value is an integer ranging from 1 to 4094. |
ce-vid ce-vid |
Enables an EVC Layer 2 sub-interface to add an inner tag with a specified VLAN ID to received packets. |
The value is an integer ranging from 1 to 4094. |
8021p 8021p-value |
Enables the EVC Layer 2 sub-interface to change 802.1p priorities in received packets to a specified priority value. If an EVC Layer 2 sub-interface receives single-tagged packets, 8021p 8021p-value specifies the 802.1p value in the outer tag to be added to the packets. 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. |
ce-8021p ce-8021p-value |
Enables the EVC Layer 2 sub-interface to change 802.1p priorities in inner tags of received packets to a specified priority value. |
The value is an integer ranging from 0 to 7. |
swap |
Swap the inner VLAN tag with the outer VLAN tag. |
- |
pop |
Remove one or more specified VLAN tags. |
- |
Usage Scenario
rewrite pop:
Prerequisites
Before run the command rewrite pop,you should check as follows:
1.An EVC Layer 2 sub-interface has been created using the interface interface-type interface-number.subnum mode l2 command in the system view. 2. The EVC Layer 2 sub-interface is not added to a bridge domain. If the EVC Layer 2 sub-interface has been added to a bridge domain, run the undo bridge-domain bd-id command to remove the EVC Layer 2 sub-interface from the bridge domain. Before run the command rewrite push,you should check as follows: 1.An EVC Layer 2 sub-interface has been created using the interface interface-type interface-number.subnum mode l2 command in the system view. 2.The EVC Layer 2 sub-interface is not added to a bridge domain. If the EVC Layer 2 sub-interface has been added to a bridge domain, run the undo bridge-domain bd-id command to remove the EVC Layer 2 sub-interface from the bridge domain. Before run the command rewrite swap,you should check as follows: 1.An EVC Layer 2 sub-interface has been created using the interface interface-type interface-number.subnum mode l2 command in the system view. 2.The EVC Layer 2 sub-interface is not added to a bridge domain. If the EVC Layer 2 sub-interface has been added to a bridge domain, run the undo bridge-domain bd-id command to remove the EVC Layer 2 sub-interface from the bridge domain. 3. QinQ encapsulation has been enabled using the encapsulation qinq command in the EVC Layer 2 sub-interface view.Configuration Impact
After the rewrite pop command is run, a device processes packets as follows:
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:
<HUAWEI> system-view [~HUAWEI] interface GigabitEthernet 0/1/1.2 mode l2 [*HUAWEI-GigabitEthernet0/1/1.2] rewrite push vid 20 ce-vid 100 ce-8021p 4
<HUAWEI> system-view [~HUAWEI] interface GigabitEthernet 0/1/1.1 mode l2 [*HUAWEI-GigabitEthernet0/1/1.1] rewrite push vid 10 8021p 3
<HUAWEI> system-view [~HUAWEI] interface GigabitEthernet 0/1/1.2 mode l2 [*HUAWEI-GigabitEthernet0/1/1.2] rewrite pop single
<HUAWEI> system-view [~HUAWEI] interface GigabitEthernet 0/1/1.1 mode l2 [*HUAWEI-GigabitEthernet0/1/1.1] encapsulation qinq vid 10 ce-vid 100 to 200 [*HUAWEI-GigabitEthernet0/1/1.1] rewrite swap
<HUAWEI> system-view [~HUAWEI] interface GigabitEthernet 0/1/1.1 mode l2 [*HUAWEI-GigabitEthernet0/1/1.1] rewrite pop double