CentOS 7查看、打开和关闭防火墙

一、开启防火墙

1、临时开启,重启后恢复到原来的状态:

[root@localhost user]# systemctl start firewalld.service

2、将防火墙设为开机启动,重启后开启防火墙:

[root@localhost user]# systemctl enable firewalld.service

二、查看防火墙状态

查看防火墙服务状态:

[root@localhost user]# systemctl status firewalld.service

开启状态显示如下:
防火墙开启状态
关闭状态显示如下:
防火墙关闭状态

三、关闭防火墙

1、临时关闭防火墙,当再次开机时,防火墙又开启:

[root@localhost user]# systemctl stop firewalld.service

2、永久关闭防火墙,禁止开机启动:

[root@localhost user]# systemctl disable firewalld.service
Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐