本文档根据 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 ]

解决 service iptables save 报错 please try to use systemctl的更多相关文章

  1. 3.centos 7执行service iptables save报错问题

    1.报错 [root@localhost ~]# service iptables save The service command supports only basic LSB actions ( ...

  2. CentOS7 执行 service iptables save 报错 The service command supports only basic LSB actions xxxxxx

    现象描述 在 CentOS 7.6.1810 下执行 service iptables save 命令,出现如下错误: [root@test ~]# service iptables save The ...

  3. centos7 service iptables save 报错

    解决办法: 1.systemctl stop firewalld 2.yum install iptables-services 3.systemctl  restart iptables 4.ser ...

  4. 防火墙centos7执行 service iptables status报错问题完美解决

    在centos7 执行防火墙命令时 service iptables status 报错如下: 解决方案 : 1.systemctl start firewalld.service(开启防火墙) 2. ...

  5. 解决service iptables save出错please try to use systemctl

    # service iptables save The service command supports only basic LSB actions (start, stop, restart, t ...

  6. 31-1.解决service iptables save出错

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

  7. 新装云服务器没有iptables 文件,并且无法通过service iptables save操作

    在安装zookeeper时,需要放开端口2181 按照视频教程在 /etc/sysconfig/ 下对iptables 文件进行编辑,但是该目录下没有此文件 通过强行写iptables -P  OUT ...

  8. centos .7x service iptables save 错误解决方案

    保存转发规则的时候,发现service iptables save 无效,而且报错[root@localhost bin]# service iptables saveThe service comm ...

  9. 解决 service iptables start 无法启动的问题

    解决方式: iptables -F  // 初始化iptables. service iptables save  // 保存 service iptables restart  // 重启

随机推荐

  1. PAT_A1059

    这是一道素数因子分解的问题: 1.先打印素数表出来,以便后期使用,素数表的大小就是10^5级别就可以,因为输入的数是long int(即就是int而已),大小最大21亿(10^10量级的),我们这里素 ...

  2. 用chrome浏览器进行前端debug和停止debug

    首先F12打开控制台: 选择"source","Ctrl+Shift+F"搜索需要debug的代码关键词(Ctrl+O根据文件名搜索): 打开需要debug的文 ...

  3. Spring Task定时任务的配置和使用详解

    spring中使用定时任务 1.基于xml配置文件使用定时任务 首先配置spring开启定时任务 <beans xmlns="http://www.springframework.or ...

  4. DevExpress20:XtraCharts控件实现图表

    一.总体概述 官方文档: https://docs.devexpress.com/WindowsForms/8117/controls-and-libraries/chart-control Char ...

  5. css 为什么给span加vertical-align: middle不起作用?

    vertical-align是什么意思?先举个例子! 这句html元素中的文本为什么不能垂直居中. <style> span{ height:60px;vertical-align: mi ...

  6. Tomcat默认连接超时时间

    秒=1小时 2. 在web.xml中通过参数指定: xml 代码 <session-config>         <session-timeout>30</sessio ...

  7. js数值的添加与删除

    js中数组元素的添加和删除 js中数组元素常用添加方法是直接添加.push方法以及unshift方法 删除方法则是delete.pop.shift 集修改方法为一身的则是splice 1.添加: (1 ...

  8. TPC-H 下载参考

    CSDN免费下载地址 tpc-h-v2.17.3.zip tools https://download.csdn.net/download/zes2014/10558251

  9. POJ 1927 Area in Triangle

    Area in Triangle Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 1674   Accepted: 821 D ...

  10. 《挑战30天C++入门极限》类的分解,抽象类与纯虚函数的需要性

        类的分解,抽象类与纯虚函数的需要性 为了不模糊概念在这里我们就简单的阐述一下类的分解,前面的教程我们着重讲述了类的继承,继承的特点就是,派生类继承基类的特性,进行//站点:www.cndev- ...