CentOS 7 防火墙 出现Failed to start iptables.service: Unit iptables.service failed to load

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了CentOS 7 防火墙 出现Failed to start iptables.service: Unit iptables.service failed to load相关的知识,希望对你有一定的参考价值。

错误信息如下:

[root]# service iptables start
Redirecting to /bin/systemctl start  iptables.service
Failed to start iptables.service: Unit iptables.service failed to load: No such file or directory.
解决方法如下:

一直用CentOS 6 习惯了,一下没适应过来。防火墙配置后执行service iptables save 出现”Failed to restart iptables.service: Unit iptables.service failed to load: No such file or directory.”错误,

在CentOS 7或RHEL 7或Fedora中防火墙由firewalld来管理,当然你可以还原传统的管理方式。或则使用新的命令进行管理。

假如采用传统请执行一下命令:

systemctl stop firewalld
systemctl mask firewalld

并且安装iptables-services:
yum install iptables-services

设置开机启动:
systemctl enable iptables

iptables启动、关闭、保存:

systemctl [stop|start|restart] iptables
#or
service iptables [stop|start|restart]


service iptables save
#or
/usr/libexec/iptables/iptables.init save
 

以上是关于CentOS 7 防火墙 出现Failed to start iptables.service: Unit iptables.service failed to load的主要内容,如果未能解决你的问题,请参考以下文章

解决 RHEL 7/ CentOS 7/Fedora 出现Unit iptables.service failed to load

CentOS 7告iptables防火墙提示Unit iptables.service failed to load

安装k8s出现 Failed to list *api.Node: Get http://192.168.144.131:8080...: dial tcp 192.168.144.131:8080

centos搭建的ftp,执行pwd时没问题;在执行ls命令时,报错425failed to establish connection。

Linux_异常_02_Failed to restart iptables.service: Unit not found.

CentOS 7 下 安装Webmin 启动防火墙失败----Applying firewall rules:iptables-restore:line 2 failed