usage tracking

Lisa Kachold lisakachold at obnosis.com
Sat Oct 20 09:50:40 MST 2012


Hi Derek,

On Sat, Oct 20, 2012 at 8:38 AM, Derek Trotter <expat.arizonan at gmail.com>wrote:

> My ISP imposes a monthly quota.  If the total amount of data I download
> and upload exceeds that quota I get billed extra. Everything I send or
> receive passes through my full time linux box. Is there something I can
> install on it that would monitor and log how much data passes through eth0?
>
> thanks
>
<snip>

You can enable iptables to do this:

http://www.cyberciti.biz/faq/linux-configuring-ip-traffic-accounting/

It should look like this:

iptables -N INET_OUT
iptables -N INET_IN
iptables -A FORWARD -j INET_IN
iptables -A FORWARD -j INET_OUT
iptables -A INPUT -j INET_IN
iptables -A OUTPUT -j INET_OUT

To see your data:

iptables -L -v -n

To see just your In:

/sbin/iptables -v -n -L INET_IN

To see just your Out:

/sbin/iptables -v -n -L INET_OUT

Depending on your distro, your iptables files will be saved in a directory.

You can use:

iptables-save

to save the recipe to persistent state (past a reboot or reset).

"Talk is cheap. Show me the code."
- Linus Torvalds
-- 
(503) 754-4452 Android
(623) 239-3392 Skype
(623) 688-3392 Google Voice
**
it-clowns.com
Chief Clown
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.PLUG.phoenix.az.us/pipermail/plug-discuss/attachments/20121020/10ce9598/attachment.html>


More information about the PLUG-discuss mailing list