Using the count command, you can enable the function of counting packets that match traffic classification rules.
By default, the counting function is disabled.
When there are many traffic classification rules on the switch, you can run the count command to count the specific traffic. The counting start time is the time when the policy is applied.
Currently, the switch counts packets rather than bytes.
# Configure the traffic policy p1 so that the switch counts packets that flow through GigabitEthernet 0/0/1. After a period of time, the switch displays the traffic statistics.
<HUAWEI> system-view [HUAWEI] traffic classifier c1 [HUAWEI-classifier-c1] if-match any [HUAWEI-classifier-c1] quit [HUAWEI] traffic behavior b1 [HUAWEI-behavior-b1] count [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] display traffic policy interface gigabitethernet 0/0/1 Interface: GigabitEthernet0/0/1 Direction: Inbound Policy: p1 Classifier: c1 Rule(s) : if-match any Behavior: b1 Count Matched : 10 (Packets)