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

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

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

Inbound NAT rules in Azure ARM

最佳答案

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,我们可以找到hereenter image description here

关于azure - Azure ARM 中负载均衡器的入站 NAT 规则,如何指定端口范围?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43615935/

相关文章:

c# - Azure.Messaging.EventHubs 与 WindowsAzure.ServiceBus 生成的消息有区别吗?

linux - 如何将数据发送到 sFTP 服务器?以及如何上传/下载数据?

c# - 在 C#/Mono 中通过 TLS/SSL 通过 Ftp 上传

udp - NAT 的 UDP 连接状态的通常超时

Ubuntu 16.04 主机下的 Windows 8 VMWare guest 无法访问互联网

AzureFileCopyV4 上传到 Azure 存储静态网站时失败 "$web"

python-3.x - Azure 计算机视觉 API 中从本地存储的图像文件进行手写识别

node.js - 如何将 React 应用程序部署到 FTP 中

c# - 如果在使用 ConnectionMode.Direct 时不设置 ConnectionPolicy.ConnectionProtocol 会发生什么?

powershell - 禁止显示 Azure Stop-AzureRMVM cmdlet 警告消息框