错误信息如下:

[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的更多相关文章

  1. Failed to stop iptables.service: Unit iptables.service not loaded.解决方法

    CentOS7中执行 service iptables start/stop 会报错Failed to start iptables.service: Unit iptables.service fa ...

  2. Failed to stop iptables.service: Unit iptables.service not loaded.

    redhat 7 [root@lk0 ~]# service iptables stop Redirecting to /bin/systemctl stop iptables.service Fai ...

  3. Failed to issue method call: Unit httpd.service failed to load: No such file or directory.

    centos7修改httpd.service后运行systemctl restart httpd.service提示 Failed to issue method call: Unit httpd.s ...

  4. Failed to issue method call: Unit mysql.service failed to load: No such file or directory解决的方式

    Failed to issue method call: Unit mysql.service failed to load: No such file or directory解决的方式 作者:ch ...

  5. Failed to start metasploit.service: Unit metasploit.service not found的解释

    不多说,直接上干货! root@kali:~# service metasploit start Failed to start metasploit.service: Unit metasploit ...

  6. docker安装完报错:Failed to start docker.service: Unit docker.service is masked

    执行 systemctl start docker 报错 Failed to start docker.service: Unit docker.service is masked. 解决 syste ...

  7. 停止:service jenkins stop,提示:Failed to stop jenkins.service: Unit jenkins.service not loaded.

    uni@uni-virtual-machine:~$ service jenkins stop Failed to stop jenkins.service: Unit jenkins.service ...

  8. Ubuntu 16.04下操作iptables的技巧(解决Failed to start iptables.service: Unit iptables.service not found.或者/etc/init.d/iptables: 没有那个文件或目录)

    /etc/init.d/iptables网上的解法应该都是基于CentOS 6去实践,而在CentOS 7中又被firewalld给取代,所以操作上的写法基本会改变,但是底层iptables则不会改变 ...

  9. Centos 7 使用(Service iptables stop/start)关闭/打开防火墙 Failed to stop iptables.service: Unit iptables.service not loaded.

    背景: 测试部署NetCore 项目到linux 系统时,窗口显示项目部署成功:但是本机无法访问(linux 在虚拟机上[ centos 7.6] );  如下图↓ 能够相互ping  通,(Xshe ...

随机推荐

  1. vue 中的.sync语法糖

    提到父子组件相互通信,可能大家的第一反应是$emit,最近在学着封装组件,以前都是用的别人封装好的UI组件,对vue中的.sync这个修饰符有很大的忽略,后来发现这个修饰符很nice,官方对她的描述是 ...

  2. LeetCode初级算法(树篇)

    目录 二叉树的最大深度 验证二叉搜索树 对称二叉树 二叉树的层次遍历 将有序数组转换为二叉搜索树 二叉树的最大深度 二叉树,所以可以考虑用递归来做.由于根节点已经算过了,所以需要加上1:每次返回都是以 ...

  3. BZOJ 1924 && Luogu P2403 [SDOI2010]所驼门王的宝藏 恶心建图+缩点DP

    记住:map一定要这么用: if(mp[x[i]+dx[j]].find(y[i]+dy[j])!=mp[x[i]+dx[j]].end()) add(i,mp[x[i]+dx[j]][y[i]+dy ...

  4. Java对日期Date类进行加减运算一二三

    转载大神 https://blog.csdn.net/hacker_lees/article/details/74351838

  5. Chapter11

    package scala import scala.collection.mutable /** * Created by EX-CHENZECHAO001 on 2018-04-03. */cla ...

  6. aspnetcore进程内托管的坑-非常规方法解决Log4Net不写日志的问题

    问题描述:Log4Net,本地测试一切正常,发布后,无法自动创建文件夹和日志文件,无法写入文件. 一.在项目中配置Log4Net 请参考我的上一篇博客 <aspnetcore配置log4net并 ...

  7. 【ACM】括号配对问题 - 栈

    括号配对问题 时间限制:3000 ms  |  内存限制:65535 KB 难度:3   描述 现在,有一行括号序列,请你检查这行括号是否配对.   输入 第一行输入一个数N(0<N<=1 ...

  8. 04.Spring Ioc 容器 - 刷新

    基本概念 Spring Ioc 容器被创建之后,接下来就是它的初始化过程了.该过程包含了配置.刷新两个步骤 . 刷新由 Spring 容器自己实现,具体发生在 ConfigurableApplicat ...

  9. LeetCode 136 Single Number 数组中除一个数外其他数都出现两次,找出只出现一次的数

    Given an array of integers, every element appears twice except for one. Find that single one. class ...

  10. java里如何实现两个等长度的字符串数组有多少个元素相同(从最左边开始,一旦遇到不同元素则跳出计数)

    不多说,直接上干货! package zhouls.bigdata.DataFeatureSelection.sim; public class test { public static int st ...