Linux Centos 7.x 命令查看、启动、关闭、重启防火墙

原创 HuangLongPu     发表于  2021-03-31 15:07       279

Centos 7.x 版本之后,对于服务操作和防火墙做了调整。

查看防火墙:

systemctl status firewalld

结果如下,表示目前防火墙处于开启状态

● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
   Active: active (running) since 二 2021-03-30 00:05:28 CST; 2s ago
     Docs: man:firewalld(1)
 Main PID: 14070 (firewalld)
   CGroup: /system.slice/firewalld.service
           └─14070 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid

开启防火墙:

systemctl start firewalld

关闭防火墙:

systemctl stop firewalld

重启防火墙:

systemctl restart firewalld