The traffic-policy global command applies a traffic policy to the system.
The undo traffic-policy global command deletes a traffic policy that is applied to the system.
By default, no traffic policy is applied to the system.
traffic-policy policy-name global { inbound | outbound } [ slot slot-id ]
undo traffic-policy [ policy-name ] global { inbound | outbound } [ slot slot-id ]
Parameter |
Description |
Value |
---|---|---|
policy-name |
Specifies the name of a 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. |
- |
slot slot-id |
On a stacked device, if slot-id is not specified, the traffic policy can be applied to all devices in the stack. |
The value is fixed at 0 on a non-stacked device, and specifies the stack ID on a stacked device. NOTE:
If the value of slot-id is specified in the undo traffic-policy command, it must be the same as the ID of the specified slot to which the traffic policy is applied. |
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 global command to apply a traffic policy to the system.
Prerequisites
A traffic policy has been created using the traffic policy command.
Precautions
If a traffic policy has been applied, you cannot directly change the traffic policy or its traffic classifier and traffic behavior.
If a traffic classifier in the traffic policy contains if-match mpls-exp, the traffic policy cannot be applied to the outbound direction on the S5720-EI, S6720-EI, and S6720S-EI.
After a traffic policy is applied, you cannot directly delete the traffic policy or 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.
Run the undo traffic-policy global { inbound | outbound } command without policy-name specified to delete the traffic policy that has been applied to an interface and has the following names: g, gl, glo, glob, globa, and global.
The traffic policy that has the following names cannot be applied to the system: f, fa, fas, fast, fast-, fast-m, fast-mo, fast-mod, and fast-mode.
# 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.
<HUAWEI> system-view [HUAWEI] traffic policy p1 [HUAWEI-trafficpolicy-p1] classifier c1 behavior b1 [HUAWEI-trafficpolicy-p1] quit [HUAWEI] traffic-policy p1 global inbound