CentOS7 关闭防火墙

2019-05-09  本文已影响0人  勤劳的小仓鼠

CentOS6关闭防火墙使用以下命令,

CentOS7中若使用同样的命令会报错,

    stopiptables.service

    Failedtostopiptables.service: Unit iptables.servicenotloaded.

这是因为CentOS7版本后防火墙默认使用firewalld,因此在CentOS7中关闭防火墙使用以下命令,

    //临时关闭systemctl stop firewalld

    //禁止开机启动systemctl disable firewalld

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

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

当然,如果安装了iptables-service,也可以使用下面的命令,

    yum install -y iptables-services

    //关闭防火墙

    service iptables stop

    Redirectingto/bin/systemctlstopiptables.service

    //检查防火墙状态

    service iptables status 

上一篇 下一篇

猜你喜欢

热点阅读