防火墙限制IP地址段访问 iptables

vi /etc/sysconfig/iptables

# Generated by iptables-save v1.4.21 on Thu Nov 23 10:16:42 2017

*filter
:INPUT DROP [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [65:6796]
:syn-flood - [0:0]
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp -s 127.0.0.1 --dport 10000:19998 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp -s 99/67.68.69/32 --dport 10000:19998 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp -s 199.99.99.99/27 --dport 10000:19998 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 19999 -j ACCEPT
-A INPUT -p icmp -m limit --limit 1/sec --limit-burst 10 -j ACCEPT
-A INPUT -f -m limit --limit 100/sec --limit-burst 100 -j ACCEPT
-A INPUT -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK SYN -j syn-flood
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
-A syn-flood -p tcp -m limit --limit 3/sec --limit-burst 6 -j RETURN
-A syn-flood -j REJECT --reject-with icmp-port-unreachable
COMMIT
# Completed on Thu Nov 23 10:16:42 2017
展开阅读全文

没有更多推荐了,返回首页