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
网友评论