CentOS 7 (Liunx)防火墙 出现Failed to start iptables.service: Unit iptables.service failed to load

谁践踏了优雅 2023-07-04 14:07 122阅读 0赞

摘要


博主在倒腾服务器配置禅道的时候遇到的CentOS 7 防火墙问题。


错误信息如下:

  1. [root]# service iptables start
  2. Redirecting to /bin/systemctl start iptables.service
  3. Failed to start iptables.service: Unit iptables.service failed to load: No such file or directory.

解决方法如下:

在CentOS 7或RHEL 7或Fedora中防火墙由firewalld来管理,当然你可以还原传统的管理方式。或则使用新的命令进行管理。

假如采用传统请执行一下命令:

  1. systemctl stop firewalld
  2. systemctl mask firewalld

并且安装iptables-services

  1. yum install iptables-services

设置开机启动:

  1. systemctl enable iptables

iptables启动、关闭、保存:

  1. systemctl [stop|start|restart] iptables
  2. #or
  3. service iptables [stop|start|restart]
  4. service iptables save
  5. #or
  6. /usr/libexec/iptables/iptables.init save

最后

  • 更多参考精彩博文请看这里:《陈永佳的博客》
  • 喜欢博主的小伙伴可以加个关注、点个赞哦,持续更新嘿嘿!

发表评论

表情:
评论列表 (有 0 条评论,122人围观)

还没有评论,来说两句吧...

相关阅读