您的位置:首页 > 其它

为iptables增加connlimit模块 限制DOS攻击

2011-02-21 20:51 537 查看
注: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:0x17/0x02 #conn/32 > 32
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: