IP Accounting
U
SER
G
UIDE
296
IP
A
CCOUNTING
The IP Accounting functions allow to collect the traffic data on the specified interfaces based on the
IP source address and on the IP destination.
The commands
set ip-accounting interface add <ifname>
set ip-accounting interface add <ifname>
set ip-accounting on
activate the service on each specified interface.
It is possible to apply a filter on the interfaces to evaluate only the packets that satisfy the filter:
set ip-accounting interface add <ifname> filter <filter-description>
where
<filter-description>
follows the
tcpdump
syntax.
The monitoring data can be grouped by IP address and by port number through the commands:
I dati di monitoraggio possono essere aggregati per indirizzi IP e per port number mediante i
comandi:
set ip-accounting aggregate <ipaddr>/<mask> strip <maskbit>
set ip-accounting aggregate <from-port>-<to-port> into <port>
For example, with
set ip-accounting aggregate 192.168.1.0/16 strip 24
set ip-accounting aggregate 1024-65535 into 65535
set ip-accounting aggregate 150-1023 into 1023
all the addresses in the
192.168.0.0/16
subnet are displayed as
192.168.1.0
, and the last digit
of the address is omitted; the ports from
1024
to
65535
are displayed as
65535
and the ones from
150
to
1023
are displayed all as
1023
.
The command
show ip-accounting stat
shows how the network interfaces are used under monitoring
root@IMOLA>
show ip-accounting stat
Interface ppp1: received 8, 5 m average 0 bytes/sec, 0 pkts/sec
Interface atm0: received 13623, 5 m average 0 bytes/sec, 0 pkts/sec
Interface eth0: received 0, 5 m average 0 bytes/sec, 0 pkts/sec
Flow entries made: 66
Memory usage: 7 kbytes.
Free slots for rsh clients: 9
IP-Accounting uptime is 22 minutes
IMOLA uptime is 1 day 13 minutes
The command
show ip-accounting interface <ifname>