Collecting data from a Cisco router's inbuilt IP accounting involves
connecting to the router's Telnet port, logging in and reading and
clearing the IP accounting database. The IP accounting database
provides flow information consisting of source IP address, destination IP
address, packets and bytes. There is no support for protocol, port or
type of service, and flows are not timestamped beyond the knowledge
that the data relates to the period between retrievals.
To enable accounting on each interface of the router (accounting
data is collected on the outgoing port, so to count all traffic, all
ports must have IP accounting enabled). To enable IP accounting on a
port, each interface configuration must include an ip accounting
configuration line, e.g.
Router# config terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)# interface FastEthernet0/0
Router(config-if)# ip accounting
Router(config-if)# interface FastEthernet0/1
Router(config-if)# ip accounting
Router(config-if)# exit
Router(config)# exit
Router#
Note that the ip accounting-threshold entries global
configuration line may also be required if the router is likely to have
a large number of discrete flows (in this case source-destination pairs;
Cisco IP accounting does not provide protocol data). entries should
be the maximum likely number of discrete flows in a sample period.
The collect cisco statement enables collection from a Cisco router's
IP accounting database. The router address, login password and enable
password (specified by the router address, router password and router
enable statements) must be provided. See the section
Router login parameters
for information on these statements.
An example of a Cisco ip accounting configuration is:
source cisco
collect cisco
router address cisco.example
router password "7 03055908020A27"
router enable "7 104D0817010E1407031739"
end source