I want to be able to track the usage of each device connecting to our router so we can split up the ISP bill by usage. Can dd-wrt or tomato provide the stats I'd need to do this?

After a bit of googling I'm aware of a much better answer than the current one. However I suspect there's probably more answers out there for other firmwares so in the interests of getting a more diverse set of answers—­and, I'll admit, because I'm getting tired of reading through obtuse firmware documentation—I've put up a bounty.

If the only answer added is the one I've found I'll be happy to accept it for the bounty, otherwise I'll add it and accept it myself, but I'm hoping for an even better answer, or at least some options for other firmwares as from looking I've seen a few other people have asked for this and there doesn't appear to be a definitive answer, let's make this it!

Go lazywebs!

(Sorry. I've always wanted to say that.)

Update 2: Usage is free between midnight and 8am with the plan we're on so if the solution can take that into account it would be preferred. The solution I found hasn't been mentioned in the first three answers, not sure how it will stack up against the other answers yet. I'll have to look into them all near the end of the bounty period.

Update 3: There is a tomato solution. I'll post it after I've awarded the bounty if no one else posts it. Since I don't have a router yet I'll be awarding the bounty to whatever looks like the most comprehensive or complete solution.

  • 2
    I'd love a Tomato-based answer to this. – Phoshi Feb 12 '11 at 21:55

See wrtbwmon :

A small shell script designed to run on linux powered routers (OpenWRT, DD-WRT, but also other routers where shell access is available). It provides per user bandwidth monitoring capabilities and generates usage reports.

There is a Wiki, and deployment instructions are found here.
A useful discussion of the above is : Per-user bandwidth monitoring script.
Another adaptation may be found in ip_conntrack with QoS and bandwidth use reporting.


| improve this answer | |
  • Thanks for your answer. Congratulations on winning the bounty. – Sam Hasler Feb 19 '11 at 21:48

It is possible but not easily configured on the above. You may want to try Gargoyle which lets you report bandwidth per IP as well as set quotas etc..

| improve this answer | |
  • I want to split the bill by how much each person has used, not set quota for usage. – Sam Hasler Feb 10 '11 at 11:12
  • 1
    It lets you Report bandwith per IP address, simply assign everyone a static IP address and go off the bandwith each one used. Allowing you to bill them correctly. – Joe Taylor Feb 10 '11 at 11:18

What about an iptables rule that simple logs all packets to a remote CIFS share or a USB stick. you can probably sum up the packet sizes grouped my MAC address. I'll see what I can come up with shortly.

The reason I say to a share or usb stick is due to the limited non-volatile storage space on the router itself (and the flash in the router lacks wear leveling)

UPDATE: DD-WRT supports ulog and syslog, you could even syslog to another machine. you'd need to dump the arp cache on a regular basis too to correlate the ip adress to mac address.

Something like this perhaps: http://lwn.net/Articles/2718/

| improve this answer | |
  • I don't have a machine that's on all the time, or with any regularity. I will be buying a new router once I have the answer to this question, have decided what firmware I'm going to run and what hardware requirements there will be. So a USB solution might be possible if that's better than storing on the router. – Sam Hasler Feb 12 '11 at 23:22
  • I'm using usb to store > 100MB of extra/updated binaries to run a complete IPv6 setup. Buffalo WZR-HP-G300NH and Netgeat WNR3500L both have USB ports you can use as storage in DD-WRT. – Andee Feb 13 '11 at 10:20
  • Logging packets is needlessly verbose. Look instead at solutions based on NetFlow. e.g. dd-wrt.com/wiki/index.php/… – mc0e Feb 3 '17 at 6:41

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.