为iptables增加connlimit模块 限制DOS攻击
为iptables增加connlimit模块 限制DOS攻击
发布时间:2016-12-27 来源:查字典编辑
摘要:注:2.6.23以前的内核版本默认不支持connlimit推荐规则iptables-AINPUT-ptcp-mtcp-mconnlimit-...

注: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

推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
相关阅读
网友关注
最新unix linux学习
热门unix linux学习
操作系统子分类