将iptables规则转储到标准输出
命令语法格式
iptables-save [-M modprobe] [-c] [-t table]
ip6tables-save [-M modprobe] [-c] [-t table]
命令描述
命令iptables-save和ip6tables-save用于以易于解析的格式将IPv4或IPv6表的内容转储到标准输出。 使用Shell提供的I/O重定向来写入文件。
命令支持的选项及含义
-c, –counters
输出中包含所有数据包和字节计数器的值
-M, –modprobe modprobe_program
指定modprobe程序的路径。 默认情况下,iptables-restore将检查/proc/sys/kernel/modprobe以确定可执行文件的路径。
-T, –table name
输出中只包含由name指定的表。如果未指定,则输出所有的可用的表。
相关手册
iptables-apply(8),iptables-restore(8), iptables(8)
iptables-HOWTO详细说明了更多的iptables用法;NAT-HOWTO详细介绍了NAT;netfilter-hacking-HOWTO详细介绍了内部结构。
参考文献
- man 8 iptables-save, Version 1.6.0+snapshot20161117-6
更新日志
- 09/16/2018 创建文章