Configuring a Traffic Classifier

To classify traffic, you can configure traffic classifiers based on ACL rules, packet priorities, protocol types, and addresses.

Procedure

  1. Run system-view

    The system view is displayed.

  2. Run traffic classifier classifier-name [ operator { and | or } ]

    A traffic classifier is defined and its view is displayed.

    If you define multiple matching rules in a traffic classifier, you can set the logical relationship between the matching rules by specifying the operator parameter.

    • and: A packet belongs to the classifier only when it matches all the rules.
    • or: A packet belongs to the classifier if it matches any one of the rules.

  3. Define matching rules for the traffic classifier as required.

    • To define a matching rule based on an ACL, run the if-match acl { acl-number | name acl-name } [ precedence precedence-value ] command.

      If the rule [ rule-id ] { deny | permit } { protocol | udp } vxlan vni vni and rule [ rule-id ] { deny | permit } protocol [ packet-length length-operation length-value ] commands are configured for an advanced ACL, the rules that can be configured will be reduced.

      ACL rules can be defined based on different parameters, such as the protocol type, source address, destination address, and the precedence field in packets. Packets are matched against rules configured using the rule command in the if-match acl configuration, and traffic behaviors are performed for the matching packets.

    • To define a matching rule based on a DSCP value, run the if-match dscp dscp-value command.

    • To define a matching rule based on an IP precedence, run the if-match [ ipv6 ] ip-precedence ip-precedence command.

    • To define a matching rule to match all packets, run the if-match any command.

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
Next topic >