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中 第一种解决方案: ...
随机推荐
- 「 扫盲 」Web服务器和应用服务器的区别
我们经常使用apache,tomcat,nginx,jetty等服务器,但并不清楚它们间的区别,它们中,哪些是Web服务器,哪些是应用服务器?今天就来告诉你 Web服务器 理解WEB服务器,首先你要理 ...
- 【原创】(一)Linux进程调度器-基础
背景 Read the fucking source code! --By 鲁迅 A picture is worth a thousand words. --By 高尔基 说明: Kernel版本: ...
- C#反射与特性(九):全网最全-解析反射
目录 1,判断类型 1.1 类和委托 1.2 值类型 1.3 接口 1.4 数组 2, 类型成员 2.1 类 2.2 委托 2.3 接口 [微信平台,此文仅授权<NCC 开源社区>订阅号发 ...
- MinGW安装配置过程
MinGW安装过程 一. 下载 MinGW官网下载地址:http://sourceforge.net/projects/mingw/ 二. 安装 1. 双击下载好的压缩文件. 2. 然后出现如下界面, ...
- HBase学习总结
一.HBase介绍 1.基本概念 HBase是一种Hadoop数据库,经常被描述为一种稀疏的,分布式的,持久化的,多维有序映射,它基于行键.列键和时间戳建立索引,是一个可以随机访问的存储和检索数据的平 ...
- Vertx使用EventBus发送接受自定义对象
先看官方文档步骤: 需要一个编解码器,看源码: 可见内置了需要数据类型的实现,所以发送其他消息可以发送,但是如果发送自定义对象就需要自己实现编解码逻辑了 一 自定义编解码器 /** * 自定义对象编解 ...
- MySQL8.0 MIC高可用集群搭建
mysql8.0带来的新特性,结合MySQLshell,不需要第三方中间件,自动构建高可用集群. mysql8.0作为一款新产品,其内置的mysq-innodb-cluster(MIC)高可用集群的技 ...
- Activity--Eclipse安装Activity designer插件失败
案例 今天使用Eclipse 安装Activity designer插件时,出现了如下错误: An error occurred while collecting items to be instal ...
- C#系列之Convert类型转换(三)
知识点一: 类型如果相兼容的两个变量,可以使用自动类型转化或者强制类型转换,但是,如果两个变量不兼容,比如说String和int或者String和Double类型,这个时候我们就需要一种名叫conve ...
- Servlet乱码问题解决
对于请求参数的编码处理基本上分为get和post两种情况. 1.POST index.html <!DOCTYPE html> <head> <meta http-equ ...