Clearing IPsec Statistics

Statistics related to IP security (IPsec) can be cleared using the clear ipsec statistics command.
Use the show ipsec statistics command to display the IPsec statistics. After using the clear ipsec statistics command to clear the IPsec statistics, re-enter the show ipsec statistics command to verify the IPsec statistics have been cleared. The clear ipsec statistics command resets the IPsec packet statistics and IPsec error statistics counters to zero.
  1. Enter the exit command as necessary to access user EXEC mode
    device(config)# exit
  2. Enter the show ipsec statistics command to display statistics related to IPsec.
    device# show ipsec statistics
                         IPSecurity Statistics
    secEspCurrentInboundSAs 1          ipsecEspTotalInboundSAs:  2
    secEspCurrentOutboundSA 1          ipsecEspTotalOutboundSAs: 2
                       IPSecurity Packet Statistics
    secEspTotalInPkts:      20         ipsecEspTotalInPktsDrop:  0
    secEspTotalOutPkts:     84
                       IPSecurity Error Statistics
    secAuthenticationErrors 0
    secReplayErrors:        0          ipsecPolicyErrors:        13
    secOtherReceiveErrors:  0          ipsecSendErrors:          0
    secUnknownSpiErrors:    0
    
  3. Enter the clear ipsec statistics command to clear statistics related to IPsec from the configuration.
    device# clear ipsec statistics
    
    
  4. Enter the show ipsec statistics command to verify that statistics related to IPsec have been cleared from the configuration.
    device# show ipsec statistics
                           IPSecurity Statistics
    ipsecEspCurrentInboundSAs 0          ipsecEspTotalInboundSAs:  0
    ipsecEspCurrentOutboundSA 0          ipsecEspTotalOutboundSAs: 0
                         IPSecurity Packet Statistics
    ipsecEspTotalInPkts:      0          ipsecEspTotalInPktsDrop:  0
    ipsecEspTotalOutPkts:     0
                         IPSecurity Error Statistics
    ipsecAuthenticationErrors 0
    ipsecReplayErrors:        0          ipsecPolicyErrors:        0
    ipsecOtherReceiveErrors:  0          ipsecSendErrors:          0
    ipsecUnknownSpiErrors:    0
    device# 
    
    
    The counters holding IPsec packet statistics and IPsec error statistics are reset to 0.

The following example clears IPsec statistics and verifies that the IPsec statistics have been cleared.

device(config-ospf6-router)# exit
device(config)# exit
device# show ipsec statistics
device# clear ipsec statistics
device# show ipsec statistics