IP Accounting provides statistcs regarding the source and destination of the packets that are switched on an interface. Only outgoing traffic is accounted for and only traffic that is in transit, not generated by the router or that has the router as a destination.
IP Accounting is enabled per interface
R(config-if)# ip accounting
! This command defaults to:
R(config-if)# ip accounting output-packets
You can configure an interface to account for the packets that are dropped by the access-group ACL on the interface, use:
R(config-if)# ip accounting access-violations
! Works for both incoming and outgoing packets
Also, you can configure an interface to account for the MAC Addresses of the frames received or sent on an interface:
R(config-if)# ip accounting mac-address {input|output}
Another option is to account for the IP Precedence value of the packets that pass through the interface:
R(config-if)# ip accounting precedence {input|output}
System wide options
You can configure some system wide options for ip accounting, using:
R(config)# ip accounting-list HOST WILDCARD
! Limits the hosts for which accounting is enabled
R(config)# ip accounting-threshold MAX-ENTRIES
!Limits the max number of accounting entries
R(config)# ip accounting-transits COUNT
!Limits the number of transit entries
! Transit entires are those not matched by the accounting-list