欢迎光临
我们一直在努力

CentOS7关闭防火墙

CentOS 7.0默认使用的是firewall作为防火墙。

常用firewall命令

点击(此处)折叠或打开

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

操作示例

查看防火墙状态

点击(此处)折叠或打开

  1. [hoegh@localhost Desktop]$ firewallcmd 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 reregister as an authentication agent.
  6. We are now a registered authentication agent.
  7. [hoegh@localhost Desktop]$
  8. [hoegh@localhost Desktop]$ firewallcmd –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/dbusorg.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)
【声明】:本博客不参与任何交易,也非中介,仅记录个人感兴趣的主机测评结果和优惠活动,内容均不作直接、间接、法定、约定的保证。访问本博客请务必遵守有关互联网的相关法律、规定与规则。一旦您访问本博客,即表示您已经知晓并接受了此声明通告。