<?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"
	>
<channel>
	<title>Comments on: Iptables Connection Tracking - FTP</title>
	<atom:link href="http://www.sns.ias.edu/~jns/wp/2006/01/12/iptables-connection-tracking-ftp/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sns.ias.edu/~jns/wp/2006/01/12/iptables-connection-tracking-ftp/</link>
	<description></description>
	<pubDate>Sun, 23 Nov 2008 12:20:51 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
		<item>
		<title>By: Marcello Fontolan</title>
		<link>http://www.sns.ias.edu/~jns/wp/2006/01/12/iptables-connection-tracking-ftp/#comment-55018</link>
		<dc:creator>Marcello Fontolan</dc:creator>
		<pubDate>Sat, 09 Jun 2007 13:53:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.sns.ias.edu/~jns/wp/?p=20#comment-55018</guid>
		<description>There is no problem for me with external connections to my server but trying configure a very closed internal network, with all ports close except the necessary ones, FTP does not work.
  I try create special rules to handle FTP but the download does not starts.
  Any help???

(CLIENTS is a FORWARD chain)
-A CLIENTS -p tcp -m tcp -m multiport -s 192.168.0.0/16 --dports 21,443,1863 -j ACCEPT
-A CLIENTS -p tcp -m tcp -m multiport -d 192.168.0.0/16 --sports 21,443,1863 -j ACCEPT
-A CLIENTS -p tcp -m tcp -m state -s 192.168.0.0/16 --dport 20 --state ESTABLISHED -j ACCEPT
-A CLIENTS -p tcp -m tcp -m state -d 192.168.0.0/16 --sport 20 --state ESTABLISHED,RELATED -j ACCEPT</description>
		<content:encoded><![CDATA[<p>There is no problem for me with external connections to my server but trying configure a very closed internal network, with all ports close except the necessary ones, FTP does not work.<br />
  I try create special rules to handle FTP but the download does not starts.<br />
  Any help???</p>
<p>(CLIENTS is a FORWARD chain)<br />
-A CLIENTS -p tcp -m tcp -m multiport -s 192.168.0.0/16 &#8211;dports 21,443,1863 -j ACCEPT<br />
-A CLIENTS -p tcp -m tcp -m multiport -d 192.168.0.0/16 &#8211;sports 21,443,1863 -j ACCEPT<br />
-A CLIENTS -p tcp -m tcp -m state -s 192.168.0.0/16 &#8211;dport 20 &#8211;state ESTABLISHED -j ACCEPT<br />
-A CLIENTS -p tcp -m tcp -m state -d 192.168.0.0/16 &#8211;sport 20 &#8211;state ESTABLISHED,RELATED -j ACCEPT</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nathan Eady</title>
		<link>http://www.sns.ias.edu/~jns/wp/2006/01/12/iptables-connection-tracking-ftp/#comment-51085</link>
		<dc:creator>Nathan Eady</dc:creator>
		<pubDate>Thu, 17 May 2007 16:45:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.sns.ias.edu/~jns/wp/?p=20#comment-51085</guid>
		<description>That passive ftp rule scares me as well.  It just feels too general, like it allows (potentially) more than I really need to allow.  I know it's the client making the connection out, and I understand that RELATED means *something* that's allowed has indicated it, but I would really feel much better about it if I could say something along the lines of -m state --state RELATED -m relatedto --relatedto ftp (with a separate rule for ESTABLISHED traffic).

I know, call me paranoid, but isn't it the network administrator's *job* to be paranoid about such things?</description>
		<content:encoded><![CDATA[<p>That passive ftp rule scares me as well.  It just feels too general, like it allows (potentially) more than I really need to allow.  I know it&#8217;s the client making the connection out, and I understand that RELATED means *something* that&#8217;s allowed has indicated it, but I would really feel much better about it if I could say something along the lines of -m state &#8211;state RELATED -m relatedto &#8211;relatedto ftp (with a separate rule for ESTABLISHED traffic).</p>
<p>I know, call me paranoid, but isn&#8217;t it the network administrator&#8217;s *job* to be paranoid about such things?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Cruft &#187; Blog Archive &#187; More FTP failure investigation</title>
		<link>http://www.sns.ias.edu/~jns/wp/2006/01/12/iptables-connection-tracking-ftp/#comment-11401</link>
		<dc:creator>Chris Cruft &#187; Blog Archive &#187; More FTP failure investigation</dc:creator>
		<pubDate>Sat, 28 Oct 2006 22:19:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.sns.ias.edu/~jns/wp/?p=20#comment-11401</guid>
		<description>[...] http://www.sns.ias.edu/~jns/wp/2006/01/24/iptables-how-does-it-work/?p=20 [...]</description>
		<content:encoded><![CDATA[<p>[...] <a href="http://www.sns.ias.edu/~jns/wp/2006/01/24/iptables-how-does-it-work/?p=20" rel="nofollow">http://www.sns.ias.edu/~jns/wp/2006/01/24/iptables-how-does-it-work/?p=20</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul Rogers</title>
		<link>http://www.sns.ias.edu/~jns/wp/2006/01/12/iptables-connection-tracking-ftp/#comment-6315</link>
		<dc:creator>Paul Rogers</dc:creator>
		<pubDate>Sun, 13 Aug 2006 05:31:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.sns.ias.edu/~jns/wp/?p=20#comment-6315</guid>
		<description>I was using your rules for ftp, active mode, and did a simple "ls", causing the following:
Aug 12 12:53:35 panda kernel: firewall: IN=eth0 OUT= MAC=00:a0:24:0e:48:8e:00:10:5a:09:5e:45:08:00 SRC=64.50.236.52 DST=192.168.1.110 LEN=60 TOS=0x00 PREC=0x00 TTL=54 ID=65353 DF PROTO=TCP SPT=60683 DPT=1042 WINDOW=5840 RES=0x00 SYN URGP=0

I found adding RELATED to the INPUT for the ephemeral ports fixed it, but I'm not too happy about it.  It would seem to open up ports which might be used by other connections, say bad websites.   (Yep, it's related to the connection on port 80, let it through.)  I'm wondering if the ftp connections could use conntrack marks to separate them from everything else that might try to use the ephemeral ports and should be dropped.</description>
		<content:encoded><![CDATA[<p>I was using your rules for ftp, active mode, and did a simple &#8220;ls&#8221;, causing the following:<br />
Aug 12 12:53:35 panda kernel: firewall: IN=eth0 OUT= MAC=00:a0:24:0e:48:8e:00:10:5a:09:5e:45:08:00 SRC=64.50.236.52 DST=192.168.1.110 LEN=60 TOS=0&#215;00 PREC=0&#215;00 TTL=54 ID=65353 DF PROTO=TCP SPT=60683 DPT=1042 WINDOW=5840 RES=0&#215;00 SYN URGP=0</p>
<p>I found adding RELATED to the INPUT for the ephemeral ports fixed it, but I&#8217;m not too happy about it.  It would seem to open up ports which might be used by other connections, say bad websites.   (Yep, it&#8217;s related to the connection on port 80, let it through.)  I&#8217;m wondering if the ftp connections could use conntrack marks to separate them from everything else that might try to use the ephemeral ports and should be dropped.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Gabel</title>
		<link>http://www.sns.ias.edu/~jns/wp/2006/01/12/iptables-connection-tracking-ftp/#comment-550</link>
		<dc:creator>David Gabel</dc:creator>
		<pubDate>Mon, 15 May 2006 14:15:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.sns.ias.edu/~jns/wp/?p=20#comment-550</guid>
		<description>One more note here: To put it on a firewall with NAT you have to add all these rule also to the FORWARD chain.</description>
		<content:encoded><![CDATA[<p>One more note here: To put it on a firewall with NAT you have to add all these rule also to the FORWARD chain.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James Stephens</title>
		<link>http://www.sns.ias.edu/~jns/wp/2006/01/12/iptables-connection-tracking-ftp/#comment-168</link>
		<dc:creator>James Stephens</dc:creator>
		<pubDate>Sat, 25 Mar 2006 20:19:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.sns.ias.edu/~jns/wp/?p=20#comment-168</guid>
		<description>Hello.

All you have to do is swap INPUT for OUTPUT  and vice versa in the above rules for the case where the ftp server is local.

Best,
James</description>
		<content:encoded><![CDATA[<p>Hello.</p>
<p>All you have to do is swap INPUT for OUTPUT  and vice versa in the above rules for the case where the ftp server is local.</p>
<p>Best,<br />
James</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: FNC</title>
		<link>http://www.sns.ias.edu/~jns/wp/2006/01/12/iptables-connection-tracking-ftp/#comment-167</link>
		<dc:creator>FNC</dc:creator>
		<pubDate>Sat, 25 Mar 2006 10:46:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.sns.ias.edu/~jns/wp/?p=20#comment-167</guid>
		<description>I believe this rules apply to a client trying to ftp an external server.
What would be the rules for the opposite case? I'm running an FTP server and firewall is dropping the passive connetion data packets...</description>
		<content:encoded><![CDATA[<p>I believe this rules apply to a client trying to ftp an external server.<br />
What would be the rules for the opposite case? I&#8217;m running an FTP server and firewall is dropping the passive connetion data packets&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James Stephens</title>
		<link>http://www.sns.ias.edu/~jns/wp/2006/01/12/iptables-connection-tracking-ftp/#comment-70</link>
		<dc:creator>James Stephens</dc:creator>
		<pubDate>Wed, 22 Feb 2006 11:00:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.sns.ias.edu/~jns/wp/?p=20#comment-70</guid>
		<description>Jarry,

You're absolutely right. I missed off a : there. At least it was correct it was correct in the downloadable ruleset.

It should be -- sport etc like you say. The html formatting is making two dashes together look like one. I managed to tweak it to get a longer dash and I hope people will realise it is meant to be two .... c'est la vie.

Thanks very much for picking up on these things.

Best,

James</description>
		<content:encoded><![CDATA[<p>Jarry,</p>
<p>You&#8217;re absolutely right. I missed off a : there. At least it was correct it was correct in the downloadable ruleset.</p>
<p>It should be &#8212; sport etc like you say. The html formatting is making two dashes together look like one. I managed to tweak it to get a longer dash and I hope people will realise it is meant to be two &#8230;. c&#8217;est la vie.</p>
<p>Thanks very much for picking up on these things.</p>
<p>Best,</p>
<p>James</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jarry</title>
		<link>http://www.sns.ias.edu/~jns/wp/2006/01/12/iptables-connection-tracking-ftp/#comment-69</link>
		<dc:creator>Jarry</dc:creator>
		<pubDate>Wed, 22 Feb 2006 08:57:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.sns.ias.edu/~jns/wp/?p=20#comment-69</guid>
		<description>In passive-ftp connection tracking rules you have small error:

instead of
iptables -A OUTPUT -p tcp –sport 1024: –dport 1024 -m state –state ESTABLISHED,RELATED -j ACCEPT

there should be (I think)
iptables -A OUTPUT -p tcp –sport 1024: –dport 1024: -m state –state ESTABLISHED,RELATED -j ACCEPT

Otherwise only single dport 1024 would be valid. BTW, I'm not sure, but should not it be --dport / --sport / --state? With double "--", not single "-"...</description>
		<content:encoded><![CDATA[<p>In passive-ftp connection tracking rules you have small error:</p>
<p>instead of<br />
iptables -A OUTPUT -p tcp –sport 1024: –dport 1024 -m state –state ESTABLISHED,RELATED -j ACCEPT</p>
<p>there should be (I think)<br />
iptables -A OUTPUT -p tcp –sport 1024: –dport 1024: -m state –state ESTABLISHED,RELATED -j ACCEPT</p>
<p>Otherwise only single dport 1024 would be valid. BTW, I&#8217;m not sure, but should not it be &#8211;dport / &#8211;sport / &#8211;state? With double &#8220;&#8211;&#8221;, not single &#8220;-&#8221;&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
