Displaying and clearing statistics for IPv4 flowspec rules

You can display and clear statistical information for IPv4 flowspec rules.

Before you begin

Before displaying or clearing statistical information for IPv4 flowspec rules, you should enable the collection of statistical information by using the ip flowspec rules statistics command. There is a configuration example at the end of this task that shows all the configuration steps in order.

About this task

Perform the following task to display and then clear statistics for IPv4 flowspec rules.

Procedure

  1. From privileged EXEC mode, display statistics for IPv4 flowspec rules. The following example displays detailed statistical information.
    device# show ip flowspec rules detail 
    
    VRF :default-vrf 
    Total number of Rules: 1 
    
    1 Origin: Local(flowmap:23) Active: Yes 
      Match: 
         DSCP         <60 
      Actions: 
         Traffic-rate asn 666,rate 125000 bits/sec(operational-rate 132000 bits/sec) 
    
      Statistic       packets/bytes 
      -------------     ------------ 
        Matched         17412786/12589441782 
        Transmitted     1453/1048023 
        dropped         17411333/12588393759
    
  2. Clear statistics for IPv4 flowspec rules.
    device# clear ip flowspec rules statistics
    
  3. Verify that statistics for IPv4 flowspec rules are cleared.
    device# show ip flowspec rules detail 
    
    VRF :default-vrf 
    Total number of Rules: 1 
    
    1 Origin: Local(flowmap:23) Active: Yes 
      Match: 
         DSCP         <60 
      Actions: 
         Traffic-rate asn 666,rate 125000 bits/sec(operational-rate 132000 bits/sec) 
    
      Statistic       packets/bytes 
      -------------     ------------ 
        Matched         0/0 
        Transmitted     0/0 
        dropped         0/0
    

Example

The following example shows how to enable BGP flowspec rules, display statistics for BGP flowspec rules, clear the statistical information and then verify that the statistics have been cleared.

device# configure terminal
device(config)# ip flowspec rules statistics
device(config)# exit
!
device# show ip flowspec rules detail 

VRF :default-vrf 
Total number of Rules: 1 

1 Origin: Local(flowmap:23) Active: Yes 
  Match: 
     DSCP         <60 
  Actions: 
     Traffic-rate asn 666,rate 125000 bits/sec(operational-rate 132000 bits/sec) 

  Statistic       packets/bytes 
  -------------     ------------ 
    Matched         17412786/12589441782 
    Transmitted     1453/1048023 
    dropped         17411333/12588393759
 

!
device# clear ip flowspec rules statistics
!
device# show ip flowspec rules detail 

VRF :default-vrf 
Total number of Rules: 1 

1 Origin: Local(flowmap:23) Active: Yes 
  Match: 
     DSCP         <60 
  Actions: 
     Traffic-rate asn 666,rate 125000 bits/sec(operational-rate 132000 bits/sec) 

  Statistic       packets/bytes 
  -------------     ------------ 
    Matched         0/0 
    Transmitted     0/0 
    dropped         0/0