Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

nat & ftp problem ??

Status
Not open for further replies.

RandyRiegel

Programmer
Joined
Sep 29, 2003
Messages
256
Location
US
I have some windows machines in a network and recieve internet access via NAT using the following commands:

modprobe iptable_nat
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward

When I try to FTP to a system outside of our network I always get some type of error saying something like: (The following is from PureFTPd)

500 I won't connect to 192.100.100.6 (on to xx.xxx.124.150)
425 No data connection

It's like my local IP address is not getting translated correctly before being send. I can ftp from the linux server fine. Any ideas?

Randy

 
In addition to ftp port 21, you will also need to open/forward port 20 which is ftp's data port. If that isn't it, then it's something else.
 
I'm pretty sure the port is not blocked, I can actually get logged into my FTP account on the remote server but then when I try to do something like "dir" or something that is when I get the error.
 
Switch your FTP mode to PASSIVE mode.

Ftp using 2 ports, the NAT will reject the data when ftp is being in active mode. putting it in passive should solve your problem.



_____________________________
when someone asks for your username and password, and much *clickely clickely* is happening in the background, know enough that you should be worried.
 
how do I put the command line version of FTP (in WinXP) into passive mode. I've tried PASS, PASV, PASSIVE, and some others I've seen while searching the web but those commands don't seem to work.
Randy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top