In Azure, we are using a load balance to forward ports to our VMs using the Inbound NAT rules. We are trying to setup port forwarding for passive FTP ports, and so we need at least 100 ports to be forwarded. In the Image below, the NAT rules appear to only allow your to forward one port at a time. Is it possible to forward a range of ports? e.g. 60000-62000
In the Image below, the NAT rules appear to only allow your to forward one port at a time. Is it possible to forward a range of ports?
Port range is currently not supported.
As a workaround, we can use PowerShell to update this load balancer, and add multiple NAT rules to it.
$slb = Get-AzureRmLoadBalancer -Name NRPLB -ResourceGroupName NRP-RG
$slb | Add-AzureRmLoadBalancerInboundNatRuleConfig -Name ftp1 -FrontendIpConfiguration $slb.FrontendIpConfigurations[0] -FrontendPort 60000 -BackendPort 60000 -Protocol Tcp
$slb | Add-AzureRmLoadBalancerInboundNatRuleConfig -Name ftp2 -FrontendIpConfiguration $slb.FrontendIpConfigurations[0] -FrontendPort 60001 -BackendPort 60001 -Protocol Tcp
.
.
.
.
$slb | Add-AzureRmLoadBalancerInboundNatRuleConfig -Name ftp50 -FrontendIpConfiguration $slb.FrontendIpConfigurations[0] -FrontendPort 60050 -BackendPort 60050 -Protocol Tcp
$slb | Set-AzureRmLoadBalancer #save the new configure
The current limit of load balancing rules is 150, we can find it here.