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

Solution 1:

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

Solution 2:

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

Solution 3:

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/