注:2.6.23以前的内核版本默认不支持 connlimit
推荐规则
iptables -A INPUT -p tcp -m tcp -m connlimit –dport 80 –tcp-flags SYN,ACK,FIN,RST SYN -j DROP –connlimit-above 32 –connlimit-mask 32
如果/var/logs/message出现
ipt_connlimit: Oops: invalid ct state ?
在这条规则前面加一条
iptables -A INPUT -m conntrack -j DROP –ctstate INVALID
阻断非法数据包
查看效果
iptables -n -L -v |grep conn
17479 1033K DROP tcp — * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:80 flags:0×17/0×02 #conn/32 > 32
版权所有,转载请注明出处。
转载自 <a href="http://www.yanghengfei.com/archives/469/" title="为iptables增加connlimit模块 限制DOS攻击" rel="bookmark">为iptables增加connlimit模块 限制DOS攻击 | 星外飞客 </a>
我简单说几句