当前位置:   article > 正文

解决service iptables save出错

service iptables save

原因:CentOS 7.x开始,CentOS开始使用systemd服务来代替daemon,原来管理系统启动和管理系统服务的相关命令全部由systemctl命令来代替。service命令只保留下了极少部分使用,大部分命令都要改用systemctl使用。

首先停止防火墙

 

1.systemctl stop firewalld

 

2.systemctl mask firewalld

然后安装iptables-services

 

3.yum install iptables-services

设置开机启动防火墙

 

4.systemctl enable iptables

可以使用下面命令管理iptables

 

5.systemctl [stop|start|restart] iptables

这时可以保存防火墙规则了

  1. 6.service iptables save
  2. or
  3. /usr/libexec/iptables/iptables.init save
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Guff_9hys/article/detail/888644
推荐阅读
相关标签
  

闽ICP备14008679号