I live in a country where many ISP (internet service providers) have FUP (fair use policy, limit on amount of data transferred). I need to get a new connection and I would like to measure how much data I transfer now, in order to determine how large (and how expensive) tariff I do need.

I'm looking for a utility that would log e.g. my hourly upstream and downstream values, so that I know how much data I transfer doing various activities.

System: Fedora 12


PPP writes a line to the logs on a disconnect, stating how many bytes were transfered each way.

There's a built-in byte counter in Linux's networking filter. Run iptables -nvxL: if you haven't configured any firewall, you'll see lines like

Chain INPUT (policy ACCEPT 720984 packets, 55279820 bytes)

This means that a total of 55MB were downloaded, but this isn't the number you want: it includes all network interfaces, even the loopback interface. The numbers are tracked for each chain, so you can get the number you want by putting all your ISP's packet through another chain.

iptables -N isp_in
iptables -A INPUT -i eth0 -j isp_in
iptables -P isp_in ACCEPT

You'll need to save the counter values each time you disconnect, and do the additions. I'm not aware of an application that does this but I'd be surprised if one doesn't already exist.

Note that if you reboot, the counter values are lost. You should save the counter values periodically to avoid large amounts going undetected.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.