All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joel Newkirk <netfilter@newkirk.us>
To: "Reckhard, Tobias" <tobias.reckhard@secunet.com>,
	netfilter@lists.netfilter.org
Subject: Re: portfw on iptables 2.4 kernel problem.
Date: Wed, 11 Dec 2002 03:05:48 -0500	[thread overview]
Message-ID: <200212110305.48030.netfilter@newkirk.us> (raw)
In-Reply-To: <96C102324EF9D411A49500306E06C8D1021AE36D@eketsv02.cubis.de>

On Wednesday 11 December 2002 02:32 am, Reckhard, Tobias wrote: 
{heavily snipped by Joel}

> I expect you're trying to access the FTP server on 10.0.0.11 from the
> Internet by redirecting connections to the firewall's external IP
> address (203.100.100.1) to the FTP server.

> Take care of the FTP control connection:
> 2. Permit INPUT on the outside interface of the firewall to TCP port
> 21 with states NEW and ESTABLISHED
> 3. Permit OUTPUT on the outside interface of the firewall from TCP
> port 21 with state ESTABLISHED
> 4. In the PREROUTING chain use DNAT to redirect packets "-p tcp -d
> 203.100.100.1 --dport 21" (see point 2 above) to the internal server
> at 10.0.0.11.
> 5. Permit FORWARDing of those same packets with states NEW and
> ESTABLISHED. 6. Permit FORWARDing of response packets ("-s 10.0.0.11
> --sport 21") with state ESTABLISHED.

This wouldn't work at all.  INPUT shouldn't enter into it at all, unless 
the DNAT fails, and OUTPUT only if a packet is required to leave the 
firewall machine itself, IE if that is where the connection is attempted 
from or to.  Also, for the FTP conntrack helper to work you HAVE to 
allow state RELATED.  FTP will open a control connection to port 21, 
then a request for data will (in passive) cause the server to attempt to 
open a connection BACK to the client's port 20, IE.  This is RELATED, in 
a nutshell.  The FTP helper is required because the control packets will 
embed IP and port data inside the packet itself, rather than its header, 
and without the helper netfilter will only handle the header.

j



  reply	other threads:[~2002-12-11  8:05 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-11  7:32 portfw on iptables 2.4 kernel problem Reckhard, Tobias
2002-12-11  8:05 ` Joel Newkirk [this message]
2002-12-11  8:18   ` portfw on iptables 2.4 kernel problem. (oops!) Joel Newkirk
2002-12-11  8:15 ` Tangent to: portfw on iptables 2.4 kernel problem Joel Newkirk
     [not found] <96C102324EF9D411A49500306E06C8D1021AE462@eketsv02.cubis.de >
2002-12-12  8:51 ` Rasmus Reinholdt Nielsen
2002-12-12 14:25   ` Joel Newkirk
  -- strict thread matches above, loose matches on Subject: below --
2002-12-12  8:09 Reckhard, Tobias
2002-12-12  7:33 Reckhard, Tobias
2002-12-12  7:31 Reckhard, Tobias
2002-12-11  9:00 Reckhard, Tobias
2002-12-11 14:25 ` Joel Newkirk
     [not found] <FD8F124A387AD6119F7900A0D218B321561982@hslex01.hslbz.local>
2002-12-10  9:43 ` Rob Sterenborg
2002-12-10 11:00   ` Raymond Leach
2002-12-10 11:22     ` Jozsef Kadlecsik
2002-12-10 11:32       ` Raymond Leach
2002-12-10 11:52         ` Jozsef Kadlecsik
2002-12-10 12:12           ` Raymond Leach
2002-12-11  6:08       ` louie miranda
2002-12-11  6:20         ` Raymond Leach
2002-12-10  8:56 louie miranda
2002-12-10  9:01 ` Raymond Leach
2002-12-10  9:11   ` louie miranda
2002-12-10  9:01 ` Paulo Andre
2002-12-10  9:12   ` louie miranda
2002-12-11 11:26 ` Andrea Rossato
2002-12-12  3:11   ` louie miranda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200212110305.48030.netfilter@newkirk.us \
    --to=netfilter@newkirk.us \
    --cc=netfilter@lists.netfilter.org \
    --cc=tobias.reckhard@secunet.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.