| Dart Home | PowerTCP FTP for ActiveX | Custom Development | Reply | PowerTCP FTP for ActiveX Topics | Forums |
| Author | Forum: PowerTCP FTP for ActiveX Topic: The port number in the PORT command |
| Scott Worley From: Santa Ana, CA USA Posts: 4 Member Since: 06/09/05 |
posted June 9, 2005 4:01 PM Hello, When using active (non-passive) mode with the tool, it sends a PORT command to the server. This command should contain an IP and a port number for the server to contact the client on. How can I set the IP and port that are used in this command? Are there default values? I'm sorry, it's just not clear from the documentation or help file. Thanks. |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted June 9, 2005 4:28 PM The IP is the IP address of the machine that is using the FTP component (What Ftp1.LocalAddress is) and cannot be altered. By default, the Port is "ephemeral", meaning that we ask winsock to give us one that it wants us to use. You can also specify a range through use of the "LocalDataPort" property. |
| Scott Worley From: Santa Ana, CA USA Posts: 4 Member Since: 06/09/05 |
posted June 9, 2005 6:09 PM Thanks for the reply. The problem I am facing is that the computer is behind an NAT router, and the computer has an IP on the local LAN, but uses the router as an internet gateway. What I had wanted to do is forward the port on the router to the workstation on the local LAN, but I need the server to contact the client on the external (Internet) IP, not the local IP. I guess there's no way I can make this work if I can't set that IP in the PORT command? Regards, Scott Worley |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted June 9, 2005 6:56 PM First I would have to ask the obvious: Why not just use Passive? Secondly, most firewalls are smart enough to read the traffic on port 21 and determine that and FTP client is attempting to set up a listener. The firewall then replaces the data in the string so that the other side gets the right data. |
| Scott Worley From: Santa Ana, CA USA Posts: 4 Member Since: 06/09/05 |
posted June 9, 2005 7:45 PM I would, of course, prefer to use passive and avoid all the trouble. Unfortunately, I am not the server admin; I have to try to adapt to their security-conscious (I presume) requirement of active mode. I guess a firewall that inspects packets might be that intelligent... but a simple NAT router? At any rate, if I could set a property for the port IP address, my problem would be solved. Is it possible that I could make up my own PORT command with the external IP I want and send that to the server instead of the automatically generated one? |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted June 9, 2005 8:21 PM Your problem would not be solved because if the NAT firewall is not smart enough to read the FTP stream it certainly won't know enough to open up the outside ports and forward it back to you. Also, why would using passive be more of a risk than using active? That doesn't make any sense. Unless your admins are more concerned with what goes out than what comes in. In any event, unfortunately you would not be able to make up your own port command with our FTP control. If you know what you are doing though, you could make your own FTP control using our Tcp and Daemon controls from the Winsock Tool, the Server Tool or Sockets for .NET. That would be some work but you could do it. |
| Scott Worley From: Santa Ana, CA USA Posts: 4 Member Since: 06/09/05 |
posted June 9, 2005 9:14 PM I would forward the port I select for this purpose from the router to the workstation in question. Most routers let you do some kind of port forwarding to local IPs behind the router. I don't really know for certain why the server admins insist on active mode, but they do. I'm going to have to tell the people I'm building this FTP routine for that it's either no NAT, or passive mode. Thanks for your help. |
| stoogesbol From: Edmonton, AB Canada Posts: 7 Member Since: 10/25/03 |
posted October 25, 2005 4:45 PM Tony Priest: This is a feature of most FTP Clients: Force an ip and port range for active connections. This used when both the server and you are behind firewall/nat, and only you can forward a port to your local machine. The FTP control should have local ip and local port properties to be used by the control before downloading or listing. |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted October 25, 2005 4:54 PM Thanks for the suggestion. We'll consider this for the next release. |
| Reply | PowerTCP FTP for ActiveX Topics | Forums |
This site is powered by
PowerTCP WebServer for ActiveX
|