firewall-cmd --state #查看默认防火墙状态(关闭后显示notrunning,开启后显示running)
[root@localhost ~]#firewall-cmd
--state
not
running
1
2
|
[root@localhost ~]#systemctl list-unit-files|grep firewalld.service
firewalld.service disabled
|
或者
1
2
3
4
|
[root@localhost ~]#systemctl status firewalld.service
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
Active: inactive (dead)
|
关闭防火墙:
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
1
2
|
[root@localhost ~]#systemctl stop firewalld.service
[root@localhost ~]#systemctl disable firewalld.service
|