一份iptables防火墙的规则

# Generated by iptables-save v1.4.7 on Sun Jan 15 02:30:24 2017
*nat
:PREROUTING ACCEPT [5:280]
:POSTROUTING ACCEPT [8:491]
:OUTPUT ACCEPT [8:491]
COMMIT
# Completed on Sun Jan 15 02:30:24 2017
# Generated by iptables-save v1.4.7 on Sun Jan 15 02:30:24 2017
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-I INPUT -p tcp –dport 3306 -j DROP
-A INPUT -s 127.0.0.1 -p tcp –dport 3306 -j ACCEPT
-A INPUT -p tcp -m state –state NEW -m tcp –dport 445 -j ACCEPT
-A INPUT -p tcp -m state –state NEW -m tcp –dport 30000:40000 -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 –dport 22 -j ACCEPT
-A INPUT -p tcp -m state –state NEW -m tcp –dport 21 -j ACCEPT
-A INPUT -p tcp -m state –state NEW -m tcp –dport 20 -j ACCEPT
COMMIT
# Completed on Sun Jan 15 02:30:24 2017
# Generated by iptables-save v1.4.7 on Sun Jan 15 02:30:24 2017
*mangle
:PREROUTING ACCEPT [142:14310]
:INPUT ACCEPT [142:14310]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [167:71778]
:POSTROUTING ACCEPT [167:71778]
COMMIT
# Completed on Sun Jan 15 02:30:24 2017
# Generated by iptables-save v1.4.7 on Sun Jan 15 02:30:24 2017
*raw
:PREROUTING ACCEPT [142:14310]
:OUTPUT ACCEPT [167:71778]
COMMIT
# Completed on Sun Jan 15 02:30:24 2017

附件。后缀名随便敲的。

fanghuoqiang

文 / admin
LEAVE A REPLY
loading