<?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>Pario TechnoBlob &#187; iptables</title>
	<atom:link href="http://pario.no/tag/iptables/feed/" rel="self" type="application/rss+xml" />
	<link>http://pario.no</link>
	<description>A cronological documentation test project, nothing serious, really!</description>
	<lastBuildDate>Thu, 26 Apr 2012 08:18:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>iptables connection tracking table full</title>
		<link>http://pario.no/2009/10/05/iptables-connection-tracking-table-full/</link>
		<comments>http://pario.no/2009/10/05/iptables-connection-tracking-table-full/#comments</comments>
		<pubDate>Mon, 05 Oct 2009 08:48:47 +0000</pubDate>
		<dc:creator>Hans-Henry Jakobsen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[ubuntu jaunty]]></category>

		<guid isPermaLink="false">http://pario.no/?p=1217</guid>
		<description><![CDATA[I&#8217;ve recently experienced that my workstation (Ubuntu Jaunty Jackalope, 9.04, x86_64) &#8220;hangs&#8221; periodically when my internet browser, Mozilla Firefox, has a lot of active tabs. In my case I had > 100 active tabs in more than 20 windows. I know I should have closed some of them but that is not an option right [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently experienced that my workstation (Ubuntu Jaunty Jackalope, 9.04, x86_64) &#8220;hangs&#8221; periodically when my internet browser, Mozilla Firefox, has a lot of active tabs.<br />
In my case I had > 100 active tabs in more than 20 windows. I know I should have closed some of them but that is not an option right now.</p>
<p>The problem reveiled itself doing a dmesg on my workstation</p>
<pre>
# dmesg

[1737157.057528] nf_conntrack: table full, dropping packet.
[1737157.160357] nf_conntrack: table full, dropping packet.
[1737157.260534] nf_conntrack: table full, dropping packet.
[1737157.361837] nf_conntrack: table full, dropping packet.
[1737157.462305] nf_conntrack: table full, dropping packet.
[1737157.564270] nf_conntrack: table full, dropping packet.
[1737157.666836] nf_conntrack: table full, dropping packet.
[1737157.767348] nf_conntrack: table full, dropping packet.
[1737157.868338] nf_conntrack: table full, dropping packet.
[1737157.969828] nf_conntrack: table full, dropping packet.
[1737162.214064] __ratelimit: 53 callbacks suppressed
</pre>
<p>This bahaviour looks like Denial-Of-Service and is caused by a full iptables connection_table.</p>
<p>The default size of the iptables connection tracing table is </p>
<pre>
# cat /proc/sys/net/ipv4/netfilter/ip_conntrack_max
65536</pre>
<p>The solution I went for was to double the size of connection table to 131072 and restarted firefox.</p>
<pre>
# echo "131072" > /proc/sys/net/ipv4/netfilter/ip_conntrack_max</pre>
<p>This value is a 32-bit integer so the table size can be quite large and you will need much more RAM before you can use this size.</p>
<p>To make this solution permanent I added the following line to <strong>/etc/sysctl.conf</strong></p>
<pre>
net.ipv4.netfilter.ip_conntrack_max = 131072</pre>
<p>You can test this by executing the following command </p>
<pre>
# sysctl -p
131072</pre>
<p>This command loads the <strong>/etc/sysctl.conf</strong> settings.</p>
<script type="text/javascript">var wordpress_toolbar_urls = [];var wordpress_toolbar_url = "http://pario.no/wp-content/plugins/wordpress-toolbar/toolbar.php";var wordpress_toolbar_oinw = "n";var wordpress_toolbar_hash = "aHR0cDovL3BhcmlvLm5vLzIwMDkvMTAvMDUvaXB0YWJsZXMtY29ubmVjdGlvbi10cmFja2luZy10YWJsZS1mdWxsLzx3cHRiPmlwdGFibGVzIGNvbm5lY3Rpb24gdHJhY2tpbmcgdGFibGUgZnVsbDx3cHRiPmh0dHA6Ly9wYXJpby5ubzx3cHRiPlBhcmlvIFRlY2hub0Jsb2I%3D";</script>]]></content:encoded>
			<wfw:commentRss>http://pario.no/2009/10/05/iptables-connection-tracking-table-full/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ufw and IP masquerading</title>
		<link>http://pario.no/2009/05/24/ufw-and-ip-masquerading/</link>
		<comments>http://pario.no/2009/05/24/ufw-and-ip-masquerading/#comments</comments>
		<pubDate>Sat, 23 May 2009 22:45:53 +0000</pubDate>
		<dc:creator>Hans-Henry Jakobsen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[8.10]]></category>
		<category><![CDATA[9.04]]></category>
		<category><![CDATA[IP masquerading]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[ufw]]></category>

		<guid isPermaLink="false">http://pario.no/?p=1059</guid>
		<description><![CDATA[I&#8217;ve just upgraded my home server from Ubuntu 8.10 to 9.04 and experienced that my ufw firewall (iptables) would not route traffic from my local network to the Internet. My IP masquerading was not working anymore and since I had not documented the process when I set it up I had to search the Ubuntu [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just upgraded my home server from Ubuntu 8.10 to 9.04 and experienced that my ufw firewall (iptables) would not route traffic from my local network to the Internet. My IP masquerading was not working anymore and since I had not documented the process when I set it up I had to search the Ubuntu pages to find the solution and came up with this.</p>
<blockquote><p>The purpose of IP Masquerading is to allow machines with private, non-routable IP addresses on your network to access the Internet through the machine doing the masquerading. Traffic from your private network destined for the Internet must be manipulated for replies to be routable back to the machine that made the request. To do this, the kernel must modify the <strong>source</strong> IP address of each packet so that replies will be routed back to it, rather than to the private IP address that made the request, which is impossible over the Internet. Linux uses <strong>Connection Tracking</strong> (conntrack) to keep track of which connections belong to which machines and reroute each return packet accordingly. Traffic leaving your private network is thus &#8220;masqueraded&#8221; as having originated from your Ubuntu gateway machine. This process is referred to in Microsoft documentation as Internet Connection Sharing.</p>
<h4>ufw Masquerading</h4>
<p>IP Masquerading can be achieved using custom <strong>ufw</strong> rules. This is possible because the current back-end for <strong>ufw</strong> is <strong>iptables-restore</strong> with the rules files located in</p>
<pre>/etc/ufw/*.rules</pre>
<p>These files are a great place to add legacy iptables rules used without <strong>ufw</strong>, and rules that are more network gateway or bridge related.</p>
<p>The rules are split into two different files, rules that should be executed before <strong>ufw</strong> command line rules, and rules that are executed after <strong>ufw</strong> command line rules.</p>
<ul>
<li>First, packet forwarding needs to be enabled in <strong>ufw</strong>. Two configuration files will need to be adjusted, in <strong>/etc/default/ufw</strong> change the
<pre>DEFAULT_FORWARD_POLICY</pre>
<p>to “<strong>ACCEPT</strong>”:</p>
<pre>DEFAULT_FORWARD_POLICY="ACCEPT"</pre>
<p>Then edit <strong>/etc/ufw/sysctl.conf</strong> and uncomment:</p>
<pre>net.ipv4.ip_forward=1</pre>
<p>Similarly, for IPv6 forwarding uncomment:</p>
<pre>net.ipv6.conf.default.forwarding=1</pre>
</li>
<li>Now we will add rules to the <strong>/etc/ufw/before.rules</strong> file. The default rules only configure the <strong>filter</strong> table, and to enable masquerading the <strong>nat</strong> table will need to be configured.  Add the following to the top of the file just after the header comments:
<pre># nat Table rules
*nat
:POSTROUTING ACCEPT [0:0]

# Forward traffic from eth1 through eth0.
-A POSTROUTING -s 192.168.0.0/24 -o eth0 -j MASQUERADE

# don't delete the 'COMMIT' line or these nat table rules won't be processed
COMMIT</pre>
<p>The comments are not strictly necessary, but it is considered good practice to document your configuration. Also, when modifying any of the <strong>rules</strong> files in <strong>/etc/ufw</strong>, make sure these lines are the last line for each table modified:</p>
<pre># don't delete the 'COMMIT' line or these rules won't be processed
COMMIT</pre>
<p>For each <strong>Table</strong> a corresponding <strong>COMMIT</strong> statement is required. In these examples only the <strong>nat</strong> and <strong>filter</strong> tables are shown, but you can also add rules for the <strong>raw</strong> and <strong>mangle</strong> tables.</p>
<table border="0" summary="Note">
<tbody>
<tr>
<td rowspan="2" width="25" align="center" valign="top"><img src="https://help.ubuntu.com/9.04/libs/admon/note.png" alt="[Note]" /></td>
<th align="left"></th>
</tr>
<tr>
<td align="left" valign="top">In the above example replace <strong>eth0</strong>, <strong>eth1</strong>, and <strong>192.168.0.0/24</strong> with the appropriate interfaces and IP range for your network.</td>
</tr>
</tbody>
</table>
</li>
<li>Finally, disable and re-enable <strong>ufw</strong> to apply the changes:
<pre>sudo ufw disable &amp;&amp; sudo ufw enable</pre>
</li>
</ul>
<p>IP Masquerading should now be enabled. You can also add any additional FORWARD rules to the <strong>/etc/ufw/before.rules</strong>. It is recommended that these additional rules be added to the <strong>ufw-before-forward</strong> chain.</p></blockquote>
<p>Source: <a href="https://help.ubuntu.com/9.04/serverguide/C/firewall.html">https://help.ubuntu.com/9.04/serverguide/C/firewall.html</a></p>
<script type="text/javascript">var wordpress_toolbar_urls = ["https:\/\/help.ubuntu.com\/9.04\/serverguide\/C\/firewall.html"];var wordpress_toolbar_url = "http://pario.no/wp-content/plugins/wordpress-toolbar/toolbar.php";var wordpress_toolbar_oinw = "n";var wordpress_toolbar_hash = "aHR0cDovL3BhcmlvLm5vLzIwMDkvMDUvMjQvdWZ3LWFuZC1pcC1tYXNxdWVyYWRpbmcvPHdwdGI%2BdWZ3IGFuZCBJUCBtYXNxdWVyYWRpbmc8d3B0Yj5odHRwOi8vcGFyaW8ubm88d3B0Yj5QYXJpbyBUZWNobm9CbG9i";</script>]]></content:encoded>
			<wfw:commentRss>http://pario.no/2009/05/24/ufw-and-ip-masquerading/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Some iptables tricks</title>
		<link>http://pario.no/2008/05/27/some-iptables-tricks/</link>
		<comments>http://pario.no/2008/05/27/some-iptables-tricks/#comments</comments>
		<pubDate>Tue, 27 May 2008 22:17:31 +0000</pubDate>
		<dc:creator>Hans-Henry Jakobsen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[iptables]]></category>

		<guid isPermaLink="false">http://pario.no/?p=457</guid>
		<description><![CDATA[Multiport The Multiport extension allows you to specify multiple ports and ranges and makes it possible to create complex rules in one line. Here&#8217;s an example of how you can allow SSH, Web, IMAP and X terminal traffic iptables -A INPUT -p tcp -m multiport --dports 22,80,143,6000:6003 -j ACCEPT The alternative to using this rule [...]]]></description>
			<content:encoded><![CDATA[<h2>Multiport</h2>
<p>The <strong>Multiport</strong> extension allows you to specify multiple ports and ranges and makes it possible to create complex rules in one line. Here&#8217;s an example of how you can allow SSH, Web, IMAP and X terminal traffic </p>
<pre>
iptables -A INPUT -p tcp -m multiport --dports 22,80,143,6000:6003 -j ACCEPT</pre>
<p>The alternative to using this rule would be</p>
<pre>
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
iptables -A INPUT -p tcp --dport 143 -j ACCEPT
iptables -A INPUT -p tcp --dport 6000:6003 -j ACCEPT</pre>
<p>The multiport directive saves you a lot of lines to maintain and requires less system processing.</p>
<script type="text/javascript">var wordpress_toolbar_urls = [];var wordpress_toolbar_url = "http://pario.no/wp-content/plugins/wordpress-toolbar/toolbar.php";var wordpress_toolbar_oinw = "n";var wordpress_toolbar_hash = "aHR0cDovL3BhcmlvLm5vLzIwMDgvMDUvMjcvc29tZS1pcHRhYmxlcy10cmlja3MvPHdwdGI%2BU29tZSBpcHRhYmxlcyB0cmlja3M8d3B0Yj5odHRwOi8vcGFyaW8ubm88d3B0Yj5QYXJpbyBUZWNobm9CbG9i";</script>]]></content:encoded>
			<wfw:commentRss>http://pario.no/2008/05/27/some-iptables-tricks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using ufw / iptables in Ubuntu 8.04 LTS</title>
		<link>http://pario.no/2008/05/21/using-ufw-iptables-in-ubuntu-804-lts/</link>
		<comments>http://pario.no/2008/05/21/using-ufw-iptables-in-ubuntu-804-lts/#comments</comments>
		<pubDate>Wed, 21 May 2008 20:34:30 +0000</pubDate>
		<dc:creator>Hans-Henry Jakobsen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[ufw]]></category>

		<guid isPermaLink="false">http://pario.no/?p=456</guid>
		<description><![CDATA[ufw (Uncomplicated Firewall) is a new and easy firewall/iptables tool introduced in Ubuntu 8.04 LTS (Hardy Heron). ufw is a front-end for iptables-restore, with its rules saved in /etc/ufw/before.rules, /etc/ufw/after.rules and /var/lib/ufw/user.rules. Administrators can customize before.rules and after.rules as desired using the standard iptables-restore syntax. Rules are evaluated as follows: before.rules first, user.rules next, and [...]]]></description>
			<content:encoded><![CDATA[<p><strong>ufw</strong> (Uncomplicated Firewall) is a new and easy firewall/iptables tool introduced in Ubuntu 8.04 LTS (Hardy Heron).</p>
<p>ufw is a front-end for iptables-restore, with its rules saved in <strong>/etc/ufw/before.rules</strong>, <strong>/etc/ufw/after.rules</strong> and <strong>/var/lib/ufw/user.rules</strong>. Administrators can customize before.rules and after.rules as desired using the standard <strong>iptables-restore</strong> syntax. Rules are evaluated as follows: before.rules first, user.rules next, and after.rules last. IPv6 rules are evaluated in the same way, with the rules files named before6.rules, user6.rules and after6.rules.</p>
<p>Please note that ufw status only shows rules added with ufw and not the rules found in the /etc/ufw rules files.</p>
<p>This is a simple example to create a firewall that has a default deny rule and we explicitly tell it what services we would like to allow, like SSH. The order that you type the following commands are vital and should not be changed unless you know what you are doing or you&#8217;re not working towards your machine through network/SSH.</p>
<p>Turn on firewall logging</p>
<pre># ufw logging on</pre>
<p>Default rule value for the firewall is DENY</p>
<pre># ufw default deny</pre>
<p>Allow SSH traffic</p>
<pre># ufw allow ssh/tcp</pre>
<p>Start firewall</p>
<pre># ufw enable</pre>
<p>You can now check the status of your new firewall</p>
<pre># ufw status

Firewall loaded

To                         Action  From
--                         ------  ----
22:tcp                     ALLOW   Anywhere</pre>
<p>We can see that port 22 (SSH) is allowed from everywhere. ufw status only shows rules added with ufw and not the rules found in the /etc/ufw rules files.</p>
<p>Deleting a rule</p>
<pre>
# ufw delete allow ssh/tcp</pre>
<p>You just put a delete in front of the rule you would like to delete.</p>
<p>Limit access to port 22/SSH from subnet 192.168.0.0/255.255.255.0 </p>
<pre>
# ufw allow proto tcp from 192.168.0.0/24 to any port 22</pre>
<p>Adding a rule with a range of (multiple) ports is not possible using ufw in Ubuntu 8.04 and 8.10. If I was using iptables the rule would look like this</p>
<pre>
iptables -A FIREWALL -p tcp --dport 5900:5910 -j ACCEPT</pre>
<p>One way to work around this limitation is to do some bash scripting.<br />
This example shows how I manage to open arange of 10 ports for VNC, though not gracefully&#8230;</p>
<pre>
for port in {5900..5910}; do ufw allow proto tcp from any to any port $port; done</pre>
<p>Result</p>
<pre>
To                         Action  From
--                         ------  ----
...
5900:tcp                   ALLOW   Anywhere
5901:tcp                   ALLOW   Anywhere
5902:tcp                   ALLOW   Anywhere
5903:tcp                   ALLOW   Anywhere
...</pre>
<p>Adding custom rules without using ufw can be done by adding the rules to the files in <strong>/etc/ufw/before.rules</strong> and <strong>/etc/ufw/after.rules</strong>. <em>Rules manually added to <strong>/var/lib/ufw/user.rules</strong> will be deleted the next time you use ufw from the command line!</em></p>
<p>These are my custom rules added to <strong>/etc/ufw/before.rules</strong></p>
<pre>...
*filter
...
:SSH_CHECK - [0:0]
### RULES ###

# Script kiddie check
-A ufw-before-input -p tcp --dport 22 -m state --state NEW -j SSH_CHECK
-A SSH_CHECK -m recent --set --name SSH
-A SSH_CHECK -m recent --update --seconds 60 --hitcount 4 --name SSH -j DROP
...</pre>
<p>These rules are explained in a earlier post about <a href="http://pario.no/2007/05/08/ssh-dictionary-attack-prevention-with-iptables/">SSH dictionary prevention</a></p>
<p>ufw status only shows the part you tell it to modify. The whole iptables output looks like this</p>
<pre># iptables -L -n
Chain INPUT (policy DROP)
target     prot opt source               destination
ufw-before-input  all  --  0.0.0.0/0            0.0.0.0/0
ufw-after-input  all  --  0.0.0.0/0            0.0.0.0/0           

Chain FORWARD (policy DROP)
target     prot opt source               destination
ufw-before-forward  all  --  0.0.0.0/0            0.0.0.0/0
ufw-after-forward  all  --  0.0.0.0/0            0.0.0.0/0           

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
ufw-before-output  all  --  0.0.0.0/0            0.0.0.0/0
ufw-after-output  all  --  0.0.0.0/0            0.0.0.0/0           

Chain SSH_CHECK (1 references)
target     prot opt source               destination
           all  --  0.0.0.0/0            0.0.0.0/0           recent: SET name: SSH side: source
DROP       all  --  0.0.0.0/0            0.0.0.0/0           recent: UPDATE seconds: 60 hit_count: 4 name: SSH side: source 

Chain ufw-after-forward (1 references)
target     prot opt source               destination
LOG        all  --  0.0.0.0/0            0.0.0.0/0           limit: avg 3/min burst 10 LOG flags 0 level 4 prefix `[UFW BLOCK FORWARD]: '
RETURN     all  --  0.0.0.0/0            0.0.0.0/0           

Chain ufw-after-input (1 references)
target     prot opt source               destination
RETURN     udp  --  0.0.0.0/0            0.0.0.0/0           udp dpt:137
RETURN     udp  --  0.0.0.0/0            0.0.0.0/0           udp dpt:138
RETURN     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:139
RETURN     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:445
RETURN     udp  --  0.0.0.0/0            0.0.0.0/0           udp dpt:67
RETURN     udp  --  0.0.0.0/0            0.0.0.0/0           udp dpt:68
LOG        all  --  0.0.0.0/0            0.0.0.0/0           limit: avg 3/min burst 10 LOG flags 0 level 4 prefix `[UFW BLOCK INPUT]: '
RETURN     all  --  0.0.0.0/0            0.0.0.0/0           

Chain ufw-after-output (1 references)
target     prot opt source               destination
RETURN     all  --  0.0.0.0/0            0.0.0.0/0           

Chain ufw-before-forward (1 references)
target     prot opt source               destination
ufw-user-forward  all  --  0.0.0.0/0            0.0.0.0/0
RETURN     all  --  0.0.0.0/0            0.0.0.0/0           

Chain ufw-before-input (1 references)
target     prot opt source               destination
ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0
ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0           ctstate RELATED,ESTABLISHED
DROP       all  --  0.0.0.0/0            0.0.0.0/0           ctstate INVALID
ACCEPT     icmp --  0.0.0.0/0            0.0.0.0/0           icmp type 3
ACCEPT     icmp --  0.0.0.0/0            0.0.0.0/0           icmp type 4
ACCEPT     icmp --  0.0.0.0/0            0.0.0.0/0           icmp type 11
ACCEPT     icmp --  0.0.0.0/0            0.0.0.0/0           icmp type 12
ACCEPT     icmp --  0.0.0.0/0            0.0.0.0/0           icmp type 8
ACCEPT     udp  --  0.0.0.0/0            0.0.0.0/0           udp spt:67 dpt:68
ufw-not-local  all  --  0.0.0.0/0            0.0.0.0/0
ACCEPT     all  --  224.0.0.0/4          0.0.0.0/0
ACCEPT     all  --  0.0.0.0/0            224.0.0.0/4
ufw-user-input  all  --  0.0.0.0/0            0.0.0.0/0
RETURN     all  --  0.0.0.0/0            0.0.0.0/0           

Chain ufw-before-output (1 references)
target     prot opt source               destination
ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0
ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           state NEW,RELATED,ESTABLISHED
ACCEPT     udp  --  0.0.0.0/0            0.0.0.0/0           state NEW,RELATED,ESTABLISHED
ufw-user-output  all  --  0.0.0.0/0            0.0.0.0/0
RETURN     all  --  0.0.0.0/0            0.0.0.0/0           

Chain ufw-not-local (1 references)
target     prot opt source               destination
RETURN     all  --  0.0.0.0/0            0.0.0.0/0           ADDRTYPE match dst-type LOCAL
RETURN     all  --  0.0.0.0/0            0.0.0.0/0           ADDRTYPE match dst-type MULTICAST
RETURN     all  --  0.0.0.0/0            0.0.0.0/0           ADDRTYPE match dst-type BROADCAST
LOG        all  --  0.0.0.0/0            0.0.0.0/0           limit: avg 3/min burst 10 LOG flags 0 level 4 prefix `[UFW BLOCK NOT-TO-ME]: '
DROP       all  --  0.0.0.0/0            0.0.0.0/0           

Chain ufw-user-forward (1 references)
target     prot opt source               destination
RETURN     all  --  0.0.0.0/0            0.0.0.0/0           

Chain ufw-user-input (1 references)

target     prot opt source               destination
SSH_CHECK  tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:22 state NEW
ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:22
ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:4949
RETURN     all  --  0.0.0.0/0            0.0.0.0/0           

Chain ufw-user-output (1 references)
target     prot opt source               destination
RETURN     all  --  0.0.0.0/0            0.0.0.0/0</pre>
<script type="text/javascript">var wordpress_toolbar_urls = [];var wordpress_toolbar_url = "http://pario.no/wp-content/plugins/wordpress-toolbar/toolbar.php";var wordpress_toolbar_oinw = "n";var wordpress_toolbar_hash = "aHR0cDovL3BhcmlvLm5vLzIwMDgvMDUvMjEvdXNpbmctdWZ3LWlwdGFibGVzLWluLXVidW50dS04MDQtbHRzLzx3cHRiPlVzaW5nIHVmdyAvIGlwdGFibGVzIGluIFVidW50dSA4LjA0IExUUzx3cHRiPmh0dHA6Ly9wYXJpby5ubzx3cHRiPlBhcmlvIFRlY2hub0Jsb2I%3D";</script>]]></content:encoded>
			<wfw:commentRss>http://pario.no/2008/05/21/using-ufw-iptables-in-ubuntu-804-lts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting iptables to survive a reboot</title>
		<link>http://pario.no/2008/01/19/getting-iptables-to-survive-a-reboot/</link>
		<comments>http://pario.no/2008/01/19/getting-iptables-to-survive-a-reboot/#comments</comments>
		<pubDate>Fri, 18 Jan 2008 23:28:47 +0000</pubDate>
		<dc:creator>Hans-Henry Jakobsen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[iptables]]></category>

		<guid isPermaLink="false">http://pario.no/2008/01/20/getting-iptables-to-survive-a-reboot/</guid>
		<description><![CDATA[As far as I know Debian doesn&#8217;t have any defined way to save your iptables rules. I&#8217;ve done it this way: First I&#8217;ve made my iptables rules and made sure they work. Second is to save those rules to a configuration file iptables-save &#62; /root/scripts/iptables.save I always try to save my custom scripts and required [...]]]></description>
			<content:encoded><![CDATA[<p>As far as I know Debian doesn&#8217;t have any defined way to save your <strong>iptables</strong> rules.<br />
I&#8217;ve done it this way:</p>
<p>First I&#8217;ve made my iptables rules and made sure they work.<br />
Second is to save those rules to a configuration file</p>
<pre>
iptables-save &gt; /root/scripts/iptables.save</pre>
<p>I always try to save my custom scripts and required files in the <strong>/root/scripts/</strong> folder.</p>
<p>Now make a script that loads the iptables rules at reboot</p>
<pre>
echo "#!/bin/bash" &gt; /etc/network/if-up.d/iptables
echo "iptables-restore &lt; /root/scripts/iptables.save &gt; &gt;&gt; /etc/network/if-up.d/iptables
chmod +x /etc/network/if-up.d/iptables</pre>
<p>This has been tested on Debian (Etch) 4.0</p>
<script type="text/javascript">var wordpress_toolbar_urls = [];var wordpress_toolbar_url = "http://pario.no/wp-content/plugins/wordpress-toolbar/toolbar.php";var wordpress_toolbar_oinw = "n";var wordpress_toolbar_hash = "aHR0cDovL3BhcmlvLm5vLzIwMDgvMDEvMTkvZ2V0dGluZy1pcHRhYmxlcy10by1zdXJ2aXZlLWEtcmVib290Lzx3cHRiPkdldHRpbmcgaXB0YWJsZXMgdG8gc3Vydml2ZSBhIHJlYm9vdDx3cHRiPmh0dHA6Ly9wYXJpby5ubzx3cHRiPlBhcmlvIFRlY2hub0Jsb2I%3D";</script>]]></content:encoded>
			<wfw:commentRss>http://pario.no/2008/01/19/getting-iptables-to-survive-a-reboot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

