1. 在/etc/sysconfig/iptables INPUT规则的前面增加下面的代码
#uncomment the next 3 lines for cc-attack
#-A INPUT -m tcp -p tcp --dport 80 -m state --state NEW -m recent --update --name httpuser --seconds 5 --hitcount 20 -j LOG --log-prefix "cc-attack: " --log-level 4
#-A INPUT -m tcp -p tcp --dport 80 -m state --state NEW -m recent --update --name httpuser --seconds 5 --hitcount 20 -j DROP
#-A INPUT -m tcp -p tcp --dport 80 -m state --state NEW -m recent --name httpuser --set -j RH-Firewall-1-INPUT
2.同时最好修改kernel的ipt_recent模块的参数。在/etc/modprobe.conf增加:
options ipt_recent ip_list_tot=1000 ip_pkt_list_tot=120