0
点赞
收藏
分享

微信扫一扫

Unit iptables.service could not be found

科牛 2022-01-23 阅读 116

Unit iptables.service could not be found

Centos7 以后都用 firewalld 取代了 iptables ,systemctl取代了service

首先要检查自己的虚拟机的版本是 6还是7

起初我错误的把CentOS6的命令套用在7上,出现了以下错误

查看防火墙状态时候出现

Redirecting to /bin/systemctl status iptables.service
Unit iptables.service could not be found.

在这里插入图片描述

实际上CentOS7的命令已经更新了

1、查看防火墙状态

systemctl status firewalld.service

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-nJepPqPe-1642944315805)(../../source/images/Unit%20iptables.service%20could%20not%20be%20found/image-20220123211937798.png)]

如果出现绿色的标注 “active(running)”,说明防火墙是开启状态

2、开启防火墙

systemctl start firewalld.service

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-L3EtnCwx-1642944315806)(../../source/images/Unit%20iptables.service%20could%20not%20be%20found/image-20220123212305542.png)]

3、关闭防火墙

systemctl stop firewalld.service 

并检查一下防火墙状态

systemctl status firewalld.service

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-aiWnNADb-1642944315806)(../../source/images/Unit%20iptables.service%20could%20not%20be%20found/image-20220123212401591.png)]

举报

相关推荐

0 条评论