我有一个现有的端到端连接 Azure 网关,其中一个本地网络具有三个不同的地址空间,用于连接到客户的 Intranet。它已启动并正在运行,运行得非常顺利。
现在我需要第四个地址空间。我确实添加了它,关闭了网关的连接并再次创建了它。看起来并没有考虑新的地址空间。
是否真的有必要删除并重新创建整个网关,将新创建的 key 传递给客户才能使其正常工作?我在这里找不到 Azure 文档中的任何内容。
感谢您的任何提示。
最佳答案
If you have a gateway connection and want to add or remove the IP address prefixes contained in your local network gateway, you need to do the following steps, in order. This results in some downtime for your VPN connection. When modifying IP address prefixes, you don't need to delete the VPN gateway. You only need to remove the connection.
To modify local network gateway IP address prefixes - existing gateway connection
- 删除连接。
Remove-AzureRmVirtualNetworkGatewayConnection -Name MyGWConnectionName -ResourceGroupName MyRGName
- 修改本地网关的地址前缀。
设置 LocalNetworkGateway 的变量
$local = Get-AzureRmLocalNetworkGateway -Name MyLocalNetworkGWName -ResourceGroupName MyRGName
修改前缀。
Set-AzureRmLocalNetworkGateway -LocalNetworkGateway $local `
-AddressPrefix @('10.0.0.0/24','20.0.0.0/24','30.0.0.0/24')
- 创建连接。在此示例中,我们配置 IPsec 连接类型。重新创建连接时,请使用为您的配置指定的连接类型。有关其他连接类型,请参阅 PowerShell cmdlet 页面。
设置 VirtualNetworkGateway 的变量。
$gateway1 = Get-AzureRmVirtualNetworkGateway -Name RMGateway -ResourceGroupName MyRGName
创建连接。此示例使用您在步骤 2 中设置的变量 $local。
New-AzureRmVirtualNetworkGatewayConnection -Name MyGWConnectionName `
-ResourceGroupName MyRGName -Location 'West US' `
-VirtualNetworkGateway1 $gateway1 -LocalNetworkGateway2 $local `
-ConnectionType IPsec `
-RoutingWeight 10 -SharedKey 'abc123'
关于azure现有VPN和网关,添加地址空间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30664922/