iptables-save用来把当前的规则存入一个文件里以备iptables-restore使用。它的使用很简单,只有两个参数:

iptables-save [-c] [-t table]

参数-c的作用是保存包和字节计数器的值。这可以使我们在重启防火墙后不丢失对包和字节的统计。带-c参数的iptables-save命令使重启防火墙而不中断统计记数程序成为可能。这个参数默认是不使用的。
参数-t指定要保存的表,默认是保存所有的表。下面给出未装载任何规则的情况下iptables-save的输出。

iptables-restore用来装载由iptables-save保存的规则集。不幸的是,它只能从标准输入接受输入,而不能从文件接受。下面是它的事方法:

iptables-restore [-c] [-n]

参数-c要求装入包和字节计数器。如果你用iptables-save保存了计数器,现在想重新装入,就必须用这个参数。它的另一种较长的形式是--counters。
参数-n告诉iptables-restore不要覆盖已有的表或表内的规则。默认情况是清除所有已存的规则。这个参数的长形式是--noflush。

iptables-save和iptables-restore的更多相关文章

  1. centos7中没有service iptables save指令来保存防火墙规则

    1.任意运行一条iptables防火墙规则配置命令: iptables -P OUTPUT ACCEPT 2.对iptables服务进行保存: service iptables save 如果上述命令 ...

  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. How can i use iptables save on centos 7?

    I installed CentOS 7 with minimal configuration (os + dev tools). I am trying to open 80 port for ht ...

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

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

  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. centos7 中没有service iptables save指令来保存防火墙规则

    解决方法: systemctl stop firewalld  关闭防火墙yum install iptables-services 安装 iptables 服务systemctl enable ip ...

  7. 解决 service iptables save 报错 please try to use systemctl

    本文档根据 service iptables save 报错 please try to use systemctl 提供解决方案.报错 [root@Jaking ~]# service iptabl ...

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

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

  9. centos 7 中没有iptables 和service iptables save 指令使用失败问题解决方案

    1.任意运行一条iptables防火墙规则配置命令: iptables -P OUTPUT ACCEPT 2.对iptables服务进行保存: service iptables save 如果上述命令 ...

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

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

随机推荐

  1. 《Linux内核精髓:精通Linux内核必会的75个绝技》一HACK #15 ramzswap

    HACK #15 ramzswap 本节介绍将一部分内存作为交换设备使用的ramzswap.ramzswap是将一部分内存空间作为交换设备使用的基于RAM的块设备.对要换出(swapout)的页面进行 ...

  2. Mysql 开启Federated引擎以及使用

    FEDERATED是其中一个专门针对远程数据库的实现.但通过FEDERATED引擎创建的表只是在本地有表定义文件,数据文件则存在于远程数据库中通过这个引擎可以实现类似Oracle 下DBLINK的远程 ...

  3. 队列queue实例(生产者和消费者模型)

    import queue, threading, time q = queue.Queue(maxsize=10)def producter(n): count = 1 while True: q.p ...

  4. getitem, setitem, delitem (把类实例化成字典的类型)

    class Foo(object):     def __init__(self):         self.data = {} def __getitem__(self, key):        ...

  5. 淘宝开源系统监控工具Tsar

    Tsar是淘宝开发的一个非常好用的系统监控工具,在淘宝内部大量使用    它不仅可以监控CPU.IO.内存.TCP等系统状态,也可以监控Apache,Nginx/Tengine,Squid等服务器状态 ...

  6. SQL 数据库 子查询及示例

    子查询,又叫做嵌套查询. 将一个查询语句做为一个结果集供其他SQL语句使用,就像使用普通的表一样,被当作结果集的查询语句被称为子查询. 子查询有两种类型: 一种是只返回一个单值的子查询,这时它可以用在 ...

  7. centos7 端口转发

    firewall-cmd --add-masquerade   firewall-cmd --add-forward-port=port=3001:proto=tcp:toaddr=172.17.18 ...

  8. redis lua 用来传输日志

    2.8 Lua Script Redis2.6内置的Lua Script支持,可以在Redis的Server端一次过运行大量逻辑,就像存储过程一样,避免了海量中间数据在网路上的传输. Lua自称是在S ...

  9. zabbix3.2的server和zabbix-agent2.2怎么监控MySQL的办法

    zabbix官方支持监控MySQL,但直接使用默认的模板是不可用的,还需要经过额外的设置才可以使用.如果只需要对mysql数据库做简单的监控,zabbix自带的模板完全能够满足要求:如果有更高的需求那 ...

  10. Zookeeper 注册中心

    一.Zookeeper的介绍 Zookeeper是一个分布式的,开放源码的分布式应用程序协调服务,是Google的Chubby一个开源的实现,是Hadoop和Hbase的重要组件.它是一个为分布式应用 ...