当前位置:   article > 正文

centos7 iptables-save_service iptables save

service iptables save

1.任意运行一条iptables防火墙规则配置命令:

iptables -P OUTPUT ACCEPT

2.对iptables服务进行保存:

service iptables save

如果上述命令执行失败报出:The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, force-reload, status). For other actions, please try to use systemctl.

解决方法:

  1. systemctl stop firewalld 关闭防火墙
  2. yum install iptables-services 安装或更新服务再使用
  3. systemctl enable iptables 启动iptables
  4. 最后 systemctl start iptables 打开iptables
  5. 再执行service iptables save

3.重启iptables服务:

service iptables restart

执行完毕之后/etc/syscofig/iptables文件就有了

代码:

  1. systemctl stop firewalld
  2. yum -y install iptables-services
  3. systemctl enable iptables
  4. systemctl start iptables
  5. service iptables save
  6. service iptables restart

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

闽ICP备14008679号