Can dd-wrt or tomato keep track of GB usage per billing period per device?

14

6

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?

Update:
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.

Sam Hasler

Posted 2011-02-10T10:15:37.637

Reputation: 170

2I'd love a Tomato-based answer to this. – Phoshi – 2011-02-12T21:55:24.400

Answers

9

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.

image

harrymc

Posted 2011-02-10T10:15:37.637

Reputation: 306 093

Thanks for your answer. Congratulations on winning the bounty. – Sam Hasler – 2011-02-19T21:48:57.937

4

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..

Mikeysoft

Posted 2011-02-10T10:15:37.637

Reputation: 334

I want to split the bill by how much each person has used, not set quota for usage. – Sam Hasler – 2011-02-10T11:12:00.380

1It 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 – 2011-02-10T11:18:13.507

2

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/

Andee

Posted 2011-02-10T10:15:37.637

Reputation: 559

Logging packets is needlessly verbose. Look instead at solutions based on NetFlow. e.g. https://www.dd-wrt.com/wiki/index.php/Network_traffic_analysis_with_netflow_and_ntop

– mc0e – 2017-02-03T06:41:56.940

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 – 2011-02-12T23:22:32.640

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 – 2011-02-13T10:20:07.290