Update: I have finally found an adequate solution, which is using wrtbwmon, a bandwidth monitoring tool for OpenWRT routers. You can download it from the previous link.
Original article follows ...
Anyone with more than a couple of computers on a LAN will sooner face the issue of increased bandwidth usage by someone on the LAN. Be this teenagers downloading via torrents, employees watching YouTube and Facebook videos, or other reasons.
Finding a suitable tool to allow bandwidth monitoring and capping proved to be not an easy task. I am still looking for a solution, but have a few pointers to share.
My thinking was to buy a router that allows me to load an alternate Linux based firmware (e.g. Netgear WNDR3700 which has a large flash ROM size, and already runs OpenWRT), and run some Linux tool on it to do the monitoring.
The following are the things I have found so far that may help with this.
Bandwidth monitoring tools for Linux
This page has a list of all the Linux tools that relate to bandwidth monitoring. A useful starting point for further research.
The iftop program is very promising since it shows bandwidth consumption per IP address. It is a curses application and uses the libpcap library for packet capture. However, it is a real time only tool, showing what is happening now, and does not save nor show historical information (e.g. which computer consumed the most bandwidth last month).
The ipband program uses pcap to monitor a subnet and report on bandwidth utilization over a certain threshold, via email, and appending it to a file as well.
The bandwidthd daemon monitors a network's traffic and reports graphs for it. Looks like it is capable but would be heavy for an embedded router because of all the static HTML and graphs that it saves.
The Gargoyle router is based on OpenWRT. Among its features: bandwidth monitoring for every computer, as well as the facility to set quotas for each individual computer as well. It is open source (e.g. the bwmon-gargoyle package, with the init script doing most of the magic, and a small bwmon_convert.c program, and the qos-gargoyle package, with the init script having all the magic). Perhaps these features are reusable by other router firmware like OpenWRT and friends.