Saturday, May 15, 2010

Use "Iptables" for ssh & http connections per IP Address.

Allow "3 ssh" connections per client host:
/sbin/iptables -A INPUT -p tcp --syn --dport 22 -m connlimit --connlimit-above 3 -j REJECT

Allow "20 http" connections per IP (MaxClients is set to 60 in httpd.conf)
/sbin/iptables -A INPUT -p tcp --syn --dport 80 -m connlimit --connlimit-above 20 -j REJECT --reject-with tcp-reset




No comments:

Post a Comment