Configuring FTP Firewall Support for dynamic IP in IIS 7.5
If like me you’re stuck with a dynamic IP address on your Internet connection but still wish to provide FTP services from IIS7.5 on Windows Server 20008R2, you may have noticed that when connecting to the FTPS server with an FTP client, you receive the internal IP address of your FTP server in the control commands which leaves some FTP clients flustered and unable to communicate with your FTP server.
If you’re hosting your server beyond a NAT device, the correct solution is to complete the external IP address under the FTP Firewall Support section within IIS 7.5, but if like me you have a dynamic IP address you’re going to be kept busy doing just that!
Using a three line PowerShell script, you can keep your FTP site’s FTP Firewall Support IP address up to date automatically. Just combine it with Task Scheduler to update at your desired frequency.
$ip=[System.Net.Dns]::GetHostAddresses("host.domain.com")| Select-Object -ExpandProperty IPAddressToString
Set-WebConfigurationProperty -filter "/system.applicationHost/sites/site[@name='nameofsite' and @id='1']/ftpServer/firewallSupport" -name externalIp4Address -value $ip
FileZilla FTP Client is one of the FTP clients which is intelligent enough to detect when it has been sent an internal IP address in the command response and automatically changes it to the external IP address of the server but relying on this as a long term solution is not feasible.