The traffic classifier command creates a traffic classifier and displays the traffic classifier view, or directly displays the view of an existing traffic classifier.
The undo traffic classifier command deletes a traffic classifier.
By default, no traffic classifier is created in the system.
traffic classifier classifier-name [ operator { and | or } ]
undo traffic classifier classifier-name
Parameter |
Description |
Value |
---|---|---|
classifier-name |
Specifies the name of a user-defined traffic classifier. |
The value is a string of 1 to 64 case-sensitive characters, spaces not supported. When double quotation marks are used around the string, spaces are allowed in the string. |
operator |
Specifies the relationship between rules in a traffic classifier. If this parameter is not specified, the relationship between rules is OR by default. |
- |
and |
Indicates that the relationship between rules is AND. After this parameter is specified, the following situations occur:
|
- |
or |
Indicates that the relationship between rules is OR. After this parameter is specified, packets match a traffic classifier if the packets match one or more rules. |
- |
Usage Scenario
A traffic classifier classifies traffic of a certain type using matching rules. To provide differentiated services for service flows, bind a traffic classifier and a traffic behavior (see traffic behavior) to a traffic policy and apply the traffic policy.
A traffic classifier can be created based on Layer 2 information such as the 802.1p priority in the VLAN ID, 802.1p priority in the C-VLAN ID, VLAN ID, C-VLAN ID, or Layer 2 protocol type, and Layer 3 information such as the DSCP priority or IP priority, or ACLs.
Follow-up Procedure
Define rules in the traffic classifier. For example, run the if-match 8021p command to define rules based on the 802.1p priority in the VLAN tag.
Precautions
To delete a traffic classifier, unbind the traffic policy containing the traffic classifier from the system, an interface, or a VLAN where the traffic policy is applied and unbind the traffic classifier from the traffic behavior.
A maximum of 512 traffic classifiers can be created on the device.
After the relationship between rules in a traffic classifier is changed, the system checks whether rules conflict. When the relationship between rules is changed from OR to AND and multiple rules are configured, for example, matching rules based on the 802.1p priority in the inner VLAN tag, DSCP priority, IP precedence, and VLAN ID, the rules may conflict and the traffic policy cannot take effect. If the relationship between rules is changed from AND to OR, the traffic policy still takes effect but services may be affected because more packets are matched. Exercise caution when you change the relationship between rules.