Home › Forums › OS X Server and Client Discussion › File Serving › Passive FTP Working Behind Router?
- This topic has 10 replies, 2 voices, and was last updated 19 years, 4 months ago by
snowriderau.
-
AuthorPosts
-
February 15, 2005 at 9:39 pm #360714
jethro
ParticipantHi, I’m wondering if anyone has OSX 10.3 Server setup using passive FTP behind a basic router? If so, what brand/model of router and what special settings did you have to set?
I’ve been having no luck connecting to our server using passive FTP through a basic Linksys Router. I’ve done all of the obvious port forwading, etc. on the router (20, 21, 1024-65535). Nothing seems to work. Only active FTP can connect successfully. Passive works internally.
I’ve seen this problem in different forums, but nobody seems to have given a working solution. Anybody have this verifyably working using Panther’s built-in FTP server and a router? Thanks!
February 16, 2005 at 6:43 pm #360731jethro
ParticipantOK, after searching COUNTLESS forums for the answer to this, I think I may understand what’s happening, I just don’t know how to implement the fix.
I’ve only been using servers for a couple weeks now, so forgive me if I’m a bit off on anything 😆
What I believe is happening is that when the server responds to the client’s request for an open port, it is sending out it’s internal private IP address (192.168.1.x) instead of the public IP address the client would need to respond on. Apparently this may be because the Linksys router isn’t handling the NAT functions very well.
So can anyone tell me if it’s possible to force the server to reply with the static IP address our ISP assigns us instead of the internal IP address we use behind the router? If it needs to be done in Terminal, can you give me a bit of walk-through (again, I’m a newbie).
I’ve searched everywhere, but cannot seem to find the instructions on how to do this. Apple won’t help me because they say it’s the router’s fault. Linksys won’t help me because, well, they’re a bit clueless to advanced stuff like this. They all say “just open the proper port”, which of course I’ve tried to no avail.
Thank you!!
February 16, 2005 at 9:10 pm #360735Anonymous
GuestThis is a common problem with NAT and passive FTP. Google will turn up hours of reading about references to this very problem.
I do not use Mac OS X Server to serve FTP. Instead I use PureFTPd on a regular OS X client. PureFTPd can be installed via Fink or from a binary installer.
The reason I use PureFTP [and previously ProFTPd] is because of the configuration they allow with regards to your very problem. The idea is that some FTP servers will do ‘IP Masquerading" which essentially means that the server will pass on a user defined IP address during the NAT translation back to the client who is connecting.
Instead of the clients seeing the private 192.168.x.x IP they will see the Masquerading IP and connect normally. At least that is the idea.
Both ProFTPd and PureFTPd can be substituted for the built in FTPd on OS X client, but Pure has the additional benefit of having no know exploits, support for virtual users, etc.
February 16, 2005 at 9:24 pm #360736jethro
ParticipantWell, before I go down the road of trying to figure out another FTP program (including setup, installation, etc.), can anyone state verifyably if the built-in FTP server is definitely NOT able to do this??
Thanks. I’m just learning servers and would love to stick with the built-in stuff for now for the sake of support and compatibility. A 3rd-party solution may be a last resort for me if this isn’t at all possible, though.
February 16, 2005 at 10:32 pm #360737Anonymous
GuestI have a few minutes to figure out if you can masquerade your FTP servers IP…
OSX Server uses a different FTP server than the one shipped with OS X Client [lukemFTPd], but I can not remember it of the top of my head. Might be WU-FTPd or a variant. Luckilly, OS X Server has some easy to configure options. So try this and see if it allows clients to connect:
edit the following file in a text editor:
/Library/FTPServer/Configuration/ftpaccess add this right above the “email user@address” line:
passive ports
49152 65534. The rest needs to be done in the Server Admin>Firewall>Advanced tab:
Create a new rule with the following parameters:
Action – Allow
Protocol – TCP
Service – OtherSource Address – Any (or create separate rules for each allowed ftp user)
Source Port – Blank
Destination Address –
Interface – InHTH
🙂
February 16, 2005 at 10:49 pm #360738jethro
ParticipantThanks a lot for the help!
I had already tried that fix. It does limit the ports that the server sends out (which is nice), but it doesn’t seem to help the fact that it’s sending the local IP address instead of the public IP address.
Anything else I might try???
February 18, 2005 at 6:52 pm #360754Anonymous
GuestThis is going to be a learning experience but I believe it is possible to fix your problem with ‘natd’ and ‘ipfw’. Read the man pages for the gory details.
I wish I could tell you more. I am not 100% certain how to do it but you need to have the proper firewall settings and then edit your natd config to successfully masquerade your WAN side IP to the incoming FTP requests.
Don’t give up, you can figure it out eventually! It can be done! 🙂
February 18, 2005 at 6:56 pm #360755Anonymous
Guesthey, since no one else is posting you might as well send me an email. use my handle at Gmail d0t c0m and I will try to help/test.
February 28, 2005 at 11:54 am #360855Anonymous
GuestI have set up Pure-FTP on running under OSX 10.3.8 behind an Airport Extreme Basestation. I have shut off the firewall on the computer running the FTP server (Pure-FTP). I have run a number of tests with different configurations with the constants being the server settings, the Airport Extreme Basestation firewall settings (accepts both active and passive connections), and the server computer firewall being off. The variables are the client computer firewall (on,off); connection (intranet, internet); FTP client mode (active, passive); and the result (good connection with directory listing, error). The odd thing is that I seem to be able to connect with the terminal, authenticate and get a directory listing but when using an FTP client, although I can connect and authenticate, I cannot get a directory listing.
Here are the results:
Client Firewall Connection FTP client Result
Mode
1. on intranet passive good
2. on intranet active error
3. on internet passive error
4. on internet active error
5. off intranet passive good
6. off intranet active good
7. off internet passive error
8. off internet active goodAnother odd thing that is happening is that under configuration 3 when the server responds to the client being in passive mode with the PASV command and enters passive mode and it sends out the “XXX.XXX.XXX.XXX.XXX.XXX”to tell the client which ports are being listened to, the second “XXX” does not match the second XXX in my router’s IP address but some other number gets inserted there. It appears that the server is telling the client that it is waiting for a connection at the wrong IP address with the listed ports. Then when I tell it to list the contents of the directory, the client goes out to the wrong IP address and tries to execute the list command and eventually times out because my FTP server is not there! I found that the server I am being directed to is in China! I have read and searched for days to find out why this is happening to no avail. Anyone have any idea what is happening and how to fix it?
April 2, 2005 at 5:00 am #361170Anonymous
GuestIt now works on my SUSE server behind a Motorola router.
To do:
– forward ports 20 and 21
– use the “-P Your_router_external_ip -N” for your pure-ftp argument in inetd
– don’t use the PASV mode on the FTP client😀
July 11, 2007 at 12:24 am #369479snowriderau
ParticipantAfter much headache I have got Xftpd on osx server working behind a firewall.
You need to alter you rftp access file in Library\ftpserver\configuration
Add following lines and this will work..
passive address 10.0.0.1 10.0.0.0/8 (Where 10.0.0.1 is your ftp server, this allows access locally.)
passive address 245.x.x.x 0.0.0.0/0 (Hint if you have a dyndns name add it instead of the ip address)Then add restriction on your ports to narrow down number of ports required to be open on your firewall. eg..
passive ports 10.0.0.1 10.0.0.0/8 50000 65000
passive ports 245.x.x.x 0.0.0.0/0 50000 65000Also other notes with xftps, recent security update change the http://ftp.plist file and set it back so loads ftpd which is the client config, you need to change this back to the default if your affected.
Also suggest you set your default settings back and then tweak them as required for the ftpaccess file, from ftpaccess.default.
If you wish to change the ports that ftp runs on your server, edit \etc\service and change the ports listed against ftp.
eg change to 1021
Enjoy… Hope this hlps people as this taken some days to get working again… but all good now..
-
AuthorPosts
- You must be logged in to reply to this topic.