The display traffic policy statistics command displays packet statistics in the specified object or each object to which a traffic policy has been applied.
display traffic policy statistics { global [ slot slot-id ] | interface interface-type interface-number [.subinterface-number ] | vlan vlan-id | ssid-profile ssid-profile-name } { inbound | outbound } [ verbose { classifier-base | rule-base } [ class classifier-name ] ]
Only the S5720-EI, S5720-HI, S5730-HI, S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6720-EI, S6720-HI, S6720S-EI, S6730-H, S6730S-H, S6730-S, and S6730S-S support sub-interfaces.
Only the S5720-HI, S5730-HI, S5731-H, S5731S-H, S5732-H, S6720-HI, S6730S-H, and S6730-H support ssid-profile ssid-profile-name.
display traffic policy statistics policy-name policy-name
display traffic policy statistics all
Parameter |
Description |
Value |
---|---|---|
global |
Displays packet statistics in the system to which a traffic policy has been applied. |
- |
slot slot-id |
Displays packet statistics on a specified device to which a traffic policy has been applied. slot-id specifies the slot ID of the device. |
The value range depends on the device configuration. |
interface interface-type interface-number [.subinterface-number ] |
Displays packet statistics on a specified interface to which a traffic policy has been applied.
|
- |
vlan vlan-id |
Displays packet statistics in a specified VLAN to which a traffic policy has been applied. vlan-id specifies the ID of the VLAN. |
The value is an integer that ranges from 1 to 4094. |
ssid-profile ssid-profile-name |
Displays packet statistics in a specified SSID profile to which a traffic policy has been applied. ssid-profile-name specifies the name of the SSID profile. |
The value must be the name of an existing SSID profile. |
inbound |
Displays packet statistics in the inbound direction to which a traffic policy has been applied. |
- |
outbound |
Displays packet statistics in the outbound direction to which a traffic policy has been applied. |
- |
verbose |
Displays detailed packet statistics. |
- |
classifier-base |
Displays statistics on packets matching a specified traffic classifier. If this parameter is specified, statistics on packets matching all traffic classifiers in the traffic policy are displayed. |
- |
rule-base |
Displays statistics on packets matching a rule. If this parameter is specified, statistics on packets matching all rules are displayed. |
- |
class classifier-name |
Specifies the name of a traffic classifier. If this parameter is specified, statistics on packets matching the specified traffic classifier or rules in the specified traffic classifier are displayed. If this parameter is not specified, statistics on packets matching all traffic classifiers are displayed. |
The value must be the name of an existing traffic classifier. |
policy-name policy-name |
Displays packet statistics in each object to which the specified traffic policy is applied. |
The value must be the name of an existing traffic policy. |
all |
Displays packet statistics in each object to which a traffic policy has been applied, including packet statistics in the inbound or outbound directions in the system, on each interface, in each VLAN, and in each SSID profile. |
- |
Usage Scenario
The display traffic policy statistics command displays packet statistics in the specified object or each object to which a traffic policy has been applied. The command output helps you check statistics on forwarded and discarded packets and locate faults.
Precautions
Info: The Policy is not applied in this view.
Info: Statistic has not been enabled.
If the rule-base parameter is specified in this command to display packet statistics matching a rule in a traffic classifier and ACL rules are modified or deleted at the same time, ACL rule statistics that are displayed in pagination mode are inaccurate. To obtain accurate ACL rule statistics, run this command after ACL rules are modified or deleted.
# Display packet statistics on GE0/0/1 in the inbound direction to which a traffic policy has been applied.
<HUAWEI> display traffic policy statistics interface gigabitethernet 0/0/1 inbound Interface: GigabitEthernet0/0/1 Traffic policy inbound: p1 Rule number: 1 Current status: success Statistics interval: 300 --------------------------------------------------------------------- Board : 0 --------------------------------------------------------------------- Matched | Packets: 0 | Bytes: 0 | Rate(pps): 0 | Rate(bps): 0 --------------------------------------------------------------------- Passed | Packets: 0 | Bytes: 0 | Rate(pps): 0 | Rate(bps): 0 --------------------------------------------------------------------- Dropped | Packets: 0 | Bytes: 0 | Rate(pps): 0 | Rate(bps): 0 --------------------------------------------------------------------- Filter | Packets: 0 | Bytes: 0 --------------------------------------------------------------------- Car | Packets: 0 | Bytes: 0 ---------------------------------------------------------------------
<HUAWEI> display traffic policy statistics global inbound verbose rule-base
Global :
Traffic policy inbound: p1
Rule number: 1
Current status: success
Statistics interval: 300
---------------------------------------------------------------------
Classifier: c1 operator and
Behavior: b1
if-match 8021p 5
Board : 0
---------------------------------------------------------------------
Passed | Packets: 0
| Bytes: 0
| Rate(pps): 0
| Rate(bps): 0
---------------------------------------------------------------------
Dropped | Packets: 0
| Bytes: 0
| Rate(pps): 0
| Rate(bps): 0
---------------------------------------------------------------------
<HUAWEI> display traffic policy statistics interface gigabitethernet 0/0/1 inbound verbose classifier-base class c1
Interface: GigabitEthernet0/0/1
Traffic policy inbound: p1
Rule number: 1
Current status: success
Statistics interval: 300
---------------------------------------------------------------------
Classifier: c1 operator and
Behavior: b1
Board : 0
---------------------------------------------------------------------
Matched | Packets: 0
| Bytes: 0
| Rate(pps): 0
| Rate(bps): 0
---------------------------------------------------------------------
Passed | Packets: 0
| Bytes: 0
| Rate(pps): 0
| Rate(bps): 0
---------------------------------------------------------------------
Dropped | Packets: 0
| Bytes: 0
| Rate(pps): 0
| Rate(bps): 0
---------------------------------------------------------------------
Filter | Packets: 0
| Bytes: 0
---------------------------------------------------------------------
Car | Packets: 0
| Bytes: 0
---------------------------------------------------------------------
# Display statistics about incoming packets matching rules after the traffic policy is applied to GigabitEthernet 0/0/1.
<HUAWEI> display traffic policy statistics interface GigabitEthernet 0/0/1 inbound verbose rule-base Interface: GigabitEthernet0/0/1 Traffic policy inbound: tp2 Rule number: 2 Current status: success Statistics interval: 300 --------------------------------------------------------------------- Classifier: c2 operator and Behavior: b1 Board : 0 rule 15 permit ip source 10.154.128.6 0 (match-counter 0) --------------------------------------------------------------------- Passed | Packets: 0 | Bytes: - | Rate(pps): 0 | Rate(bps): - --------------------------------------------------------------------- Dropped | Packets: 0 | Bytes: - | Rate(pps): 0 | Rate(bps): - --------------------------------------------------------------------- rule 70 permit ip source 10.10.12.0 0.0.0.31 (match-counter 0) --------------------------------------------------------------------- Passed | Packets: 13,528 | Bytes: - | Rate(pps): 0 | Rate(bps): - --------------------------------------------------------------------- Dropped | Packets: 0 | Bytes: - | Rate(pps): 0 | Rate(bps): - ---------------------------------------------------------------------
Item |
Description |
---|---|
Interface |
Interface to which the traffic policy is applied. |
Global |
System to which the traffic policy is applied. |
Traffic policy inbound |
Applied traffic policy. |
Rule number |
Number of valid rules in the traffic classifier. |
Current status |
Traffic policy status. |
Statistics interval |
Interval for collecting traffic statistics. To set the interval for collecting traffic statistics, run the traffic statistics interval command. |
Classifier |
Relationship between rules in the traffic classifier. To configure the relationship between rules in a traffic classifier, run the traffic classifier command. |
Behavior |
Traffic behavior name. To create a traffic behavior, run the traffic behavior command. |
Board |
ID of the switch to which the traffic policy is applied. When you query the statistics on an Eth-Trunk, the system displays only the statistics on the switch where member interfaces in the Eth-Trunk are located. |
Matched |
Numbers of packets and bytes that match traffic classification rules. The data is originated from the packet statistics that have been collected since the original statistics were cleared last time. |
Passed |
Numbers of forwarded packets and bytes that match traffic classification rules. The data is originated from the packet statistics that have been collected since the original statistics were cleared last time. |
Dropped |
Numbers of discarded packets and bytes that match traffic classification rules. The data is originated from the packet statistics that have been collected since the original statistics were cleared last time. The discarded packets include the filtered packets and packets dropped by CAR. |
Filter |
Numbers of filtered packets and bytes that match traffic classification rules. The data is originated from the packet statistics that have been collected since the original statistics were cleared last time. |
Car |
Numbers of packets and bytes that match traffic classification rules and are discarded by CAR. The data is originated from the packet statistics that have been collected since the original statistics were cleared last time. To configure CAR, run the car (traffic behavior view) command. |
Packets |
Number of packets. If the information is displayed as -, the statistics on this item cannot be collected. |
Bytes |
Number of bytes. If the information is displayed as -, the statistics on this item cannot be collected. |
Rate(pps) |
Rate, in pps. If the information is displayed as -, the statistics on this item cannot be collected. |
Rate(bps) |
Rate, in bit/s. If the information is displayed as -, the statistics on this item cannot be collected. |
match-counter 0 |
Number of times packets match ACL rules. NOTE:
FTP, TFTP, Telnet, SNMP, HTTP, routing, and multicast packets match software ACL rules, and the number of times packets match software ACL rules can be checked using a command. Other packets match hardware ACL rules, and the number of times packets match hardware ACL rules can be checked using other methods. For example, to view the number of times packets match ACL rules after a traffic policy is applied, run the statistic enable (traffic behavior view) command to enable traffic statistics in the traffic behavior and run the display traffic policy statistics command to check statistics. |