Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: How to force IP address for passive mode connections?

Thanks for your report.

This bug has been added to the tracker:
https://winscp.net/tracker/904

I'm sending you a fixed version for testing.
steven.dash

Found the setting.

sessionOptions.AddRawSettings("FtpForcePasvIp2", "0");
steven.dash

How to force IP address for passive mode connections?

Hi,

Here is my code, I dont know where the "Force IP address for passive mode connections" setting is in the .NET assembly, which I have had to enable to transfer a local file to a ftp server through the WinSCP GUI.


SessionOptions sessionOptions = new SessionOptions
{
Protocol = Protocol.Ftp,
HostName = "sos.com",
UserName = "sos",
Password = "xxxxxxxxx",
SslCertificate = "2b:04:a8L.. ",
FtpMode = FtpMode.Passive,
FtpSecure = FtpSecure.ExplicitTls
};


Without enabling "Force IP address for passive mode connection" setting I get the following error when using WinSCP GUI.

"Server sent passive reply with unroutable address xx.xx.xx.xx, using host address instead"

If I enable the "Force IP address for passive mode connection" setting in the WinSCP GUI everything works fine.

The problem is that I don't know how to enable this setting using the .NET assembly?

Any assistance would be very much appreciated.

Thanks,
Steven