Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Nick <fenderflames@yahoo.com>
To: netfilter@lists.netfilter.org
Subject: Re: FORWARD question
Date: Thu, 20 Nov 2003 13:51:56 -0800 (PST)	[thread overview]
Message-ID: <20031120215156.99184.qmail@web40809.mail.yahoo.com> (raw)
In-Reply-To: <200311202051.hAKKp8723558@onyx.rockstone.co.uk>

Anthony, first of all thanks for your answer :-) If
you don't mind I would like to clarify a few things. 

I know the router 'remembers' things about packets, I
just don't know how much he remembers.That's where I
am right now.

I do use connection traccking, and I guess I use it
correctly.(Earlier I had posted only a part of my
script) I also have only one public IP, the FW machine
sends FTP requests to the FTP server on 192.168.0.12.

The only open port on the external NIC of the FW
machine is 21. 

My complete forward rules are those:

$IPTABLES -A FORWARD -i $LAN_IFACE -j ACCEPT
$IPTABLES -A FORWARD -m state --state
ESTABLISHED,RELATED -j ACCEPT

$IPTABLES -A FORWARD -i ppp0 -o $LAN_IFACE -p tcp -d
$FTPSRV --dport 21 -m state --state NEW -j ACCEPT

$IPTABLES -A FORWARD -i ppp0 -o $LAN_IFACE -p tcp -d
$FTPSRV --dport 20 -j ACCEPT

$IPTABLES -A FORWARD -i ppp0 -o $LAN_IFACE -p tcp -d
$FTPSRV --dport 1024:65535 --sport 1024:65535 -j
ACCEPT

$IPTABLES -t nat -A PREROUTING -p tcp -d $INET_IP -i
ppp0 --dport 21 -j DNAT --to $FTPSRV

$IPTABLES -t nat -A POSTROUTING -o ppp0 -s
$LAN_IP_RANGE -j MASQUERADE 

$INET_IP= public IP
$LAN_IFACE=internal NIC of the FW server

I use NEW when I forward to port 21 because I figured 
the first FTP request will be new. Am I right ?

If I understand correctly, the router will pick up FTP
related traffic coming from the internet through ports
1024:65535 and forward it only to the FTP server
because I do PREROUTING to my FTP server ? 

Does the router say: 'this packet that came through
port 1025 ist FTP related and I will FORWARD it only
to the FTP server(because that's what PREROUTING tells
me) and this packet coming through port 1026 is for
client x.x.x.x (for which there is no PREROUTING) and
I will send it to only him' ?

If that's so, great :-) Thanks again for your help

__________________________________
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/


  reply	other threads:[~2003-11-20 21:51 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-20 20:27 FORWARD question Nick
2003-11-20 20:51 ` Antony Stone
2003-11-20 21:51   ` Nick [this message]
2003-11-20 23:12     ` Antony Stone
2003-11-21 10:42       ` Nick
2003-11-21 11:34         ` Antony Stone
2003-11-21 11:59           ` Nick
2003-11-21 12:38             ` Antony Stone
2003-11-21 13:08               ` Antony Stone
2003-11-21 13:24                 ` Nick
2003-11-21 13:50                   ` Jeffrey Laramie
2003-11-21 14:06                     ` Nick
2003-11-21 14:11                     ` Antony Stone
2003-11-21 16:19                       ` redirect squid to other proxy(windows) hearing in port 80 Guillermo
2003-11-21 16:43                         ` Antony Stone
2003-11-21 16:44                         ` Antony Stone
2003-11-20 22:18   ` FORWARD question Nick
  -- strict thread matches above, loose matches on Subject: below --
2003-11-20 20:01 Nick

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=20031120215156.99184.qmail@web40809.mail.yahoo.com \
    --to=fenderflames@yahoo.com \
    --cc=netfilter@lists.netfilter.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox