summaryrefslogtreecommitdiffstats
path: root/extensions/libipt_account.man
blob: fcbb179a7a7ff80de8b40f412989590b1754132d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Account traffic for all hosts in defined network/netmask.

Features:

- long (one counter per protocol TCP/UDP/IMCP/Other) and short statistics

- one iptables rule for all hosts in network/netmask

- loading/saving counters (by reading/writting to procfs entries)

.TP
.BI "--aaddr " "network/netmask"
defines network/netmask for which make statistics.
.TP
.BI "--aname " "name"
defines name of list where statistics will be kept. If no is
specified DEFAULT will be used.
.TP
.B "--ashort"
table will colect only short statistics (only total counters
without splitting it into protocols.
.P
Example usage:

account traffic for/to 192.168.0.0/24 network into table mynetwork:

# iptables -A FORWARD -m account --aname mynetwork --aaddr 192.168.0.0/24

account traffic for/to WWW serwer for 192.168.0.0/24 network into table mywwwserver:

# iptables -A INPUT -p tcp --dport 80
  -m account --aname mywwwserver --aaddr 192.168.0.0/24 --ashort

# iptables -A OUTPUT -p tcp --sport 80
  -m account --aname mywwwserver --aaddr 192.168.0.0/24 --ashort

read counters:

# cat /proc/net/ipt_account/mynetwork
# cat /proc/net/ipt_account/mywwwserver

set counters:

# echo "ip = 192.168.0.1 packets_src = 0" > /proc/net/ipt_account/mywwserver

Webpage:
  http://www.barbara.eu.org/~quaker/ipt_account/