Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
8.4k views
in .NET FTP by (200 points)
Hello,

I'm connecting to an ftp server via vpn tunnel. (juniper networks)
(the ftp server has a 164.x.x.x address)

once the vpn is established, I can use a regular ftp client(using the 164 address) to connect to the ftp server. everything works fine.

using edtftp.net 1.2.2 (c#), i cannot connect to the remote ftp server (active).
using PASV, I cannot receive 'data' from the remote ftp server. (control is fine).

i've somehow narrowed down the issue to this:
the vpn client assigns my computer a 192.168.140.x address upon establishing the vpn connection.
the regular ftp client somehow detects this and send the correct "PORT 192,168,140,8,16,83" command before receiving 'data'.

edtftp still sends the 164.x.x.x address when preparing to receive 'data'.

Is there a way to configure edtftp to send the 192.168.140.x address assigned to my computer by the vpn client?
I've tried
ftpdll.ActiveIPAddress = System.Net.IPAddress.Parse("192.168.140.8");
EnterpriseDT.Net.Ftp.PortRange pr = new EnterpriseDT.Net.Ftp.PortRange( 1680, 1900 );
ftpdll.ActivePortRange = pr;

but it still doesn't work.

any suggestions?



(I hope i'm not too obscure in describing my problem.)

3 Answers

0 votes
by (162k points)
PORT is for active mode - are you sure you are using PASV?

There's also the AutoPassiveIPSubstitution property on FTPClient for PASV problems like this.
0 votes
by (200 points)
You're right. apples and oranges. the PORT command is used in active mode. I only saw that line on the test ftp client.
I could only go forward with my testing if i used PASV mode for edtftp.

I had the ftp client connect via PASV mode and it also failed.
before i completely rule out that PASV mode would not work on this vpn+ftp server;
How do you use the AutoPassiveIPSubstitution property?
(http://www.enterprisedt.com/products/ed ... ocket.html)


Anyway, I get a very strange exception when I use Active mode (stops at DirDetails(...)) :

System.MissingMethodException
Method not found: Byte[] System.Net.IPAddress.GetAddressBytes().
Any idea on the above error? I think it's only on my machine/.net setup. I'll try testing on a different machine...
0 votes
by (200 points)
Okay, I got it to work.

The Active ftp issue has something to do with my machine.

Anyway, for the benefit of those who'll have the same problem;
set ActiveIPAddress the ip address that's assigned to your machine by the virtual network interface created by the vpn.

Categories

...