Skip to content

Latest commit

 

History

History
39 lines (28 loc) · 1.13 KB

File metadata and controls

39 lines (28 loc) · 1.13 KB
ms.author cherylmc
author cherylmc
ms.date 12/02/2024
ms.service azure-vpn-gateway
ms.topic include

To add more address prefixes:

  1. Set the variable for the LocalNetworkGateway.

    $local = Get-AzLocalNetworkGateway -Name Site1 -ResourceGroupName TestRG1
    
  2. Modify the prefixes. The values you specify overwrite the previous values.

    Set-AzLocalNetworkGateway -LocalNetworkGateway $local `
    -AddressPrefix @('10.101.0.0/24','10.101.1.0/24','10.101.2.0/24')
    

To remove address prefixes:

Leave out the prefixes that you no longer need. In this example, we no longer need prefix 10.101.2.0/24 (from the previous example), so we update the local network gateway and exclude that prefix.

  1. Set the variable for the LocalNetworkGateway.

    $local = Get-AzLocalNetworkGateway -Name Site1 -ResourceGroupName TestRG1
    
  2. Set the gateway with the updated prefixes.

    Set-AzLocalNetworkGateway -LocalNetworkGateway $local `
    -AddressPrefix @('10.101.0.0/24','10.101.1.0/24')