一直用CentOS 6.x,今天用CentOS7.3版本时,防火墙配置后执行service iptables start出现”Failed to restart iptables.service: Unit iptables.service failed to load: No such file or directory.”错误,

错误信息如下:

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

当然我们可以还原传统的管理方式:

1、执行以下命令

  systemctl stop firewalld
  systemctl mask firewalld

2、安装iptables-services

  yum install iptables-services

3、设置开机启动

  systemctl enable iptables

4、iptables启动/停止/重启

  systemctl start iptables
  systemctl stop iptables
  systemctl restart iptables
  systemctl reload iptables

5、保存设置

  service iptables save

防火墙开放某个端口,在/etc/sysconfig/iptables文件中加入以下内容

  -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT

然后执行以下命令生效

  /usr/libexec/iptables/iptables.init save

CentOS 7.x关闭/开启防火墙出现Unit iptables.service failed to load: No such file or directory问题解决的更多相关文章

  1. 解决CentOS7关闭/开启防火墙出现Unit iptables.service failed to load: No such file or directory.

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

  2. CentOS7关闭/开启防火墙出现 Unit iptables.service failed to load

    在vm中安装好tomcat,而且在liunx中使用nc命令可以返回成功,但是更换到window中访问不到tomcat的情况,是由于linux防火墙的问题造成的,传统的解决方式有2中 第一种解决方案: ...

  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 issue method call: Unit mysqld.service failed to load: No such file or directory.

    国内私募机构九鼎控股打造APP,来就送 20元现金领取地址:http://jdb.jiudingcapital.com/phone.html内部邀请码:C8E245J (不写邀请码,没有现金送)国内私 ...

  6. 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 t ...

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

    一直用CentOS 6 习惯了,一下没适应过来.防火墙配置后执行service iptables save 出现”Failed to restart iptables.service: Unit ip ...

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

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

  9. 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 ...

随机推荐

  1. Apache提示You don't have permission to access / on this server 解决

    本文链接:https://blog.csdn.net/Niu_Eva/article/details/90741894 Apache提示You don’t have permission to acc ...

  2. Restricting Input in HTML Textboxes to Numeric Values

    Ok, here’s a fairly basic one – how to force a textbox to accept only numeric input. Somebody asked ...

  3. 清北学堂dp图论营游记day3

    .状态压缩dp: 对于这个我们引入二进制状态压缩,因为任何一个数都可以二进制表示,而其二进制表示上每一位都可以表示当前位置是否有元素,这就构成了状态压缩. 对于这个题,上下行&一下就行. 状压 ...

  4. 问题-CHM文件不显示

    原问题:http://bbs.csdn.net/topics/370230310 问题描述: http://download.csdn.net/download/wybneu/3582721 我从这个 ...

  5. JavaScript面向对象OOM 2(JavaScript 创建对象的工厂模式和构造函数模式)

      在创建对象的时候,使用对象字面量和 new Object() 构造函数的方式创建一个对象是最简单最方便的方式.但是凡是处于初级阶段的事物都会不可避免的存在一个问题,没有普适性,意思就是说我要为世界 ...

  6. 利用docker 部署项目

    docker_tomcat_jdk 7.0 1.6 app admin && api 1.yum install docker 2.service docker start 3.创建文 ...

  7. PyPy初体验

    PyPy初体验 PyPy安装 1.下载 下载地址:http://pypy.org/download.html(温馨提示:需要梯子) 下载PyPy3.6 64bit Ubuntu版本 解压 下载下来的文 ...

  8. 【C#-去空格】去掉字符串后空字符串\0\0\0\0\0\0

    使用  变量.Replace(@“\0”,"") string str="abcde\0\0\0\0\0\0"; str=str.Replace(@" ...

  9. QT:QSS字体设置

    css,qss font-family常用的黑体宋体等字体中英文对照 当qss使用中文设置字体时,无法生效.因为qss不支持中文设置字体,所以下面给出一些常用的黑体宋体字体中英文对照. 微软雅黑: M ...

  10. [LibreOJ 3119]【CTS2019】随机立方体【计数】【容斥】

    Description Solution 记\(N=min(n,m,l)\) 首先考虑容斥,记\(f(i)\)为至少有i个位置是极大的,显然极大的位置数上界是N. 那么显然\(Ans=\sum\lim ...