Centos 7 使用(Service iptables stop/start)关闭/打开防火墙 Failed to stop iptables.service: Unit iptables.service not loaded.
背景:
测试部署NetCore 项目到linux 系统时,窗口显示项目部署成功;但是本机无法访问(linux 在虚拟机上[ centos 7.6] ); 如下图↓

能够相互ping 通,(Xshell 连接正常。),在centos 上 也能正常访问,后来记起在进行linux 安装成功后,没有关闭防火墙,初步猜测是由于没有关闭防火墙导致,那关闭防火墙不就可以了?
二、操作
1、打开linux 终端,输入: service iptables stop ,就提示 标题展示的异常;

2、然后输入:systemctl stop firewalld (暂时关闭防火墙)
查看防火墙状态:systemctl status firewalld

成功了!!!!
三、回顾总结
经过查找发现:在CentOS 7或RHEL 7或Fedora中防火墙由firewalld来管理 ; 如果想要使用 service iptables start/stop 命令,需要下载 iptables-services
1、在 Centos 7 下下载 iptables-services 时,需要执行以下命令
systemctl stop firewalld --关闭防火墙
systemctl mask firewalld
yum install iptables-services --安装iptables-services
systemctl enable iptables --设置开机启动
service iptables save --保存
2、操作linux 防火墙命令:
1:查看防火状态
systemctl status firewalld
service iptables status 2:暂时关闭防火墙
systemctl stop firewalld
service iptables stop 3:永久关闭防火墙
systemctl disable firewalld
chkconfig iptables off 4:重启防火墙
systemctl enable firewalld
service iptables restart 5:永久关闭后重启(未测试)
chkconfig iptables on
查找资料:1、https://www.cnblogs.com/jxldjsn/p/10794171.html
2、https://blog.csdn.net/c233728461/article/details/52679558/
如有不合理之处,请大家多多指教。
如果您觉得本文对您有帮助,欢迎点击“收藏”按钮!(/:微笑)欢迎转载,转载请注明出处。
Centos 7 使用(Service iptables stop/start)关闭/打开防火墙 Failed to stop iptables.service: Unit iptables.service not loaded.的更多相关文章
- CentOS修改IP地址及关闭/打开防火墙
1.CentOS修改IP地址: # ifconfig eth0 192.168.1.80 这样就把IP地址修改为192.168.1.80(如果发现上不了网 了,那么你可能需要把网关和DNS也改一下,后 ...
- 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 ...
- Linux关闭打开防火墙命令
Linux下打开和关闭防火墙 1.及时生效,重启后复原 关闭:service iptables stop 开启:service iptalbes start 查看状态:service iptabl ...
- 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 关闭firewall防火墙启用iptables防火墙
一.关闭firewall防火墙 1.停止firewall systemctl stop firewalld.service 2.禁止firewall开机启动 systemctl disable fir ...
- 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: U ...
- (转)CentOS 7.0关闭默认防火墙启用iptables防火墙
场景:在本地虚拟机上使用ftp软件需要进行相应的端口设置,不可避免要访问Cnetos的防火墙,默认firewall操作不方便,所以需要进行相应的替换. 1 配置防火墙,开启80端口.3306端口 1. ...
- CentOS7关闭/开启防火墙出现 Unit iptables.service failed to load
在vm中安装好tomcat,而且在liunx中使用nc命令可以返回成功,但是更换到window中访问不到tomcat的情况,是由于linux防火墙的问题造成的,传统的解决方式有2中 第一种解决方案: ...
随机推荐
- 清晰架构(Clean Architecture)的Go微服务: 事物管理
为了支持业务层中的事务,我试图在Go中查找类似Spring的声明式事务管理,但是没找到,所以我决定自己写一个. 事务很容易在Go中实现,但很难做到正确地实现. 需求: 将业务逻辑与事务代码分开. 在编 ...
- IDEA新建maven项目没有webapp目录解决方法
转载地址:https://www.cnblogs.com/oldzhang1222/p/10429827.html 先创建的页面修改路径 修改路径如下 添加并完善路径\src\main\webapp ...
- maven install 报错 Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test
pom文件引入以下依赖 <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId> ...
- python,finally的应用
脚本执行过程中可能因为被测试的环境有改变导致中间某一部分无法继续执行下去 可以在最后一行加上finally来执行最后一句脚本 比如 最后执行退出 表示 无论中间过程失败还是成功,最终都会执行退出操作 ...
- python数据分析常用图大集合
目录 一.折线图 二.直方图 三.垂直条形图 四.水平条形图 五.饼图 六.箱线图 七.热力图 八.散点图 九.蜘蛛图 十.二元变量分布 十一.面积图 十二.六边形图 以下默认所有的操作都先导入了Nu ...
- RabbitMq 深入了解
积少成多 ---- 仅以此致敬和我一样在慢慢前进的人儿 问题一:什么是RabbitMq 下面就是些个人的感受, rabbitmq 就是一个遵循AMQP协议(这个是啥不清楚) 的消息队列的实现,用于服 ...
- 使用springboot Admin 2.0.6版本 集成监控springcloud微服务应用
一 新建 添加依赖 <dependencies> <dependency> <groupId>de.codecentric</groupId> < ...
- Informatica9.5.1配置域名错误(ICMD_10033,INFASETUP_10002,RSVCSHARED_00021)
错误信息: OutPut : [ICMD_10033] Command [defineDomain] failed with error [[INFASETUP_10002] Cannot creat ...
- AcWing 785.快速排序
AcWing 785.快速排序题解 题目描述 给定你一个长度为n的整数数列. 请你使用快速排序对这个数列按照从小到大进行排序. 并将排好序的数列按顺序输出. 输入格式 输入共两行,第一行包含整数 n. ...
- Hello,world!一切的开始
普及知识 当我们准备开发Java程序时,我们需要两样基础的工具--JDK与IDE.在这里需要解释一下什么是JDK还有IDE.JDK的全称是Java Development kit,即Java开发工具集 ...