使用 Azure 门户修改本地网络网关设置Modify local network gateway settings using the Azure portal

有时本地网络网关 AddressPrefix 或 GatewayIPAddress 的设置会变更。Sometimes the settings for your local network gateway AddressPrefix or GatewayIPAddress change. 本文演示如何修改本地网络网关设置。This article shows you how to modify your local network gateway settings. 还可以选择以下列表中的其他选项,使用另一种方法来修改这些设置:You can also modify these settings using a different method by selecting a different option from the following list:

在删除连接之前,可能需要下载用于连接设备的配置,以便获取已定义的 PSK。Before you delete the connection, you may want to download the configuration for your connecting devices in order to get the defined PSK. 这样,便无需在另一端重新定义它。That way, you don't need to redefine it on the other side.

修改 IP 地址前缀Modify IP address prefixes

修改 IP 地址前缀时,执行的步骤取决于你的本地网络网关是否具有连接。When you modify IP address prefixes, the steps you follow depend on whether your local network gateway has a connection.

修改本地网关 IP 地址前缀 - 无网关连接To modify local network gateway IP address prefixes - no gateway connection

添加其他地址前缀:To add additional address prefixes:

  1. 在“本地网络网关”资源的“设置” 部分中,单击“配置” 。On the Local Network Gateway resource, in the Settings section, click Configuration.
  2. 在“添加更多地址范围” 框中添加 IP 地址空间。Add the IP address space in the Add additional address range box.
  3. 单击“保存” 以保存设置。Click Save to save your settings.

删除地址前缀:To remove address prefixes:

  1. 在“本地网络网关”资源的“设置” 部分中,单击“配置” 。On the Local Network Gateway resource, in the Settings section, click Configuration.
  2. 在包含要删除的前缀的行上,单击“...” 。Click the '...' on the line containing the prefix you want to remove.
  3. 单击“删除”。 Click Remove.
  4. 单击“保存” 以保存设置。Click Save to save your settings.

修改本地网关 IP 地址前缀 - 现有网关连接To modify local network gateway IP address prefixes - existing gateway connection

如果有一个网关连接并且想要添加或删除包含在本地网关中的 IP 地址前缀,则需要按顺序执行以下步骤。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. 这会导致 VPN 连接中断一段时间。This results in some downtime for your VPN connection. 修改 IP 地址前缀时,不需删除 VPN 网关。When modifying IP address prefixes, you don't need to delete the VPN gateway. 只需删除连接。You only need to remove the connection.

1.删除连接。1. Remove the connection.

  1. 在“本地网络网关”资源的“设置” 部分中,单击“连接” 。On the Local Network Gateway resource, in the Settings section, click Connections.
  2. 在每个连接的行上单击“...” ,然后单击“删除” 。Click the ... on the line for each connection, then click Delete.
  3. 单击“保存” 以保存设置。Click Save to save your settings.

2.修改地址前缀。2. Modify the address prefixes.

添加其他地址前缀:To add additional address prefixes:

  1. 在“本地网络网关”资源的“设置” 部分中,单击“配置” 。On the Local Network Gateway resource, in the Settings section, click Configuration.
  2. 添加 IP 地址空间。Add the IP address space.
  3. 单击“保存” 以保存设置。Click Save to save your settings.

删除地址前缀:To remove address prefixes:

  1. 在“本地网络网关”资源的“设置” 部分中,单击“配置” 。On the Local Network Gateway resource, in the Settings section, click Configuration.
  2. 在含有要删除的前缀的行上,单击“...” 。Click the ... on the line containing the prefix you want to remove.
  3. 单击“删除”。 Click Remove.
  4. 单击“保存” 以保存设置。Click Save to save your settings.

3.重新创建连接。3. Recreate the connection.

  1. 导航到 VNet 的虚拟网络网关。Navigate to the Virtual Network Gateway for your VNet. (不是本地网络网关。)(Not the Local Network Gateway.)
  2. 在“虚拟网络网关”的“设置” 部分中,单击“连接” 。On the Virtual Network Gateway, in the Settings section, click Connections.
  3. 单击“+ 添加” 打开“添加连接” 边栏选项卡。Click the + Add to open the Add connection blade.
  4. 重新创建连接。Recreate your connection.
  5. 单击“确定”创建连接。 Click OK to create the connection.

修改网关 IP 地址Modify the gateway IP address

如果要连接的 VPN 设备已更改其公共 IP 地址,则需根据该更改修改本地网关。If the VPN device that you want to connect to has changed its public IP address, you need to modify the local network gateway to reflect that change. 更改公共 IP 地址时,执行的步骤取决于你的本地网络网关是否具有连接。When you change the public IP address, the steps you follow depend on whether your local network gateway has a connection.

修改本地网络网关 IP 地址 - 无网关连接To modify the local network gateway IP address - no gateway connection

请使用此示例修改没有网关连接的本地网关。Use the example to modify a local network gateway that does not have a gateway connection. 修改此值时,还可同时修改地址前缀。When modifying this value, you can also modify the address prefixes at the same time.

  1. 在“本地网络网关”资源的“设置” 部分中,单击“配置” 。On the Local Network Gateway resource, in the Settings section, click Configuration.
  2. 在“IP 地址” 框中,修改 IP 地址。In the IP address box, modify the IP address.
  3. 单击“保存” 保存这些设置。Click Save to save the settings.

修改本地网络网关 IP 地址的具体步骤 - 现有网关连接To modify the local network gateway IP address - existing gateway connection

若要修改具有连接的本地网络网关,需先删除该连接。To modify a local network gateway that has a connection, you need to first remove the connection. 删除连接后,可修改网关 IP 地址并重新创建一个新的连接。After the connection is removed, you can modify the gateway IP address and recreate a new connection. 此外可同时修改地址前缀。You can also modify the address prefixes at the same time. 这会导致 VPN 连接中断一段时间。This results in some downtime for your VPN connection. 修改网关 IP 地址时,不需删除 VPN 网关。When modifying the gateway IP address, you don't need to delete the VPN gateway. 只需删除连接。You only need to remove the connection.

1.删除连接。1. Remove the connection.

  1. 在“本地网络网关”资源的“设置” 部分中,单击“连接” 。On the Local Network Gateway resource, in the Settings section, click Connections.
  2. 在连接的行上单击“...” ,然后单击“删除” 。Click the ... on the line for the connection, then click Delete.
  3. 单击“保存” 以保存设置。Click Save to save your settings.

2.修改 IP 地址。2. Modify the IP address.

此外可同时修改地址前缀。You can also modify the address prefixes at the same time.

  1. 在“IP 地址” 框中,修改 IP 地址。In the IP address box, modify the IP address.
  2. 单击“保存” 保存这些设置。Click Save to save the settings.

3.重新创建连接。3. Recreate the connection.

  1. 导航到 VNet 的虚拟网络网关。Navigate to the Virtual Network Gateway for your VNet. (不是本地网络网关。)(Not the Local Network Gateway.)
  2. 在“虚拟网络网关”的“设置” 部分中,单击“连接” 。On the Virtual Network Gateway, in the Settings section, click Connections.
  3. 单击“+ 添加” 打开“添加连接” 边栏选项卡。Click the + Add to open the Add connection blade.
  4. 重新创建连接。Recreate your connection.
  5. 单击“确定”创建连接。 Click OK to create the connection.

后续步骤Next steps

可验证网关连接。You can verify your gateway connection. 请参阅验证网关连接See Verify a gateway connection.