[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Mldonkey-users] exact traffic measuring
From: |
Roland Arendes |
Subject: |
Re: [Mldonkey-users] exact traffic measuring |
Date: |
Wed, 8 Jan 2003 15:49:34 +0100 (CET) |
Hi
> A nice feature for mldonkey would be a exact traffic measuring. Every
> byte that goes out and in should be counted. Even server connection
> traffic etc. It would be nice for traffic limited users.
I would use iptables for this. I hope your mldonkey is running with its
own userid (perhaps mldonkey). With iptables you can check all traffic
created by this user:
iptables -N mldonkey_count
iptables -A mldonkey_count -i ppp0 -m owner --uid-owner 524 -j RETURN
iptables -A mldonkey_count -o ppp0 -m owner --uid-owner 524 -j RETURN
iptables -I INPUT -j mldonkey_count
iptables -I OUTPUT -j mldonkey_count
You get a new chain with 2 rules in it. The first one counts incoming
bytes, the second one outgoing.
This is pure theory and written from scratch for this mail and I don't
know if -m owner works with incoming packets.
You need to change the uid (524) and the interface (ppp0) to the one you use.
But, I agree, it would be nice. But it won't be precise, because you
forgot the overhead (tcp-header, and perhaps pppoe-header too) which is
not created by mldonkey itself.
Roland