Linux学习笔记之解决 service iptables save 报错 please try to use systemctl

桃扇骨 2021-10-18 10:54 345阅读 0赞

本博客为service iptables save 报错 please try to use systemctl 提供解决方案。

报错

  1. [root@tencent ~]# service iptables save
  2. 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.

解决办法

一、停止firewalld

  1. [root@tencent ~]# systemctl stop firewalld
  2. [root@tencent ~]# systemctl mask firewalld
  3. Created symlink from /etc/systemd/system/firewalld.service to /dev/null.

二、安装iptables-services

  1. [root@tencent ~]# yum install -y iptables-services

三、开启iptables-services

  1. [root@tencent ~]# service iptables start
  2. Redirecting to /bin/systemctl start iptables.service
  3. 或者使用systemctl控制iptables
  4. systemctl [start|status|stop|restart|enable] iptables

四、将iptables加到开机启动项中

  1. [root@tencent ~]# systemctl enable iptables
  2. Created symlink from /etc/systemd/system/basic.target.wants/iptables.service to /usr/lib/systemd/system/iptables.service.

五、清空防火墙

  1. [root@tencent ~]# iptables -F

六、保存防火墙规则

发表评论

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

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

相关阅读