centos 6和centos7关闭防火墙的方法

centos 6

关闭命令:  service iptables stop 
永久关闭防火墙:chkconfig iptables off

两个命令同时运行,运行完成后查看防火墙关闭状态 
        service iptables status

 

CentOS7 的防火墙配置跟以前版本有很大区别,经过大量尝试,终于找到解决问题的关键

CentOS7这个版本的防火墙默认使用的是firewall,与之前的版本使用iptables不一样。按如下方便配置防火墙:

1、关闭防火墙:sudo systemctl stop firewalld.service

 

2、关闭开机启动:sudo systemctl disable firewalld.service

 

 

3、安装iptables防火墙

执行以下命令安装iptables防火墙:sudo yum install iptables-services

?

4、配置iptables防火墙,打开指定端口(具体跟以前版本一样,网上介绍很多,这里不多介绍了)

 

5. 设置iptables防火墙开机启动:sudo systemctl enable iptables

?

OK了,根据配置的端口就可以访问了

 
posted @ 2017-03-23 09:45  不老玩童萧龙  阅读(239)  评论(0编辑  收藏  举报