如何关闭和开启Centos7防火墙

2025-10-26 16:52:55

1、首先查看防火墙的启动状态,显示是:not running,是关闭的状态,开启和关闭防火墙

firewall-cmd –state

systemctl start firewalld.service

systemctl stop firewalld.service

如何关闭和开启Centos7防火墙

2、查看自启动的服务,左边是服务名称,右边是状态,enabled是开机启动,disabled是开机不启动。

systemctl list-unit-files

如何关闭和开启Centos7防火墙

3、前面为临时打开关闭防火墙,reboot重启电脑后又会恢复成开启的状态,如果是想重启后防火墙还是处于关闭的状态,就可以使用命令。disable是开启不启动,enable是开启自启动。

systemctl list-unit-files | grep firewalld

systemctl disable firewalld.service

systemctl enable firewalld.service

如何关闭和开启Centos7防火墙

4、查看防火墙iptables的配置文件。

如何关闭和开启Centos7防火墙

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢