<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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:series="http://unfoldingneurons.com/"
		>
<channel>
	<title>Comments on: How do I save iptables rules or settings?</title>
	<atom:link href="http://www.cyberciti.biz/faq/how-do-i-save-iptables-rules-or-settings/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cyberciti.biz/faq/how-do-i-save-iptables-rules-or-settings/</link>
	<description>Every answer asks a more beautiful question.</description>
	<lastBuildDate>Thu, 18 Mar 2010 20:15:46 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Kirk Steuber</title>
		<link>http://www.cyberciti.biz/faq/how-do-i-save-iptables-rules-or-settings/comment-page-1/#comment-42243</link>
		<dc:creator>Kirk Steuber</dc:creator>
		<pubDate>Thu, 25 Jun 2009 17:52:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.cyberciti.biz/faq/faq/how-do-i-save-iptables-rules-or-settings.php#comment-42243</guid>
		<description>This solution works well assuming one of two things:
Either:
1) You are only using rules that are compatible with the GUI firewall editor (system-config-securitylevel) 
or
2) You are not using system-config-securitylevel

system-config-securitylevel rewrites iptables without any lines it does not like (in my case, for example the rule &quot;-I &#039;RH-Firewall-1-INPUT&#039; 1 -s x.x.x.x -j ACCEPT&quot; where x.x.x.x is an ip address) - system-config-securitylevel does not support filtering by source or destination computer (for some reason)

The workaround I found for this is to:
1) create a file called /etc/sysconfig/iptables-custom
2) add the rule to the file. If you need a template for adding rules, look at your /etc/sysconfig/iptables file to see your existing rules
3) edit /etc/init.d/iptables
In the start() function there should be a line that says something like this:
&quot;$IPTABLES-restore $OPT $IPTABLES_DATA&quot;
This means to restore the rules from /etc/sysconfig/iptables
BELOW THIS RULE add a line that says 
&quot;$IPTABLES-restore -n &lt; /etc/sysconfig/iptables-custom&quot;
The -n option is important. Without it, you would overwrite all other rules and ONLY have the rules in iptables-custom (meaning system-config-securitylevel wouldn&#039;t work any more as it would edit an unused file)

The one thing to keep in mind is that updating/reinstalling iptables will likely rewrite /etc/init.d/iptables, removing the line that adds iptables-custom</description>
		<content:encoded><![CDATA[<p>This solution works well assuming one of two things:<br />
Either:<br />
1) You are only using rules that are compatible with the GUI firewall editor (system-config-securitylevel)<br />
or<br />
2) You are not using system-config-securitylevel</p>
<p>system-config-securitylevel rewrites iptables without any lines it does not like (in my case, for example the rule &#8220;-I &#8216;RH-Firewall-1-INPUT&#8217; 1 -s x.x.x.x -j ACCEPT&#8221; where x.x.x.x is an ip address) &#8211; system-config-securitylevel does not support filtering by source or destination computer (for some reason)</p>
<p>The workaround I found for this is to:<br />
1) create a file called /etc/sysconfig/iptables-custom<br />
2) add the rule to the file. If you need a template for adding rules, look at your /etc/sysconfig/iptables file to see your existing rules<br />
3) edit /etc/init.d/iptables<br />
In the start() function there should be a line that says something like this:<br />
&#8220;$IPTABLES-restore $OPT $IPTABLES_DATA&#8221;<br />
This means to restore the rules from /etc/sysconfig/iptables<br />
BELOW THIS RULE add a line that says<br />
&#8220;$IPTABLES-restore -n &lt; /etc/sysconfig/iptables-custom&quot;<br />
The -n option is important. Without it, you would overwrite all other rules and ONLY have the rules in iptables-custom (meaning system-config-securitylevel wouldn&#039;t work any more as it would edit an unused file)</p>
<p>The one thing to keep in mind is that updating/reinstalling iptables will likely rewrite /etc/init.d/iptables, removing the line that adds iptables-custom</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hitesh</title>
		<link>http://www.cyberciti.biz/faq/how-do-i-save-iptables-rules-or-settings/comment-page-1/#comment-40863</link>
		<dc:creator>Hitesh</dc:creator>
		<pubDate>Mon, 23 Mar 2009 11:38:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.cyberciti.biz/faq/faq/how-do-i-save-iptables-rules-or-settings.php#comment-40863</guid>
		<description>Gr8 Man Thanks a lot.....</description>
		<content:encoded><![CDATA[<p>Gr8 Man Thanks a lot&#8230;..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe</title>
		<link>http://www.cyberciti.biz/faq/how-do-i-save-iptables-rules-or-settings/comment-page-1/#comment-39218</link>
		<dc:creator>Joe</dc:creator>
		<pubDate>Fri, 14 Nov 2008 00:47:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.cyberciti.biz/faq/faq/how-do-i-save-iptables-rules-or-settings.php#comment-39218</guid>
		<description>On Redhat/Fedora, you can do

service iptables save

And it will write a file in /etc/sysconfig that will be read on startup if the iptables service is enabled in the current runlevel.</description>
		<content:encoded><![CDATA[<p>On Redhat/Fedora, you can do</p>
<p>service iptables save</p>
<p>And it will write a file in /etc/sysconfig that will be read on startup if the iptables service is enabled in the current runlevel.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simon Rostron</title>
		<link>http://www.cyberciti.biz/faq/how-do-i-save-iptables-rules-or-settings/comment-page-1/#comment-37577</link>
		<dc:creator>Simon Rostron</dc:creator>
		<pubDate>Thu, 06 Mar 2008 06:42:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.cyberciti.biz/faq/faq/how-do-i-save-iptables-rules-or-settings.php#comment-37577</guid>
		<description>Thank you!  This helped me out a lot.</description>
		<content:encoded><![CDATA[<p>Thank you!  This helped me out a lot.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.090 seconds -->
