背景: 

    测试部署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.的更多相关文章

  1. CentOS修改IP地址及关闭/打开防火墙

    1.CentOS修改IP地址: # ifconfig eth0 192.168.1.80 这样就把IP地址修改为192.168.1.80(如果发现上不了网 了,那么你可能需要把网关和DNS也改一下,后 ...

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

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

  4. Linux关闭打开防火墙命令

    Linux下打开和关闭防火墙 1.及时生效,重启后复原 关闭:service iptables stop  开启:service iptalbes start  查看状态:service iptabl ...

  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 关闭firewall防火墙启用iptables防火墙

    一.关闭firewall防火墙 1.停止firewall systemctl stop firewalld.service 2.禁止firewall开机启动 systemctl disable fir ...

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

  8. (转)CentOS 7.0关闭默认防火墙启用iptables防火墙

    场景:在本地虚拟机上使用ftp软件需要进行相应的端口设置,不可避免要访问Cnetos的防火墙,默认firewall操作不方便,所以需要进行相应的替换. 1 配置防火墙,开启80端口.3306端口 1. ...

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

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

随机推荐

  1. python super()函数:调用父类的构造方法

    python子类会继承父类所有的类属性和类方法.严格来说,类的构造方法其实就是实例方法,因此,父类的构造方法,子类同样会继承. 我们知道,python是一门支持多继承的面向对象编程语言,如果子类继承的 ...

  2. .net Core Autofac稍微高级一点的方法

    前情摘要 前段时间写了autofac的注入但是每次都需要去修改startup这应该不是大家想要的. 至少不是我想要的. 网上有朋友说可以创建一个基础类来时间. 好了吹牛时间结束我们开始干点正事. 创建 ...

  3. [bzoj1041] [洛谷P2508] [HAOI2008] 圆上的整点

    Description 求一个给定的圆(x^2+y^2=r^2),在圆周上有多少个点的坐标是整数. Input 只有一个正整数n,n<=2000 000 000 Output 整点个数 Samp ...

  4. 大叔 Frameworks.Entity.Core 2 PageList

    Frameworks.Entity.Core\Commons\PageList\ 1 分页通用类 ListPageList<T> 继承  PageListBase<T>, IP ...

  5. 20191216 GXOI 2019模拟赛 逼死强迫症

    题目传送门 分析: sb矩阵加速推一辈子... 想了1个小时,结果好像还和标准答案的方法不一样诶... 标算解法: 老套路,对于新加入的一列,考虑它与目前最后一列的关系 我们可以列出四种方案: 其中前 ...

  6. CSS中的定位体系

    一.概述     1.什么是定位体系     视觉格式化模型规定,定位体系共有三种             a.常规流(normal flow)             b.浮动(float)     ...

  7. Java常见问题汇总

    1.String,StringBuffer,StringBulider的区别及应用场景 2.Servlet生命周期 3.向上转型与向下转型 4.Java的多态性 5.重写和重载的区别 6.深拷贝和浅拷 ...

  8. 学习记录(安装Scala)

    安装完spark之后根据教程安装Scala,在安装的时候提出警告,等了好长时间之后发现无法下载,最后搜索之后发现1.8版本的jdk无法安装,今天又重装了jdk换成了1.7.0的openjdk jdk安 ...

  9. mysql笔记(暂时)

    2018-05-28 create table cms_user(id int key auto_increment,username varchar(20),password varchar(20) ...

  10. Java集合XMind与注意事项

    Java中集合使用时的几个注意事项: 1.ArrayList和HashMap都具有扩容 ArrayList初始化数组长度为10,扩容后的容量为原来的1.5倍. HashMap初始化的数组长度为16,扩 ...