2

i am trying to use a netsh command to help setup an FTP "Tunnel".

netsh interface portproxy add v4tov4 listenport=21 listenaddress=0.0.0.0 connectport=21 connectaddress=ftpserver

If i setup the tunnel on machine A this seems to work grand. If i go to machine B and ftp to machine A i do get the login for the ftpserver. However when i try to issue any commands i get errors like

425-Can't build data connection for x.x.x.x,64009
425 connect to network object rejected

The problem i think is the returning connection is getting stuck at machine A , as it only forwards port 21 and not port 64009. i have setup machine A to forward port 64009 back to machine B, which does get further down the line but times out after

150 Opening data connection for HOST:[FOLDERA]*.*;* (x.x.x.x,64009)

Am i doing this all the wrong way? or can someone offer advice.

Basically i am trying to access an ftp server from machine B which is on a different network, nut machine A is on both networks ( two network cards)

1
  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you can provide your own answer and accept it.
    – Ron Maupin
    Aug 6, 2017 at 22:27

2 Answers 2

1

Port 21 is used only for FTP control. You also have to "tunnel" port 20, which is used for the actual data transfer.

0

The originating host will pick a random port from which to initiate a conversation, in this case, it was port 64009. The destination host will reply to the originating host on that port. Machine A sends from port 64009 to Machine B port 21. Machine B will replay to Machine A port 64009. The next time Machine A tries to start a conversation, it will use another randomly chosen port, probably not the same one, and Machine B will need to respond to that port.

FTP uses two ports: port 21 is the FTP Control port and port 20 is the FTP Data port.

If the two networks use the same addressing, Windows has a bridge mode to bridge two network segments. If they are different networks altogether, that is what routers are for.

Not the answer you're looking for? Browse other questions tagged or ask your own question.