azure现有VPN和网关,添加地址空间

标签 azure vpn gateway

我有一个现有的端到端连接 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

  1. 删除连接。
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/

    相关文章:

    java - 如何在Java类配置中定义 `TcpOutboundGateway` bean

    javascript - 如何使用微软人脸API?

    azure - 从 Azure VM 中的 Azure 容器注册表运行容器

    asp.net-mvc - 从 Windows Azure 连接到 VPN

    uwp - 有没有办法在 UWP 应用程序中从 IVpnProfile 获取 ConnectionStatus?

    hadoop - 使用边缘节点运行 Hadoop 集群时如何连接到 Impala

    sql-server - 自动将 Azure VM 服务器 SQL 作业备份复制到另一台服务器?

    c# - 在 WCF Azure 服务总线中动态分配 json 响应内容类型

    java - GRADLE Build Error:权限被拒绝:没有更多信息

    android - 在android中获取网关IP地址