IPtables Traffic Quota - up and down

Posted by Nick on Server Fault See other posts from Server Fault or by Nick
Published on 2011-03-08T21:20:18Z Indexed on 2011/03/10 8:11 UTC
Read the original article Hit count: 243

Filed under:
|
|
|
|

I've been trying to set up traffic quotas for users on a shared server and i believe [with my limited knowledge] that iptables --quota and ports which have been selected for each user [--dport] is the way to do this...

iptables -A OUTPUT --dport 1,2,3,4... --quota 123412341234 -j ACCEPT
iptables -A OUTPUT --dport 1,2,3,4... -j DROP

I think something like this would work to limit the traffic [and reset every month] but its only for traffic going out.

  • Is there something I could do to combine -A OUTPUT and -A INPUT into one quota?
  • Or, is there a different method I could use to achieve the same thing more efficiently?

OS is debian squeeze

Thanks.

© Server Fault or respective owner

Related posts about linux

Related posts about debian