`
kiddwyl
  • 浏览: 398951 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

Linux防火墙的关闭和开启

    博客分类:
  • OS
阅读更多

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

分享到:
评论
3 楼 liuwenlong62555 2014-03-31  
                                           
2 楼 baolong101010 2014-01-28  
永久关闭:
chkconfig --level 2345 iptables off
1 楼 lijie1819 2013-12-21  
3)查看防火墙状态
chkconfig iptables --list

相关推荐

Global site tag (gtag.js) - Google Analytics