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

时间:2017-04-25 16:13:54

标签: azure ftp nat azure-virtual-network azure-resource-manager

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

Inbound NAT rules in Azure ARM

1 个答案:

答案 0 :(得分:4)

  

在下面的图片中,NAT规则似乎只允许您转发   一次一个端口。是否可以转发一系列端口?

端口范围目前支持 作为解决方法,我们可以使用 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 ,我们可以找到它hereenter image description here