码迷,mamicode.com
首页 > 系统相关 > 详细

linux 防火墙配置

时间:2015-02-10 14:46:27      阅读:233      评论:0      收藏:0      [点我收藏+]

标签:

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 防火墙配置

标签:

原文地址:http://www.cnblogs.com/xsmhero/p/4283715.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!