Pasive FTP Port Redirection

This forum is not monitored by the SmartFTP staff. If you have a license please contact technical support by email.
Post Reply
Posts: 19
Joined: Sun Jun 01, 2008 11:09 am

Pasive FTP Port Redirection

Post by UncleSyd » Fri May 08, 2009 9:17 pm

Previously we've always used Passive mode to instigate transfers, but recently we've come up against a client who has a *very* strict firewall policy. The firewall is set to allow ports 20 & 21 and a range of 50100-51000.

We think we've modified the code correctly to force use of this range (see codeblock below) but it doesn't seem to be working. Can anyone point out what we've done wrong? The lines we've added are in purple.

Dim sfFTPPortPool As New sfFTPLib.FTPPortPool
sfFTPPortPool.SetPortRange(50100, 51000)


objFTPConnection.Host = objSettings.Server
objFTPConnection.Port = 21

objFTPConnection.LimitLocalPortRange = True
objFTPConnection.PortMode = enumPortMode.ftpPortModeManual

objFTPConnection.Username = objSettings.Username.ToString
objFTPConnection.Password = objSettings.Password.ToString
objFTPConnection.Protocol = enumProtocol.ftpProtocolSSLExplicit
objFTPConnection.Proxy.Type = enumProxyType.ftpProxyTypeNone
objFTPConnection.Client = System.Environment.MachineName
objFTPConnection.LogFile = IIf(objSettings.ClientLogFile = "empty", "", objSettings.ClientLogFile)
objFTPConnection.DataTransferMode = enumDataTransferMode.ftpDataTransferModeZ
objFTPConnection.Async = False
objFTPConnection.LISTOption = enumLISTOption.ftpLISTOptionLinks
objFTPConnection.TransferProgressEventInterval = 250
objFTPConnection.DataProtection = enumDataProtection.ftpDataProtectionPrivate
objFTPConnection.Timeout = 180
objFTPConnection.DataTransferKeepAlive = True
objFTPConnection.Passive = objSettings.Passive

Posts: 12031
Joined: Thu Oct 11, 2001 1:24 pm
Display name: Mat (SmartFTP)

Re: Pasive FTP Port Redirection

Post by mb » Sat May 09, 2009 5:13 am

Hello Syd ..

The port range only applies to PORT (active mode, Passive=false). For passive mode (PASV, Passive=true) the port range needs to be configured on the server side in the FTP server settings.


Post Reply