LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   iptable quotas by ip (https://www.linuxquestions.org/questions/linux-security-4/iptable-quotas-by-ip-4175550581/)

Sefyir 08-12-2015 09:25 AM

iptable quotas by ip
 
I'm looking to prevent a visitors from downloading +100M in a day from my website.

Most guides show just this, or with a -s ip_addr
Code:

iptables -A OUTPUT -p tcp -m quota --quota 104857600
I want this to apply individually to each ip address, so I can't use a -s match.

The problem is this is with OUTPUT, so it's universal, once a cumulative 100M has been reached - everyone has been blocked (not to mention SSH)
I presume that these connections are established, should I limit those? instead?

lazydog 08-12-2015 11:33 AM

Adding the '! -s 22' to your rule will allow ssh even when the quota is reached.
I'm not sure using the firewall to limit is the way you want to go here.


All times are GMT -5. The time now is 10:03 PM.