<?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/"
> <channel><title>Comments on: Ubuntu Linux Save / Restore Iptables Rules</title> <atom:link href="http://www.cyberciti.biz/faq/how-to-save-restore-iptables-firewall-config-ubuntu/feed/" rel="self" type="application/rss+xml" /><link>http://www.cyberciti.biz/faq/how-to-save-restore-iptables-firewall-config-ubuntu/</link> <description>Every answer asks a more beautiful question.</description> <lastBuildDate>Fri, 10 Feb 2012 19:55:56 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>By: budacsik</title><link>http://www.cyberciti.biz/faq/how-to-save-restore-iptables-firewall-config-ubuntu/#comment-45734</link> <dc:creator>budacsik</dc:creator> <pubDate>Fri, 29 Jan 2010 07:29:22 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=4197#comment-45734</guid> <description>Salvador:
You are right! Sorry for mistake.
(I&#039;m sorry, but I can&#039;t edit it.)</description> <content:encoded><![CDATA[<p>Salvador:<br
/> You are right! Sorry for mistake.</p><p>(I&#8217;m sorry, but I can&#8217;t edit it.)</p> ]]></content:encoded> </item> <item><title>By: Salvador</title><link>http://www.cyberciti.biz/faq/how-to-save-restore-iptables-firewall-config-ubuntu/#comment-45731</link> <dc:creator>Salvador</dc:creator> <pubDate>Fri, 29 Jan 2010 00:17:57 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=4197#comment-45731</guid> <description>budacsik:
You made a little mistake in the line:
pre-up iptables-restore /etc/iptables.rules
it must be:
pre-up iptables-restore &lt; /etc/iptables.rules</description> <content:encoded><![CDATA[<p>budacsik:</p><p>You made a little mistake in the line:<br
/> pre-up iptables-restore /etc/iptables.rules</p><p>it must be:<br
/> pre-up iptables-restore &lt; /etc/iptables.rules</p> ]]></content:encoded> </item> <item><title>By: badwolf</title><link>http://www.cyberciti.biz/faq/how-to-save-restore-iptables-firewall-config-ubuntu/#comment-42459</link> <dc:creator>badwolf</dc:creator> <pubDate>Fri, 10 Jul 2009 12:27:45 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=4197#comment-42459</guid> <description>One other way of safeguarding yourself when you modify iptables via ssh is (before you start fiddling around ;-) )to set a cron job to reset the firewall rules every say 15 minutes. That way you only have to wait at most 15 minutes to get back into your machine. Don&#039;t forget to disable the cron job when you are finished. This presumes that you have root/sudo access to be able to set the cron and run iptables-restore as super user.
Thanks for the info.</description> <content:encoded><![CDATA[<p>One other way of safeguarding yourself when you modify iptables via ssh is (before you start fiddling around ;-) )to set a cron job to reset the firewall rules every say 15 minutes. That way you only have to wait at most 15 minutes to get back into your machine. Don&#8217;t forget to disable the cron job when you are finished. This presumes that you have root/sudo access to be able to set the cron and run iptables-restore as super user.<br
/> Thanks for the info.</p> ]]></content:encoded> </item> <item><title>By: budacsik</title><link>http://www.cyberciti.biz/faq/how-to-save-restore-iptables-firewall-config-ubuntu/#comment-42332</link> <dc:creator>budacsik</dc:creator> <pubDate>Wed, 01 Jul 2009 10:14:17 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=4197#comment-42332</guid> <description>tip:
iptables auto on/off
1.)
Run in terminal the next command:
sudo iptables-save &gt; /etc/iptables.rules
2.) Edit /etc/network/interfaces file and add this two line to interface configuration:
pre-up iptables-restore  /etc/iptables.rules
To sum:
auto eth1
iface eth1 inet static
address 192.168.2.1
network 255.255.255.0
broadcast 192.168.2.255
pre-up iptables-restore  /etc/iptables.rules
3.) Save and test (reboot)</description> <content:encoded><![CDATA[<p>tip:<br
/> iptables auto on/off</p><p>1.)<br
/> Run in terminal the next command:<br
/> sudo iptables-save &gt; /etc/iptables.rules</p><p>2.) Edit /etc/network/interfaces file and add this two line to interface configuration:<br
/> pre-up iptables-restore  /etc/iptables.rules</p><p>To sum:</p><p>auto eth1<br
/> iface eth1 inet static<br
/> address 192.168.2.1<br
/> network 255.255.255.0<br
/> broadcast 192.168.2.255<br
/> pre-up iptables-restore  /etc/iptables.rules</p><p>3.) Save and test (reboot)</p> ]]></content:encoded> </item> <item><title>By: Joost</title><link>http://www.cyberciti.biz/faq/how-to-save-restore-iptables-firewall-config-ubuntu/#comment-42258</link> <dc:creator>Joost</dc:creator> <pubDate>Fri, 26 Jun 2009 16:08:47 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=4197#comment-42258</guid> <description>Be carefull if you change your iptables file remotely (via ssh). A mistake might lock you out.
In that case it is safer to use iptables-apply. It changes the iptables, but gives you a prompt to confirm the change. If the change locked you out, it will revert to the previous ruleset.
So change the /root/working.iptables.rules file, and use:
iptables-apply -t 15 /root/working.iptables.rules
You have 15 seconds to accept the change.
Only works on newer versions of iptables (Ubuntu jaunty in my case).</description> <content:encoded><![CDATA[<p>Be carefull if you change your iptables file remotely (via ssh). A mistake might lock you out.<br
/> In that case it is safer to use iptables-apply. It changes the iptables, but gives you a prompt to confirm the change. If the change locked you out, it will revert to the previous ruleset.<br
/> So change the /root/working.iptables.rules file, and use:</p><p>iptables-apply -t 15 /root/working.iptables.rules</p><p>You have 15 seconds to accept the change.<br
/> Only works on newer versions of iptables (Ubuntu jaunty in my case).</p> ]]></content:encoded> </item> <item><title>By: Vivek Gite</title><link>http://www.cyberciti.biz/faq/how-to-save-restore-iptables-firewall-config-ubuntu/#comment-42225</link> <dc:creator>Vivek Gite</dc:creator> <pubDate>Wed, 24 Jun 2009 15:45:27 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=4197#comment-42225</guid> <description>@Mike, Excellent tip. I never thought about it.
@Michael, yes it works on all Linux distro.
Appropriate your posts!</description> <content:encoded><![CDATA[<p>@Mike, Excellent tip. I never thought about it.</p><p>@Michael, yes it works on all Linux distro.</p><p>Appropriate your posts!</p> ]]></content:encoded> </item> <item><title>By: Mike</title><link>http://www.cyberciti.biz/faq/how-to-save-restore-iptables-firewall-config-ubuntu/#comment-42224</link> <dc:creator>Mike</dc:creator> <pubDate>Wed, 24 Jun 2009 15:23:12 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=4197#comment-42224</guid> <description>Thanks
Here&#039;s another little tip. If you add a shebang line to the top of the saved iptables file like &quot;#!/usr/bin/env iptables-restore&quot; and make it executable (chmod +x) you can then just execute the saved firewall rules like so ./my-firewall</description> <content:encoded><![CDATA[<p>Thanks</p><p>Here&#8217;s another little tip. If you add a shebang line to the top of the saved iptables file like &#8220;#!/usr/bin/env iptables-restore&#8221; and make it executable (chmod +x) you can then just execute the saved firewall rules like so ./my-firewall</p> ]]></content:encoded> </item> <item><title>By: Michael</title><link>http://www.cyberciti.biz/faq/how-to-save-restore-iptables-firewall-config-ubuntu/#comment-42223</link> <dc:creator>Michael</dc:creator> <pubDate>Wed, 24 Jun 2009 14:40:52 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=4197#comment-42223</guid> <description>Thanks for the tip!
Not only useful for Ubuntu users!</description> <content:encoded><![CDATA[<p>Thanks for the tip!<br
/> Not only useful for Ubuntu users!</p> ]]></content:encoded> </item> </channel> </rss>
