CenterOS7防火墙常用命令

jupiter
2021-01-16 / 0 评论 / 676 阅读 / 正在检测是否收录...
温馨提示:
本文最后更新于2021年12月07日,已超过921天没有更新,若内容或图片失效,请留言反馈。

查看防火墙是否关闭

[root@localhost ~]# firewall-cmd --state
not running
[root@localhost ~]#

开启防火墙

[root@localhost ~]# systemctl start firewalld
[root@localhost ~]# firewall-cmd --state
running

关闭防火墙

[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# firewall-cmd --state
not running

禁止firewall开机启动

[root@localhost ~]# systemctl disable firewalld
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
这样设置的话,下次重启开机的时候就会禁止firewall的启动,即关闭状态。

设置firewall开机启动

[root@localhost ~]# systemctl enable firewalld
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.

参考资料

  1. CENTER OS7关闭防火墙:https://www.cnblogs.com/gucb/p/11156935.html
0

评论 (0)

打卡
取消