Jump to content


Photo

Pasive FTP Port Redirection


  • Please log in to reply
1 reply to this topic

#1 UncleSyd

UncleSyd
  • Members
  • 19 posts
  • Location:
    Wales

Posted 08 May 2009 - 09: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)


Try

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

#2 mb

mb

    Developer

  • Administrators
  • 11527 posts
  • Gender:
    Male
  • Location:
    Worldwide

Posted 09 May 2009 - 05: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.

Regards,
Mat




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users