|
I've been using the Rebex FTP Component for some time now just fine with the examples and tutorials on your main page. However I have a problem now where there is a very restrictive firewall and I am connecting with FTP explicit and port 990, and the connection is fine but once I try to upload files I do not know what port it is going through and I cannot open my firewall accordingly. I'd like to know how to connect through secure ftp, passive mode, and doing data control on a port I specify so I may open it in my firewall. |
|
In passive mode FTP, this is how the data connection is initialized:
Unfortunately, this means that the destination port of the data connection is supplied by the server and an FTP client doesn't have any control over it. An FTP client can't instruct the server to listen on a specific port - it has to accept what was offered. The fact that FTP data connections don't use a fixed port number causes lots of problems with firewalls and this is further complicated when TLS/SSL security is used as well. There is even an Internet draft document dedicated solely to this and it's a must-read for anyone trying to understand the matter. Possible solutions:
(I didn't mention a possibility of using active FTP mode instead of passive mode because this mode is even less firewall-friendly. Also, I didn't mention the possibility to specify source ports for FTP data connections because most firewalls are configured to filter outgoing connections based on destination ports, not source ports.) Thank you for the detailed reply. A few more questions just to ensure they are correct. When using a Rebex.Net.Ftp object, if you set its property "Passive" to true then it will ignore its "DataPortRange" property. Also if the "Passive" property is not set, does it default to false and become an active mode data connection?
(13 Apr '10, 20:27)
user-73 (goo...
When "Passive" is set to true, "DataPortRange" is used for source ports of the data connection. This usually doesn't make any difference - most firewall are configured to filter outgoing connections based on destination ports only - and it makes sense because by default, source ports are assigned randomly. (Every TCP connection is has one because it consists of [source IP, source port, destination IP, destination port, protocol], also called a 5-tuple.)
(13 Apr '10, 20:42)
Lukas Pokorny ♦♦
"Passive" is set to true by default. If you set it to false, active mode data connections will be used. In active mode, data connections are established by the FTP server connecting an IP/port at the client, which is even less firewall-friendly than passive mode.
(13 Apr '10, 20:45)
Lukas Pokorny ♦♦
More info on active and passive mode in FTP: http://forum.rebex.net/questions/589/ftp-active-and-passive-mode-difference
(19 Oct '10, 15:57)
Martin Vobr ♦♦
|