- A+
直接命令:service firewalld stop
1. 禁用默认防火墙Disable Firewalld Service.
[root@rhel-centos7-tejas-barot-linux ~]# systemctl mask firewalld
2. 停止防火墙Stop Firewalld Service.
[root@rhel-centos7-tejas-barot-linux ~]# systemctl stop firewalld
3. 安装iptables
[root@rhel-centos7-tejas-barot-linux ~]# yum -y install iptables-services
4. 添加启动项:
[root@rhel-centos7-tejas-barot-linux ~]# systemctl enable iptables
# 如果不需要ip6tables, 可以忽略下面一步.
[root@rhel-centos7-tejas-barot-linux ~]# systemctl enable ip6tables
5. 启动iptables.
[root@rhel-centos7-tejas-barot-linux ~]# systemctl start iptables
# 如果不需要ip6tables, 可以忽略下面一步.
[root@rhel-centos7-tejas-barot-linux ~]# systemctl start ip6tables
CentOS防火墙已关闭,iptables开启。
参考文章:http://www.centoscn.com/CentOS/2015/0313/4877.html