You are not logged in.
Is there a way to get something to monitor my upload bandwidth, cutting it completely off after a set amount per day?
For example, stop any sort of uploads after 5gb of upload traffic per day.
I'm trying to set up a headless server running Arch, but I start getting mean letters if I go over that limit, so any help would be appreciated
Offline
man iptables and look at the 'quota' match option.
Something like this might work for you:
iptables -A OUTPUT -m quota --quota 5368709120 -j ACCEPT
iptables -A OUTPUT -j REJECT
Remember the counter will be reset on reboot, or reloading the iptables rules! You'll need to reset the quota each night too of course.
Last edited by fukawi2 (2009-10-02 03:02:16)
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
So I would just run these commands in my rc.local or something, and they would keep the quota below 5gb per day, or until the server is rebooted?
Is there a way to keep what the quota byte total is in a text file or something so that the server can refresh it every day, and be proof against restarts?
Offline
Have a look at iptables-save and iptables-restore for saving counters....
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline