forwarding ftp on LAN...problem: connection time out

forwarding ftp on LAN...problem: connection time out

Post by MJ » Sat, 07 Dec 2002 05:52:55




$IPTABLES -A FORWARD -i $EXTIF -o $INTIF -p tcp --dport 21 -m state \

$IPTABLES -A PREROUTING -t nat -p tcp -d $EXTIP --dport 21 \
-j DNAT --to $PORTFWIP:21

Problem - conenction time out..
any comments?


1. Port forwarding, NAT and LAN-to-LAN connections

Hello all,

Here's a stumper. I'm using Debian 2.2 and ipchains to set up a bunch
of services running on a LAN with only one external host doing
port-by-port forwarding to the hosts on the LAN. So,
External IP  forwarded to -->
External IP forwarded to -->

With a couple of simple statements to ipmasqadm:
ipmasqadm portfw -f
ipmasqadm portfw -a -P tcp -L 80 -R 80
ipmasqadm portfw -a -P tcp -L 25 -R 25

this works like a charm in all cases but one-- when the connection is
initiated from a host inside of the LAN. So, if host
tries to connect to, nothing happens. tcpdump shows
that packets are flying about, but the connection is never officially

I suspect that this has to do with the way that MASQ works in linux,
but I am not sure. I have scoured this list and it seems that the only
thing that comes close in posting is this post:

but there was never an acceptable resolution. Using DNS to
short-circuit the firewall's NAT seems kludgey.

Any help would be greatly appreciated.


PS the rest of my rules are set as promiscous as possible for the
purposes of solving this problem:

ipchains -F
ipchains -P input ACCEPT
ipchains -P output ACCEPT
ipchains -P forward ACCEPT
ipchains -P forward -s -j MASQ

and everything else (NAT, forwarding from an external address) is
working jsut fine.

2. QUERY:- Open source for mini-pci

3. IP-Forwarding PPP-LAN but not LAN-LAN

4. modprobe: Can't locate module sr_mod

5. RPC time outs at boot time

6. UNIX for Mac LC3?

7. FTP: 425 Can't build data connection: Connection timed out.

8. Anybody succesfully compiled a CD-R capable 2.4.x kernel?

9. ftp problem LAN behind NAT/fierwall to LAN

10. ftp forwarding to inside lan

11. LAN (telnet) connection takes LONG time to login!

12. Forwarding data FTP connection - doesn't work

13. Delays between connection and login on FTP and Telnet over Ethernet LAN