IP Accounting 101

Enabling IP Accounting

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
1
R(config-if)# ip accounting
2
! This command defaults to:
3
R(config-if)# ip accounting output-packets
Copied!
You can configure an interface to account for the packets that are dropped by the access-group ACL on the interface, use:
1
R(config-if)# ip accounting access-violations
2
! Works for both incoming and outgoing packets
Copied!
Also, you can configure an interface to account for the MAC Addresses of the frames received or sent on an interface:
1
R(config-if)# ip accounting mac-address {input|output}
Copied!
Another option is to account for the IP Precedence value of the packets that pass through the interface:
1
R(config-if)# ip accounting precedence {input|output}
Copied!

System wide options

You can configure some system wide options for ip accounting, using:
1
R(config)# ip accounting-list HOST WILDCARD
2
! Limits the hosts for which accounting is enabled
3
R(config)# ip accounting-threshold MAX-ENTRIES
4
!Limits the max number of accounting entries
5
R(config)# ip accounting-transits COUNT
6
!Limits the number of transit entries
7
! Transit entires are those not matched by the accounting-list
Copied!

Monitoring IP Accounting

To see the results of IP accounting, use:
1
R#show ip accounting [checkpoint] [output-packets|access-violations]
2
Source Destination Packets Bytes
3
3.3.3.3 12.0.0.1 915 91500
4
23.0.0.3 1.1.1.1 80 8000
Copied!
A checkpoint is a snapshot of the database before the last clear ip accounting was used. To see the mac address accounting, use:
1
R#show interfaces INTERFACE mac
2
FastEthernet0/1
3
Input (511 free)
4
c200.1ddc.0001(2 ): 3787 packets, 425438 bytes, last: 896ms ago
5
Total: 3787 packets, 425438 bytes
6
Output (510 free)
7
c200.1ddc.0001(2 ): 3547 packets, 404358 bytes, last: 572704ms ago
8
0100.5e00.000a(85 ): 154 packets, 11396 bytes, last: 3348ms ago
9
Total: 3701 packets, 415754 bytes
Copied!
To see the IP Precedence accounting, use:
1
R# show interface INTERFACE precedence
2
FastEthernet0/1
3
Input
4
Precedence 0: 4 packets, 456 bytes
5
Output
6
Precedence 0: 4 packets, 456 bytes
Copied!
Last modified 24d ago