08.开启或关闭firewalld防火墙

关闭或开启firewalld防火墙

查看firewalld状态

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

● firewalld.service - firewalld - dynamic firewall daemon

   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)

   Active: active (running) since Thu 2020-11-19 14:16:43 CST; 1 weeks 4 days ago

     Docs: man:firewalld(1)

 Main PID: 802 (firewalld)

   CGroup: /system.slice/firewalld.service

           └─802 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid

 

Nov 19 14:16:43 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon...

Nov 19 14:16:43 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall daemon.

Nov 19 14:16:44 localhost.localdomain firewalld[802]: WARNING: ICMP type 'beyond-scope' is not supp...v6.

Nov 19 14:16:44 localhost.localdomain firewalld[802]: WARNING: beyond-scope: INVALID_ICMPTYPE: No s...me.

Nov 19 14:16:44 localhost.localdomain firewalld[802]: WARNING: ICMP type 'failed-policy' is not sup...v6.

Nov 19 14:16:44 localhost.localdomain firewalld[802]: WARNING: failed-policy: INVALID_ICMPTYPE: No ...me.

Nov 19 14:16:44 localhost.localdomain firewalld[802]: WARNING: ICMP type 'reject-route' is not supp...v6.

Nov 19 14:16:44 localhost.localdomain firewalld[802]: WARNING: reject-route: INVALID_ICMPTYPE: No s...me.

Hint: Some lines were ellipsized, use -l to show in full.

 

关闭firewalld

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

 

开启firewalld

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

 

设置开机不启动

[root@localhost ~]# systemctl disable firewalld.service

Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.

Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.

 

设置开机启动

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

Created symlink from /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service to /usr/lib/systemd/system/firewalld.service.

Created symlink from /etc/systemd/system/multi-user.target.wants/firewalld.service to /usr/lib/systemd/system/firewalld.service.

 

查看是否自启动

[root@localhost ~]# systemctl is-enabled firewalld.service

disabled

disabled表示不自启动;enabled表示自启动。

posted @ 2020-12-23 09:58  AI非AI  阅读(603)  评论(0)    收藏  举报