Last active
November 27, 2015 07:03
-
-
Save fangdingjun/45786e235be05fc8a780 to your computer and use it in GitHub Desktop.
使用iptables防止webbench工具的攻击
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#限制单个ip的tcp的并发连接数为30 | |
iptables -A INPUT -p tcp -m connlimit --connlimit-above 30 -j DROP | |
#限制连接web服务的连接速度, 单个ip在10s内只允许建立10个新连接 | |
iptables -A INPUT -p tcp -m multiport --dport 80,443 -m state --state NEW --set --name web | |
iptables -A INPUT -p tcp -m multiport --dport 80,443 -m state --state NEW --update --name web \ | |
--hitcount 10 --seconds 10 -j REJECT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment