(Centos8使用小知识一)Centos8 firewall防火墙关闭/开启,开机关闭/开启

焦驰
2023-12-01

目录

1.firewall防火墙状态查看

2.firewall防火墙关闭

3.firewall防火墙开启

4.firewall防火墙开机自启开启


1.firewall防火墙状态查看

firewall-cmd --state

[root@localhost qjy]# firewall-cmd --state
running

2.firewall防火墙关闭

注意:是关闭firewalld.service,systemctl stop firewalld.service

[root@localhost qjy]# systemctl stop firewalld.service
[root@localhost qjy]# firewall-cmd --state
not running

3.firewall防火墙开启

systemctl start firewalld.service

[root@localhost qjy]# systemctl start firewalld.service
[root@localhost qjy]# firewall-cmd --state
running

4.firewall防火墙开机自启开启

systemctl enable firewalld.service

[root@localhost qjy]# systemctl enable firewalld.service
Created symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service → /usr/lib/systemd/system/firewalld.service.
Created symlink /etc/systemd/system/multi-user.target.wants/firewalld.service → /usr/lib/systemd/system/firewalld.service.

5.firewall防火墙开机关闭

systemctl disable firewalld.service

[root@localhost qjy]# systemctl disable firewalld.service
Removed /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.

 

 类似资料: