Centos7 Firewalld 解决防火墙问题

2021/4/13 7:28:13

本文主要是介绍Centos7 Firewalld 解决防火墙问题,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

**

Centos7 Firewalld 解决防火墙问题

**
第一次使用Firewalld关了半天没关掉,之前一直使用iptables,从来没出现过这么挠头的问题。
记录一下我解决端口不能访问的问题,其实思路很简单,卸载Firewalld安装iptables
一步一步来说吧
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. Install iptables service related packages.

[root@rhel-centos7-tejas-barot-linux ~]# yum -y install iptables-services

4. Make sure service starts at boot:

[root@rhel-centos7-tejas-barot-linux ~]# systemctl enable iptables

[root@rhel-centos7-tejas-barot-linux ~]# systemctl enable ip6tables

5. Now, Finally Let’s start the iptables services.

[root@rhel-centos7-tejas-barot-linux ~]# systemctl start iptables

[root@rhel-centos7-tejas-barot-linux ~]# systemctl start ip6tables

安装iptables 已经完成了这个时候iptables已经能用了。
但是您的Firewalld 还在runing。不信您可以查看一下
firewall-cmd –state
好了不废话了,直接yum remove firewalld
终于卸载了………………………..
好了你可以使用iptables了,尽情使用吧。
如果您连iptables也不想用了那就使用
service iptables stop命令关闭吧。



这篇关于Centos7 Firewalld 解决防火墙问题的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程