<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>twam.info &#187; iptables</title>
	<atom:link href="http://www.twam.info/tag/iptables/feed" rel="self" type="application/rss+xml" />
	<link>http://www.twam.info</link>
	<description>My computer, physics, electronics &#38; photography blog</description>
	<lastBuildDate>Wed, 25 Jan 2012 20:49:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>commenting iptables rules</title>
		<link>http://www.twam.info/linux/commenting-iptables-rules</link>
		<comments>http://www.twam.info/linux/commenting-iptables-rules#comments</comments>
		<pubDate>Tue, 07 Apr 2009 13:29:04 +0000</pubDate>
		<dc:creator>twam</dc:creator>
				<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Network/Web]]></category>
		<category><![CDATA[iptables]]></category>

		<guid isPermaLink="false">http://www.twam.info/?p=232</guid>
		<description><![CDATA[I often use iptables (or ip6tables, the IPv6 version of iptables) to implemented firewall rules on my linux systems. In earlier times I used a commented bash script to setup the rules after booting, but using Gentoo nowadays there is a nice init script saving and restoring my tables. Using this I stopped commenting the [...]]]></description>
			<content:encoded><![CDATA[<p>I often use iptables (or ip6tables, the IPv6 version of iptables) to implemented firewall rules on my linux systems.</p>
<p>In earlier times I used a commented bash script to setup the rules after booting, but using Gentoo nowadays there is a nice init script saving and restoring my tables. Using this I stopped commenting the firewall rules, but yesterday I found a very nice solution for this problem.</p>
<p>Iptables has a special &#8220;match&#8221; for comments. <span id="more-232"></span>You have to enable it in your kernel config like</p>
<pre>  [*] Networking support  ---&gt;
     Networking options
        [*] Network packet filtering framework (Netfilter)  ---&gt;
           Core Netfilter Configuration  ---&gt;
              -*- Netfilter Xtables support (required for ip_tables)
              &lt;*&gt;   "comment" match support</pre>
<p>or as a module.</p>
<p>Then you&#8217;re able to add rules like</p>
<pre>iptables -A INPUT -m state --state RELATED,ESTABLISHED \
  -m comment --comment "allow all established connections" -j ACCEPT</pre>
<p>And if you list your rules you get something like</p>
<pre>Chain INPUT (policy DROP)
target  prot opt source     destination
ACCEPT  all  --  anywhere   anywhere   state RELATED,ESTABLISHED
                                       /* allow all established connections */</pre>
<p>It&#8217;s a pity that I never saw this in any iptables tutorials.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.twam.info/linux/commenting-iptables-rules/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

