You could that with iptables quota
http://wiki.openwrt.org/doc/howto/netfilter
some more info how to craft your custom firewall rules:
http://varinderjhand.wordpress.com/2012 … sed-acces/
the custom firewall rules:
iptables -N quota
iptables -A quota -m quota –-quota 5368709120 -j RETURN
iptables -A quota -j reject
iptables -A zone_lan_forward -j quota -m mac --mac-source AA:D2:BD:1C:19:35 # example 1
iptables -A zone_lan_forward -j quota -s 192.168.0.4 #example 2
You can copy the line with the mac address or ip as many times if you like because it points to the newly created chain quota that does the actual quota checking. (also you don't need the ip and mac both)
also rebooting the router resets the quota again as well, with traffic shaping and limitting the bandwidth availlable is a nicer solution in my opinion.
Also if the quota is reached you could use iptables REDIRECT to redirect traffic on port 80 to a webserver (that doesn't have to run on port 80). to inform the quota has been reached.
For resetting the quota you could opt for restarting the firewall via cron (Scheduled Tasks)
0 0 1 * * /etc/init.d/firewall restart
this will restart the firewall at madnight first day of each month
http://www.thegeekstuff.com/2009/06/15- … -examples/
some more info on traffic shaping: http://wiki.openwrt.org/doc/howto/packe … .scheduler
And a final note, since it is rather easy to change a mac or ip, you can also make a seperate zone for them and assign it to a specific port on the router or a seperate ssid on the wifi (or both). and monitor that instead.
Also 5GBytes translates to more or less 15 Kbps continues per month, damn with my dailup years ago i could download more.
(Last edited by FriedZombie on 7 Sep 2013, 03:37)