Configuring a Traffic Classifier
Pre-configuration Tasks
Configure link layer attributes of interfaces to ensure that the interfaces work properly.
Configure an ACL if it is needed to classify traffic.
Context
Non-conflicting rules can be configured in a traffic classifier. You can configure rules based on actual requirements.
Procedure
Run system-view
The system view is displayed.
- Run traffic classifier classifier-name [ type { and | or } ]
A traffic classifier is created and the traffic classifier view is displayed, or the view of an existing traffic classifier is displayed.
and is the logical operator between rules in a traffic classifier, which means that:If a traffic classifier contains ACL rules, packets match the traffic classifier only if they match one ACL rule and all the non-ACL rules.
If a traffic classifier does not contain any ACL rules, packets match the traffic classifier only if they match all the rules in the classifier.
By default, the relationship between rules in a traffic classifier is or.
- Configure matching rules according to the following table.
For details about precautions for each matching rule, see the corresponding commands in the Command Reference.
Matching Rule
Command
Inner VLAN IDs in QinQ packets
if-match inner-vlan start-inner-vlan-id [ to end-inner-vlan-id ]
802.1p priority in VLAN packets
if-match 8021p 8021p-value &<1-8>
Inner 802.1p priority in QinQ packets
if-match inner-8021p 8021p-value &<1-8>
Outer VLAN ID or inner and outer VLAN IDs in QinQ packets
if-match vlan vlan-id [ inner-vlan start-inner-vlan-id [ to end-inner-vlan-id ] ]
(For the CE12800E) if-match vlan start-vlan-id [ to end-vlan-id ] [ inner-vlan inner-vlan-id ]
Dropped packet
if-match discard
Double tags in QinQ packets
if-match double-tag
EXP priority in MPLS packets
NOTE:The CE12800E does not support this matching rule.
if-match mpls-exp exp-value &<1-8>
Destination MAC address
if-match destination-mac mac-address [ mac-address-mask ]
Source MAC address
if-match source-mac mac-address [ mac-address-mask ]
Protocol type field in the Ethernet frame header
if-match l2-protocol { arp | ip | rarp | protocol-value }
All packets
if-match any
DSCP priority in IP packets
if-match [ ipv6 ] dscp dscp-value &<1-8>
IP precedence in IP packets
if-match ip-precedence ip-precedence-value &<1-8>
IP identifier in IP packets
NOTE:The CE12800E does not support this matching rule.
if-match ip-identification ip-identification-id [ mask ip-identification-mask ]
SYN Flag in the TCP packet
if-match tcp-flag { tcp-flag-value | { ack | fin | psh | rst | syn | urg } * }
Inbound interface
if-match inbound-interface { interface-type interface-number1 [ to interface-type interface-number2 ] } &<1-8>
Outbound interface
if-match outbound-interface { interface-type interface-number1 [ to interface-type interface-number2 ] } &<1-8>
ACL rule
if-match acl { acl-number | acl-name }
ACL6 rule
if-match ipv6 acl { acl6-number | acl6-name } [ loose-mode | strict-mode ]
NOTE:The CE12800E equipped with ED-E, EG-E, and EGA-E series cards does not support loose-mode and strict-mode.
Next-hop IP address and outbound interface
if-match nexthop ip-address interface interface-type interface-number
Next-hop IPv6 address and outbound interface
if-match ipv6 nexthop ipv6-address interface interface-type interface-number
Layer 2 known unicast packets
if-match unicast
Layer 2 unknown unicast packets
if-match unknown-unicast
QoS local ID
NOTE:Only the CE12800E configured with FD-X series cards supports this matching rule.
if-match qos-local-id qos-local-id
QoS local ID for QPPB
NOTE:Only the CE12800 supports this command.
if-match qppb qos-local-id qos-local-id
ECN flag
if-match ecn ecn-value
IPv6 ECN flag
NOTE:Only the CE12800E equipped with FD-X series cards supports this command.
if-match ipv6 ecn ecn-value
Inner information in GRE packets
NOTE:The CE12800E does not support this matching rule.
if-match gre [ inner-source-ip source-ip-address [ mask ip-address-mask ] | inner-destination-ip destination-ip-address [ mask ip-address-mask ] | inner-protocol protocol-number | inner-source-port source-port-number | inner-destination-port destination-port-number ] *
Inner information in MPLS packets on the transit node
NOTE:The CE12800E does not support this matching rule.
- if-match mpls transit { packet-format ip | packet-format mac tag-format none} { inner-source-ip source-ip-address [ mask ip-address-mask ] | inner-destination-ip destination-ip-address [ mask ip-address-mask ] | inner-protocol protocol-number | inner-source-port source-port-number | inner-destination-port destination-port-number | inner-ip-identification inner-ip-identification-id [ mask inner-ip-identification-mask ] } *
- if-match mpls transit packet-format mac tag-format single { inner-vlan inner-vlan-id | inner-source-ip source-ip-address [ mask ip-address-mask ] | inner-destination-ip destination-ip-address [ mask ip-address-mask ] | inner-protocol protocol-number | inner-source-port source-port-number | inner-destination-port destination-port-number | inner-ip-identification inner-ip-identification-id [ mask inner-ip-identification-mask ] } *
Inner information in MPLS packets
NOTE:The CE12800E does not support this matching rule.
if-match mpls [ inner-source-ip source-ip-address [ mask ip-address-mask ] | inner-destination-ip destination-ip-address [ mask ip-address-mask ] | inner-protocol protocol-number | inner-source-port source-port-number | inner-destination-port destination-port-number | inner-ip-identification inner-ip-identification-id [ mask inner-ip-identification-mask ] ] *
RoCEv2 packet information
NOTE:Only the CE12800E configured with FD-X series cards supports this matching rule.
if-match rocev2 { opcode opcode-value | qpair qpair-value | nack nack-value | udf base l4-head { rule-string rule-mask offset offset } &<1-4> } *
IPv6 RoCEv2 packet information
NOTE:Only the CE12800E equipped with FD-X series cards supports this command.
if-match ipv6 rocev2 { opcode opcode-value | qpair qpair-value | nack nack-value | udf base l4-head { rule-string rule-mask offset offset } &<1-4> } *
Inner information in VXLAN packets
- if-match vxlan [ transit ] [ vni vni-id ] [ tag-format { none | single } { inner-source-ip source-ip-address [ mask ip-address-mask ] | inner-destination-ip destination-ip-address [ mask ip-address-mask ] | inner-source-mac source-mac-address [ mask mac-address-mask ] | inner-protocol { protocol1 | protocol2 [ inner-tcp-flag established ] } | inner-source-port { source-port-number | range port-start port-end } | inner-destination-port { destination-port-number | range port-start port-end } | inner-ethertype { ethernet-type-hex | ip | arp | rarp | mpls } | inner-ip-identification inner-ip-identification-id [ mask inner-ip-identification-mask ] } * ]NOTE:
The CE12800E configured with FD-X series cards does not support the mpls parameter.
The CE12800E configured with ED-E, EG-E, and EGA-E series cards does not support the tag-format { none | single } parameter.
The CE12800E configured with ED-E, EG-E, and EGA-E series cards does not support the inner-ip-identification inner-ip-identification-id parameter.
- if-match vxlan [ transit ] [ vni vni-id ] [ inner-source-ip source-ip-address [ mask ip-address-mask ] | inner-destination-ip destination-ip-address [ mask ip-address-mask ] | inner-source-mac source-mac-address [ mask mac-address-mask ] | inner-protocol { protocol1 | protocol2 [ inner-tcp-flag established ] } | inner-source-port { source-port-number | range port-start port-end } | inner-destination-port { destination-port-number | range port-start port-end } | inner-ethertype { ethernet-type-hex | ip | arp | rarp | mpls } | inner-ip-identification inner-ip-identification-id [ mask inner-ip-identification-mask ] ] *NOTE:
The CE12800E configured with FD-X series cards does not support the mpls parameter.
The CE12800E configured with ED-E, EG-E, and EGA-E series cards does not support the inner-ip-identification inner-ip-identification-id parameter.
- if-match vxlan [ transit ] [ tag-format { none | single } ] acl { acl-number | acl-name }NOTE:
The CE12800E configured with ED-E, EG-E, and EGA-E series cards does not support the tag-format { none | single } parameter.
- (For the CE12800 and CE12800E equipped with FD-X series cards) if-match vxlan [ tag-format { none | single } ] ipv6 acl { acl-number | acl-name } [ loose-mode | strict-mode ]
- (For CE-L48XS-FDA, CE-L48XS-FD, CE-L48XS-FD1, CE-L48XS-FG, CE-L24LQ-FD, CE-L36LQ-FD, CE-L16CQ-FD, CE-L12CQ-FD, CE-L36CQ-FG, CE-L36CQ-FD1, CE-L36CQ-SD, CE-L08CF-FG1 and CE-L36CQ-FD cards) if-match ipv6 vxlan [ transit ] [ tag-format { none | single } ] acl { acl-number | acl-name }
- (For the CE-L48XS-FDA, CE-L48XS-FD, CE-L48XS-FD1, CE-L48XS-FG, CE-L24LQ-FD, CE-L36LQ-FD, CE-L16CQ-FD, CE-L12CQ-FD, CE-L36CQ-FG, CE-L36CQ-FD1, CE-L36CQ-SD, CE-L08CF-FG1 and CE-L36CQ-FD cards) if-match ipv6 vxlan [ tag-format { none | single } ] ipv6 acl { acl-number | acl-name } [ loose-mode ]
- (For the CE12800E equipped with FD-X series cards) if-match vxlan transit without-inner-ethernet { inner-source-ip source-ip-address [ mask ip-address-mask ] | inner-destination-ip destination-ip-address [ mask ip-address-mask ] | inner-protocol { protocol1 | protocol2 [ inner-tcp-flag established ] } | inner-source-port { source-port-number | range port-start port-end } | inner-destination-port { destination-port-number | range port-start port-end } } *
VXLAN reserved field
NOTE:The CE12800E configured with FD-X series cards does not support this matching rule.
if-match vxlan reserved-value reserved-value
Inner information in TRILL packets
NOTE:The CE12800E does not support this matching rule.
if-match trill acl { acl-number | acl-name }
Run commit
The configuration is committed.