Sunday 26 October 2014

Limiting number of HTTP Connections Per IP/Host

You can limit number of HTTP connections from single IP or Host using IPTABLES

The syntax is as follows :
/sbin/iptables -A INPUT -p tcp --syn --dport $port -m connlimit --connlimit-above N -j REJECT --reject-with tcp-reset

Example:
/sbin/iptables -A INPUT -p tcp --syn --dport 80 -m connlimit --connlimit-above 20 -j REJECT --reject-with tcp-reset

Above command will limit 20 HTTP connections per IP

No comments:

Post a Comment

ERR_CONTENT_DECODING_FAILED

If you are getting the error as ERR_CONTENT_DECODING_FAILED while accessing the domain then add the below extension in php.ini  ++++++++...