The traffic-policy command applies a traffic policy to a VLANIF interface.
The undo traffic-policy command deletes a traffic policy from a VLANIF interface.
By default, no traffic policy is applied to a VLANIF interface.
Only the S5720-EI, S5720-HI, S5730-HI, S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6720-EI, S6720-HI, S6720S-EI, S6730-H, S6730S-H, S6730-S, and S6730S-S support this command.
traffic-policy policy-name { inbound | outbound }
undo traffic-policy [ policy-name ] { inbound | outbound }
Parameter |
Description |
Value |
---|---|---|
policy-name |
Specifies the name of a user-defined traffic policy. |
The value must be the name of an existing traffic policy. |
inbound |
Applies a traffic policy to the inbound direction. |
- |
outbound |
Applies a traffic policy to the outbound direction. |
- |
Usage Scenario
Packets are classified based on Layer 2 information, Layer 3 information, or ACLs. To provide differentiated services for service flows, bind a traffic classifier and a traffic behavior to a traffic policy and apply the traffic policy. You can use the traffic-policy command to apply a created traffic policy to a VLANIF interface.
Prerequisites
A traffic policy has been created using the traffic policy command, and traffic classifiers and traffic behaviors have been bound to the traffic policy.
Precautions
Each direction of a VLANIF interface can be configured with only one traffic policy. A single traffic policy can be applied to both directions on one or more VLANIF interfaces.
A traffic policy cannot be applied to a VLANIF interface corresponding to the super-VLAN or MUX VLAN.
On the S5720-EI, S6720-EI, and S6720S-EI, a traffic policy applied to a VLANIF interface takes effect only for unicast packets and Layer 3 multicast packets on the VLANIF interface.
On the S5720-HI, S5730-HI, S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6720-HI, S6730-H, S6730S-H, S6730-S, and S6730S-S, a traffic policy applied to a VLANIF interface takes effect only for unicast packets on the VLANIF interface.
After a traffic policy is applied to a VLANIF interface, you cannot directly delete the traffic policy, the traffic classifier and traffic behavior bound to the traffic policy. In addition, you cannot modify the matching order of the rules in the traffic policy. However, you can modify the relationship between matching rules in the traffic classifier, matching rules in the traffic classifier, traffic action in the traffic behavior, and binding between the traffic classifier and the traffic behavior.
If the traffic policy that you want to delete has been applied to a VLANIF interface, run the undo traffic-policy command to unbind the traffic policy from the VLANIF interface. Then run the undo traffic policy command in the system view to delete the traffic policy.
Run the undo traffic-policy inbound command without policy-name specified to delete the traffic policy that has been applied to a VLANIF interface and has the following names: i, in, inb, inbo, inbou, inboun, and inbound.
# Create a traffic policy p1, bind the created traffic classifier c1 and traffic behavior b1 to the traffic policy, and apply the traffic policy to the inbound direction on VLANIF 100.
<HUAWEI> system-view [HUAWEI] traffic policy p1 [HUAWEI-trafficpolicy-p1] classifier c1 behavior b1 [HUAWEI-trafficpolicy-p1] quit [HUAWEI] interface vlanif 100 [HUAWEI-Vlanif100] traffic-policy p1 inbound [HUAWEI-Vlanif100] quit