<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Iptables | Chia-An Lee</title><link>https://calee0219.github.io/tag/iptables/</link><atom:link href="https://calee0219.github.io/tag/iptables/index.xml" rel="self" type="application/rss+xml"/><description>Iptables</description><generator>HugoBlox Kit (https://hugoblox.com)</generator><language>en-us</language><copyright>©</copyright><lastBuildDate>Mon, 09 Aug 2021 07:48:37 +0800</lastBuildDate><image><url>https://calee0219.github.io/media/icon_hu_da05098ef60dc2e7.png</url><title>Iptables</title><link>https://calee0219.github.io/tag/iptables/</link></image><item><title>iptables 使用小記</title><link>https://calee0219.github.io/blog/note_iptables/</link><pubDate>Mon, 09 Aug 2021 07:48:37 +0800</pubDate><guid>https://calee0219.github.io/blog/note_iptables/</guid><description>&lt;h2 id="iptables"&gt;iptables&lt;/h2&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;iptables [-t table] &lt;code&gt;command&lt;/code&gt; &lt;code&gt;CHAIN&lt;/code&gt; [NUM] match criteria -j ACTION&lt;/li&gt;
&lt;li&gt;&lt;code&gt;CHAIN&lt;/code&gt;
&lt;ul&gt;
&lt;li&gt;-N: (new) new a chain&lt;/li&gt;
&lt;li&gt;-X: delete chain&lt;/li&gt;
&lt;li&gt;-F: flush all chain&lt;/li&gt;
&lt;li&gt;-Z: zero the pkg counter&lt;/li&gt;
&lt;li&gt;-P: policy of chain&lt;/li&gt;
&lt;li&gt;-E: rename&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;rule
&lt;ul&gt;
&lt;li&gt;-A: append rule&lt;/li&gt;
&lt;li&gt;-I: insert rule to number&lt;/li&gt;
&lt;li&gt;-R: replace&lt;/li&gt;
&lt;li&gt;-D: delete&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;LIST
&lt;ul&gt;
&lt;li&gt;-L: list&lt;/li&gt;
&lt;li&gt;-S: Specification&lt;/li&gt;
&lt;li&gt;-n: user number to show&lt;/li&gt;
&lt;li&gt;-v: verbose&lt;/li&gt;
&lt;li&gt;-x: show msg&lt;/li&gt;
&lt;li&gt;&amp;ndash;line number: show line number&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="dst-nat"&gt;DST-NAT&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo sysctl net.ipv4.ip_forward=1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo iptables -t nat -A PREROUTING -j DNAT -p tcp --to-destination 192.168.15.254:80 -i ens19
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item></channel></rss>