The classifier behavior command binds a traffic behavior to a traffic classifier in a traffic policy.
The undo classifier command unbinds a traffic behavior from a traffic classifier in a traffic policy.
By default, no traffic classifier or traffic behavior is bound to a traffic policy.
Parameter |
Description |
Value |
---|---|---|
classifier-name |
Specifies the name of a traffic classifier. |
The value must be the name of an existing traffic classifier. |
behavior-name |
Specifies the name of a traffic behavior. |
The value must be the name of an existing traffic behavior. |
Usage Scenario
To take an action for packets of a certain type, use a traffic classifier to group the packets into one class and use a traffic behavior to define an action. Then associate the traffic classifier with the traffic behavior and bind them to a traffic policy.
Prerequisites
Precautions
You can dynamically add, modify, or delete the bound traffic classifiers, traffic behaviors, or binding of traffic classifiers and traffic behaviors in a traffic policy that has been applied to the system, a VLAN, or an interface.
Dynamically updating the traffic classifiers and traffic behaviors in a traffic policy makes the traffic policy ineffective for a short time. Confirm the operation before you use this command.
In a traffic policy, one traffic classifier can be bound to only one traffic behavior; each traffic policy supports a maximum of 256 pairs of traffic classifiers and traffic behaviors.
# Bind the traffic classifier c1 to the traffic behavior b1 in the traffic policy p1, and apply the traffic policy to GE0/0/1 in the inbound direction.
<HUAWEI> system-view [HUAWEI] traffic classifier c1 [HUAWEI-classifier-c1] if-match any [HUAWEI-classifier-c1] quit [HUAWEI] traffic behavior b1 [HUAWEI-behavior-b1] remark 8021p 2 [HUAWEI-behavior-b1] quit [HUAWEI] traffic policy p1 [HUAWEI-trafficpolicy-p1] classifier c1 behavior b1 [HUAWEI-trafficpolicy-p1] quit [HUAWEI] interface gigabitethernet 0/0/1 [HUAWEI-GigabitEthernet0/0/1] traffic-policy p1 inbound [HUAWEI-GigabitEthernet0/0/1] quit
# Bind the traffic classifier c1 to the new traffic behavior newb1 in the traffic policy p1 that has been applied to GE0/0/1 in the inbound direction.
<HUAWEI> system-view [HUAWEI] traffic policy p1 [HUAWEI-trafficpolicy-p1] classifier c1 behavior newb1 [HUAWEI-trafficpolicy-p1] quit