為iptables增加connlimit模塊 限制DOS攻擊
發(fā)布日期:2022-04-27 13:44 | 文章來源:源碼中國
注:2.6.23以前的內(nèi)核版本默認(rèn)不支持 connlimit
推薦規(guī)則
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出現(xiàn)
ipt_connlimit: Oops: invalid ct state ?
在這條規(guī)則前面加一條
iptables -A INPUT -m conntrack -j DROP --ctstate INVALID
阻斷非法數(shù)據(jù)包
查看效果
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
推薦規(guī)則
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出現(xiàn)
ipt_connlimit: Oops: invalid ct state ?
在這條規(guī)則前面加一條
iptables -A INPUT -m conntrack -j DROP --ctstate INVALID
阻斷非法數(shù)據(jù)包
查看效果
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
版權(quán)聲明:本站文章來源標(biāo)注為YINGSOO的內(nèi)容版權(quán)均為本站所有,歡迎引用、轉(zhuǎn)載,請保持原文完整并注明來源及原文鏈接。禁止復(fù)制或仿造本網(wǎng)站,禁止在非maisonbaluchon.cn所屬的服務(wù)器上建立鏡像,否則將依法追究法律責(zé)任。本站部分內(nèi)容來源于網(wǎng)友推薦、互聯(lián)網(wǎng)收集整理而來,僅供學(xué)習(xí)參考,不代表本站立場,如有內(nèi)容涉嫌侵權(quán),請聯(lián)系alex-e#qq.com處理。
相關(guān)文章
關(guān)注官方微信