今天買了個騰訊云,想添加幾個限制連接數(shù)的規(guī)則,沒想到iptables老是報錯iptables: Unknown error 4294967295,我還以為沒有加載模塊,停止iptables,執(zhí)行modprobe -r ipt_recent,然后啟動iptables,再添加規(guī)則還是報錯,最后終于找到解決辦法了.如下:
cat >> /etc/modprobe.conf EOF
options ipt_recent ip_pkt_list_tot=200
EOF
停止iptables后,重新加載recent模塊:
modprobe -r ipt_recent
再來添加規(guī)則
iptables -A INPUT -p tcp --dport 80 -m recent --name BAD_HTTP_ACCESS --update --seconds 60 --hitcount 100 -j REJECT
iptables -A INPUT -p tcp --dport 80 -m recent --name BAD_HTTP_ACCESS --set -j ACCEPT/p>
p>service iptables save
保存后沒有再報錯了,好了,問題解決.