From: Michal Ludvig <michal@logix.cz>
To: netfilter@lists.netfilter.org
Subject: FTP server behind NAT
Date: Fri, 29 Apr 2005 17:08:17 +1200 [thread overview]
Message-ID: <4271C141.5050008@logix.cz> (raw)
Hi all,
I've got an FTP server sitting at 192.168.1.4 in the internal network
and am trying to set up the firewall (2.4.29) to allow access to it from
outside.
Basically my setup is
1) DNAT one of our static external addresses to the FTP server:
iptables -t nat -A PREROUTING -i pvc0 -d a.b.c.142 \
-j DNAT --to 192.168.1.4
2) Allow port 21 & related to FTP server and drop everything else
iptables -A FORWARD -i pvc0 -o internal -j pvc0-internal
iptables -A pvc0-internal -d 192.168.1.4 -m state \
--state NEW -p tcp --dport 21 -j ACCEPT
iptables -A pvc0-internal -m state --state ESTABLISHED,RELATED \
-j ACCEPT
iptables -A pvc0-internal -j LOG
iptables -A pvc0-internal -j DROP
3) ip_conntrack_ftp is loaded
Now I can connect from outside to a.b.c.142 and authenticate to the FTP
server. But as soon as a new channel is to be opened (e.g. dir listing
or file download) the connection hangs.
In /proc/net/ip_conntrack there is a correct(?) entry:
EXPECTING: - use=1 proto=6 src=x.y.z.127 dst=192.168.1.4 \
sport=0 dport=32985
However the packet from my client (x.y.z.127) is still logged and dropped:
IN=pvc0 OUT=internal SRC=x.y.z.127 DST=192.168.1.4 LEN=60 TOS=0x00
PREC=0x00 TTL=56 ID=15185 DF PROTO=TCP SPT=1557 DPT=32985 WINDOW=5840
RES=0x00 SYN URGP=0
It is really logged and dropped in this chain (added some
--log-prefix'es to verify).
Anyone has an idea what is wrong with my setup? Why isn't the packet
treated as RELATED and passed through?
Thanks in advance!
Michal Ludvig
--
* Personal homepage: http://www.logix.cz/michal
next reply other threads:[~2005-04-29 5:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-29 5:08 Michal Ludvig [this message]
2005-04-29 5:23 ` FTP server behind NAT Jason Opperisano
2005-04-29 5:31 ` Michal Ludvig
2005-04-29 5:32 ` Jason Opperisano
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=4271C141.5050008@logix.cz \
--to=michal@logix.cz \
--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 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.