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

Linux关闭防火墙命令

时间:2017-08-23 19:10:20      阅读:213      评论:0      收藏:0      [点我收藏+]

标签:chkconfig   ice   文件   命令   相关   wal   inpu   设置   new   

Linux关闭防火墙命令 

1) 永久性生效,重启后不会复原

开启: chkconfig iptables on

关闭: chkconfig iptables off

2) 即时生效,重启后复原

开启: service iptables start

关闭: service iptables stop

需要说明的是对于Linux下的其它服务都可以用以上命令执行开启和关闭操作。

在开启了防火墙时,做如下设置,开启相关端口,

修改/etc/sysconfig/iptables 文件,添加以下内容:
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT

Linux关闭防火墙命令

标签:chkconfig   ice   文件   命令   相关   wal   inpu   设置   new   

原文地址:http://www.cnblogs.com/huhongy/p/7419497.html

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