centos防火墙(查看,打开,关闭)
2020-06-06 本文已影响0人
何佳阳
1:查看防火墙状态:sudo systemctl status firewalld。
主要看Active项,active(running)状态为打开状态,inactive(dead)状态为关闭状态。


2:打开防火墙:sudo systemctl start firewalld
打开防火墙后我们查看防火墙状态,可以看到已经是active状态了,代表打开防火墙成功。

3:关闭防火墙:sudo systemctl stop firewalld
关闭防火墙后我们查看防火墙状态,可以看到已经是inactive状态了,代表关闭防火墙成功。

4:想重启后防火墙依旧是打开的状态:sudo systemctl enable firewalld
5:想重启后防火墙依旧是关闭的状态:sudo disable firewalld