Discussion Locked

Using FTP with squid problem

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi,

I have just recently setup squid proxy. However, the FTP does not seems to want to connect. I have search around the web for documentations but most says that FTP would already work by default. Somehow mine just refuse to work. I have tried allow FTP protocols and port 20/21 in the ACL but still it refuse to connect.

But the HTTP seems to be working find with delay_pools.

Anyone have any idea how to make it to work?

3 replies

by cpfeiffe

I don't know exactly what the problem you are having is, but I'll give a quick run down of FTP as I suspect it may be port related. There are two modes of FTP, active and passive. By default most standard apps (such as the OS provided versions) are active. You can get some ftp clients that are passive, such as wu-ftp. In active FTP the client opens a random port>1024 to connect to the server's port 21. Then when data is sent the server opens port 20 to connect to the client's connect_port+1. For example, the client might open port 1025 to connect to port 21 on the server. The server will send data from its port 20 to port 1026 on the client. There are two important things here. The server and any firewall in between has to allow connections made to its port 21 from the client. The client and any firewall has to allow connections made to all ports greater than 1024 from the server. In passive mode the first stage is the same and so the server/firewall must still allow connections to port 21 from the client. Now when data is sent the server client will use its data port (1026 in the example above) to connect to the server on a random port greater than 1024. The difference here is that the client doesn't need to allow connections to ports > 1024 from the server, rather the server will have to allow this from the client.

I hope this will at least get you started. Here is a good link explaining what I just said.

http://www.slacksite.com/other/ftp.html

This discussion is closed to new replies.