CentOS 7.x关闭/开启防火墙出现Unit iptables.service failed to load: No such file or directory问题解决
一直用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问题解决的更多相关文章
- 解决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 ...
- CentOS7关闭/开启防火墙出现 Unit iptables.service failed to load
在vm中安装好tomcat,而且在liunx中使用nc命令可以返回成功,但是更换到window中访问不到tomcat的情况,是由于linux防火墙的问题造成的,传统的解决方式有2中 第一种解决方案: ...
- 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 ...
- 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 ...
- 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 (不写邀请码,没有现金送)国内私 ...
- 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 ...
- 解决 RHEL 7/ CentOS 7/Fedora 出现Unit iptables.service failed to load
一直用CentOS 6 习惯了,一下没适应过来.防火墙配置后执行service iptables save 出现”Failed to restart iptables.service: Unit ip ...
- Failed to stop iptables.service: Unit iptables.service not loaded.解决方法
CentOS7中执行 service iptables start/stop 会报错Failed to start iptables.service: Unit iptables.service fa ...
- 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 ...
随机推荐
- 浙大数据结构课后习题 练习二 7-2 Reversing Linked List (25 分)
Given a constant K and a singly linked list L, you are supposed to reverse the links of every K elem ...
- CentOS6.5安装zabbix3.0
Server端 搭建LAMP(Linux+Apache+Mysql+PHP)环境 1.安装MySQL #安装地址:https://dev.mysql.com/downloads/repo/yum/ y ...
- Linux修改mysql配置文件
1.首先需要知道mysql数据库安装在什么位置 2.查找配置文件位置 然后在根据这个目录,查看配置文件在哪里了(路径后面加上 --verbose --help|grep -A 1 'Default o ...
- 多线程(二)Object类方法、线程的操作sleep(),join(),interrupt(),yield()
四.Object类简介 Object类是所有类的超类,之所以放在线程部分是因为其方法很多是和线程有关的.比如以下三个: wait()方法.wait(long timeout)和wait(long ti ...
- HihoCoder1336 Matrix Sum(二维树状数组求和)
时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 You are given an N × N matrix. At the beginning every element ...
- poj2018 Best Cow Fences[二分答案or凸包优化]
题目. 首先暴力很好搞,但是优化的话就不会了.放弃QWQ. 做法1:二分答案 然后发现平均值是$ave=\frac{sum}{len}$,这种形式似乎可以二分答案?把$len$移到左边. 于是二分$a ...
- 如何查看fullGC 次数
如何查看fullGC 次数 如何较少fullGC 如何保证几周才发生一次fullGC
- k8sDeployment控制器
简写为deploy,是k8s控制器的另一种实现,它构建于ReplicaSet之上,可为pod和rs资源提供声明式更新. deploy控制器资源的大部分功能均可通过调用rs来实现,同时,还增添了部分特性 ...
- 使用ajax上传图片,并且使用canvas实现出上传进度效果
前端代码: <%@ page contentType="text/html;charset=UTF-8" language="java" %> &l ...
- 一个原生ajax在jetbrains开发平台的调用方法
这段随笔的记述目的无非是,一个html页面中可能有多段js代码,所以采用外引的方法应该会好一些 function checkfiles() { var xhr = new XMLHttpRequest ...