linux 防火墙配置

vi /etc/sysconfig/iptables 



# Generated by iptables-save v1.4.7 on Mon Feb  9 13:59:07 2015

*nat

:PREROUTING ACCEPT [0:0]

:POSTROUTING ACCEPT [0:0]

:OUTPUT ACCEPT [0:0]

-A PREROUTING -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8080 

COMMIT

# Completed on Mon Feb  9 13:59:07 2015







# Generated by iptables-save v1.4.7 on Tue Jan 20 16:02:04 2015

*filter

:INPUT ACCEPT [1:52]

:FORWARD ACCEPT [0:0]

:OUTPUT ACCEPT [1:164]



-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT

-A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT

-A INPUT -m state --state NEW -m tcp -p tcp --dport 8090 -j ACCEPT

-A INPUT -m state --state NEW -m tcp -p tcp --dport 8091 -j ACCEPT



COMMIT

# Completed on Tue Jan 20 16:02:04 2015





service iptables restart

 

你可能感兴趣的:(linux)