how to connect to ftp server running on a non standard port through proxy

agu10 used Ask the Experts™
In our office, the proxy server is a unix machine and the proxy server running is simply the 'ftpd' running on port 21. On the same machine there is http proxy running on port 80. Now i have a problem. Using this as a proxy server for ftp, I can only connect to the ftp servers which are running on port 21. I tried to connect through IE by giving the url as
where the port of the site was 2000 (not the standard 21) and IE says "conection closed. Data transfer aborted."
Through client WS_ftp also after configuring the firewall, giving the firewall ip, port (21), user and password etc and then giving the details (ip, port, user,passwd) of remote server to which i have to connect, i can only connect to servers that are running on port 21. If i give any server and its remote port, ws_ftp converts that port to my firewall port( '21' ) after failure. i.e 2000 was changed to 21 and thats why it failed. i thought its a bug in ws_ftp so i tried core thing.
I then tried login to ftp server using
ftp <my-proxyserver-ip>
and then user id and password. Now i am on the proxy server and want to connect to remote ftp server. Now the problem is if i use 'open' command, it says already connected (its connected to proxy server), disconnect first.
i can use two commands to connect to remote server
'quote site '
but none of these command is accepting the port after the ip and they assume port as '21' and then result into connection refused cos the actual port is 2000.
Could anyone help me to overcome this problem.
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2005

Why not contact your Network Administrator. If this is a valid work related need they probably have a way to do the FTP transfer from a machine on the open side of the proxy.

Other than being able to login to a machine on the open side of the proxy and running an FTP client from there, there isn't any way to trick the proxy into allowing the use of a non-standard port.

Hi aqu10,
What kind of Proxy do you use on your Proxy-Server ? Can this Proxy handle ftp-Protocol ? If it can handle it, check your IE configuration:
Have you configured your Proxy Connection for FTP ?

if you use WS_FTP Client, CHECK this configurations:
Enter following Firewall Parameters: Firewall-IP, Proxy-port (80 for your transparent Proxy); use alway passive FTP through Firewalls (activate Checkbox) ; enter user/passwd of Proxy (if existent) or leave it blank

on Passive FTP your dataconnection on Port 20 is opened by the FTP client.

On ACTIVE FTP your dataconn. (Port 20) opens the ftp server. Most of the firewalls and proxys refuses an incomming connection request.
FTP runs on port 21. Period. The FTP protocol is too baroque/broken to change its ports around. Tell your friend to run their FTP server on the correct port. If they're running on a high port to avoid being detected by their corporate/campus/ISP's probing or to get around their corporate/campus firewall, tell them to go get permission and then move to the correct port.
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!


All the configuration of the proxy are okay, as i have already told i am able to connect to the remoe ftp servers runnnig on port 21. The problem is to connect to ftp servers not running on port 21. Does this mean, the ftp proxy server can only connect to port 21. Is not there any option where i can instruct proxy server to connect some IP on port 2000 where the ftp server is running. I can't tell the site provider to change his ftp port as he is not my friend nor i can ask my network administrator as it is not some official work instead some mp3 ftp server. Please confirm that its not possible to connect to remote ftp server through 'ftpd' proxy to connect to a ftp server runnning on a port that is not 21. i mean is there any option in the ftp protocol to specify that make the connection on port X intead of default 21, as proxy is trying to connect 21 while its actually 2000.
probaly the ftp servers you try to connect and fail, can only act in aktive mode. Then you need port 21 and 20, which most like does not work through firewalls.

FTP usually using a 2 port connection :
   port 21 for flowcontrol of communication and commands
   port 20 for Datatransfer of (m)put and (m)get

if u iniitiating an FTP session from your FTP-client (specified by ANY [21,2000, ...] destinationport of FTP-Server) the FTP Server tries to open (in active mode) a connection to your client from port 20 !!!!

If u initiate a FTP session in passive mode your client can determine the port for datatransfer (maybe unequal Port 20)
Top Expert 2005
There are two reasons that folks set up an FTP or HTTP proxy. The first is to limit and monitor access to FTP or HTTP sites. And the second is to isolate users from direct Internet access. In both cases the proxies will only allow FTP or HTTP connections on those ports that the proxy has been configured to respond to and there's intentionally no mechanism to allow a user to ask for a different port. So, I don't think that you are going to be able to "bypass" the site restrictions. Sorry...
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Post your closing recommendations!  No comment means you don't care.
Top Expert 2005

I believe this question was answered by mine and chris_calabrese's comments

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial