Azure ARM 中负载均衡器的入站 NAT 规则,如何指定端口范围?

Inbound NAT rules on Load balancer in Azure ARM, how to specify RANGE of ports?

在 Azure 中,我们使用负载平衡通过入站 NAT 规则将端口转发到我们的 VM。我们正在尝试为被动 FTP 端口设置端口转发,因此我们至少需要转发 100 个端口。在下图中,NAT 规则似乎一次只允许您转发一个端口。是否可以转发一系列端口?例如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?

目前支持端口范围。
作为解决方法,我们可以使用 PowerShell 更新 这个负载均衡器,并向它添加多个 NAT 规则。

$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

负载均衡规则的当前限制是150,我们可以找到here.