zoukankan      html  css  js  c++  java
  • 解决 service iptables save 报错 please try to use systemctl

    本文档根据 service iptables save 报错 please try to use systemctl 提供解决方案。报错

    [root@Jaking ~]# 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.

    解决方法停止 firewalld

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

    安装 iptables-services

    [root@Jaking ~]# yum install -y iptables-services

    开启 iptables

    [root@Jaking ~]# service iptables start
    Redirecting to /bin/systemctl start iptables.service

    还可以使用 systemctl 来控制 iptables

    systemctl [start|status|stop|restart|enable] iptables

    把 iptables 加到开机启动项中

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

    清空防火墙

    [root@Jaking ~]# iptables -F

    保存防火墙规则

    [root@Jaking ~]# service iptables save
    iptables: Saving firewall rules to /etc/sysconfig/iptables: [ OK ]
    # 或者
    [root@Jaking ~]# /usr/libexec/iptables/iptables.init save
    iptables: Saving firewall rules to /etc/sysconfig/iptables: [ OK ]
  • 相关阅读:
    luogu P1415 拆分数列 序列DP
    [HAOI2015]树上操作
    [SHOI2012]魔法树
    [SCOI2010]连续攻击游戏
    [NOI2016]区间
    简单数论(一)
    iermu爱耳目
    李宇春:会跳舞的文艺青年
    文峰塔很安祥
    技术宅之flappy bird 二逼鸟
  • 原文地址:https://www.cnblogs.com/cheyunhua/p/11320626.html
Copyright © 2011-2022 走看看