14

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.

3 Answers3

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
  • 498,455
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
  • 344
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
  • 559
  • 2
  • 10