# Inital chains default policy
/sbin/iptables -F -t filter
/sbin/iptables -P INPUT DROP
/sbin/iptables -P OUTPUT ACCEPT
# Enable Native Network Transfer
/sbin/iptables -A INPUT -i lo -j ACCEPT
# Accept Established Connections
/sbin/iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
# ICMP Control
/sbin/iptables -A INPUT -p icmp -m limit --limit 1/s --limit-burst 10 -j ACCEPT
# WWW Service
/sbin/iptables -A INPUT -p tcp --dport 80 -j ACCEPT
# FTP Service
/sbin/iptables -A INPUT -p tcp --dport 2121 -j ACCEPT
# SSH Service
/sbin/iptables -A INPUT -p tcp --dport 59825 -j ACCEPT
# Anti DDOS
/sbin/iptables -I INPUT -p tcp --syn -m ttl --ttl-eq 117 -j DROP
/sbin/iptables -I INPUT -p tcp --syn -m length --length :40 -j DROP
# chmod 755 /usr/local/sbin/fw.sh
# echo '/usr/local/sbin/fw.sh' >> /etc/rc.d/rc.local
相关文章
热门资讯