uTools-Manuals/docs/linux/iptables-save.html
2019-04-21 11:50:48 +08:00

26 lines
1.3 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<h1 id="iptables-save">iptables-save</h1>
<p>备份iptables的表配置</p>
<h2 id="补充说明">补充说明</h2>
<p><strong>iptables-save命令</strong> 用于将linux内核中的iptables表导出到标准输出设备商通常使用shell中I/O重定向功能将其输出保存到指定文件中。</p>
<h3 id="语法">语法</h3>
<pre><code class="language-bash">iptables-save(选项)</code></pre>
<h3 id="选项">选项</h3>
<pre><code class="language-bash">-c指定要保存的iptables表时保存当权的数据包计算器和字节计数器的值
-t指定要保存的表的名称。</code></pre>
<h3 id="实例">实例</h3>
<pre><code class="language-bash">[root@localhost ~]# iptables-save -t filter &gt; iptables.bak
[root@localhost ~]# cat iptables.bak
# Generated by iptables-save v1.3.5 on Thu Dec 26 21:25:15 2013
*filter
:INPUT DROP [48113:2690676]
:FORWARD accept [0:0]
:OUTPUT ACCEPT [3381959:1818595115]
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A OUTPUT -o lo -j ACCEPT
COMMIT</code></pre>
<!-- Linux命令行搜索引擎https://jaywcjlove.github.io/linux-command/ -->