千家信息网

CentOS7关闭防火墙

发表于:2025-02-03 作者:千家信息网编辑
千家信息网最后更新 2025年02月03日,CentOS 7.0默认使用的是firewall作为防火墙。常用firewall命令点击(此处)折叠或打开systemctl stop firewalld.service #停止firewallsys
千家信息网最后更新 2025年02月03日CentOS7关闭防火墙CentOS 7.0默认使用的是firewall作为防火墙。

常用firewall命令

点击(此处)折叠或打开

  1. systemctl stop firewalld.service #停止firewall
  2. systemctl disable firewalld.service #禁止firewall开机启动
  3. firewall-cmd -- state #查看默认防火墙状态(关闭后显示notrunning,开启后显示running)

操作示例

查看防火墙状态

点击(此处)折叠或打开

  1. [hoegh@localhost Desktop]$ firewall-cmd --state
  2. running

关闭防火墙

点击(此处)折叠或打开

  1. [hoegh@localhost Desktop]$ systemctl stop firewalld.service
  2. PolicyKit daemon disconnected from the bus.
  3. We are no longer a registered authentication agent.
  4. PolicyKit daemon reconnected to bus.
  5. Attempting to re-register as an authentication agent.
  6. We are now a registered authentication agent.
  7. [hoegh@localhost Desktop]$
  8. [hoegh@localhost Desktop]$ firewall-cmd --state
  9. not running
  10. [hoegh@localhost Desktop]$

禁止自动启动

点击(此处)折叠或打开

  1. [hoegh@localhost Desktop]$
  2. [hoegh@localhost Desktop]$ systemctl disable firewalld.service
  3. Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
  4. Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service.
  5. [hoegh@localhost Desktop]$

~~~~~~~ the end~~~~~~~~~
hoegh
2017.11.3

0