当前位置:首页 » 《关于电脑》 » 正文

解决 Ubuntu20.04 中的 Unit iptables.service not found 及 Unit file iptables.service does not exist 问题

14 人参与  2024年05月09日 12:50  分类 : 《关于电脑》  评论

点击全文阅读


一. 问题描述


太困扰!!!在Ubuntu20.04中使用Iptables防火墙,无法关闭和再次开启Iptables以及查看其服务状态,永远都是在显示没有找到iptables.service服务。

# 查看状态systemctl status iptables# 关闭服务systemctl stop iptables# 开启服务systemctl start iptables

在这里插入图片描述

网上搜索资料,都说是安装iptables-services来进行管理,但是这个软件包貌似在Ubuntu20.04中已经无法被使用,完全找不到更安装不了!!!难道我每次不想用防火墙了我就得把所有规则清空吗?实在是太麻烦!!!

在这里插入图片描述

二. 解决办法


搜索国内外好多资料,终于在国外的一个论坛上面发现了答案:Ubuntu20.04中已经不支持利用iptables-services进行管理,转而使用了另一个软件包iptables-persistent进行管理,其能保存安全策略并在重新开机时读取。

下载软件包

apt-get install iptables-persistent

查看iptables状态

systemctl status iptables

在这里插入图片描述
关闭服务

systemctl stop iptables

在这里插入图片描述
开启服务

systemctl start iptables

在这里插入图片描述

搞定!!!!!


点击全文阅读


本文链接:http://zhangshiyu.com/post/105671.html

<< 上一篇 下一篇 >>

  • 评论(0)
  • 赞助本站

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

关于我们 | 我要投稿 | 免责申明

Copyright © 2020-2022 ZhangShiYu.com Rights Reserved.豫ICP备2022013469号-1