Hi chào cả nhà.
Dạo này site mình CPU hay bị tăng cao 100% và không thể process làm gì được.
Nên mình nghỉ có khả năng bị DDOS và có ý định thắc chặc lại một só rule cho iptables.
Mình mới lần đầu làm quen với iptables và có tham khảo cấu hình của một số diễn đàn như hva và các tutorial về iptables.
Và tạo ra các rule như sau:

#iptables example configuration script
#
# Flush all current rules from iptables
#
iptables -F
#
# Allow SSH connections on tcp port 22
# This is essential when working on remote servers via SSH to prevent locking yourself out of the system
#
iptables -A INPUT -s ***.***.***.*** -p tcp --dport 22 -j ACCEPT
iptables -A OUTPUT -d ***.***.***.*** -p tcp --dport 22 -j ACCEPT

#
# Set default policies for INPUT, FORWARD and OUTPUT chains
#
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT DROP


#allow input and output for localhost
iptables -A INPUT -i lo -j ACCEPT

# Accept packets belonging to established and related connections
#If more than 20 connection on port 80 drop
iptables -p tcp --syn --dport 80 -m connlimit --connlimit-above 20 --connlimit-mask 24 -j DROP
#end

#if more than 10 connection in 1 second log and drop
iptables -A INPUT -p tcp --dport 80 -m state --state NEW -m recent --set
iptables -A INPUT -p tcp --dport 80 -m state --state NEW -m recent --update --seconds 1 --hitcount 6 -j LOG --log-level 5 --log-prefix "HITCOUNT5: "
iptables -A INPUT -p tcp --dport 80 -m state --state NEW -m recent --update --seconds 1 --hitcount 6 -j DROP
#end

#Accept input port for web and other protocol. No need to detail a port.
#because web also use state:ESTABLISHED,RELATED
iptables -A INPUT -p tcp -m state --state ESTABLISHED,RELATED -j ACCEPT
#End

#Accept output port for web and other protocol. Output just have state:NEW,ESTABLISHED
iptables -A OUTPUT -p tcp -m state --state NEW,ESTABLISHED -j ACCEPT
#End

#limit number of log entry in one second
iptables -A INPUT -p tcp -m limit --limit 1/s -j LOG --log-level 5 --log-prefix "BAD_INPUT: "
iptables -A INPUT -j DROP
#end

#limit number of log entry in one second
iptables -A OUTPUT -p tcp -m limit --limit 1/s -j LOG --log-level 5 --log-prefix "BAD_INPUT: "
iptables -A OUTPUT -j DROP
#end

#limit number of log entry in one second
iptables -A FORWARD -p tcp -m limit --limit 1/s -j LOG --log-level 5 --log-prefix "BAD_INPUT: "
iptables -A FORWARD -j DROP
#end

#
# Save settings
#
/sbin/service iptables save
/sbin/service iptables restart
#
# List rules
#

Sau khi thực thi script thì bị block luôn tất cả, không thể kết nối đến web.
Mong mọi người giúp đỡ trong các rule trên.
Thank you!