Skip to content

Commit 2683def

Browse files
authored
Merge pull request #4064 from weeyin83/patch-1
Update New-AzureRmVirtualNetworkGateway.md
2 parents 0aa0e79 + 9d0d7ba commit 2683def

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/ResourceManager/Network/Commands.Network/help/New-AzureRmVirtualNetworkGateway.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,20 @@ You can also choose to include other features like BGP and Active-Active.
3636

3737
### 1: Create a Virtual Network Gateway
3838
```
39-
New-AzureRmVirtualNetworkGateway -Name myGW -ResourceGroupName myRG -Location "West US" -IpConfigurations $gwIpConfig -GatewayType "Vpn" -VpnType "RouteBased" -GatewaySku "Standard"
39+
New-AzureRmResourceGroup -Location "UK West" -Name "vnet-gateway"
40+
New-AzureRMVirtualNetworkSubnetConfig -Name 'gatewaysubnet' -AddressPrefix '10.254.0.0/27'
41+
42+
$ngwpip = New-AzureRMPublicIpAddress -Name ngwpip -ResourceGroupName "vnet-gateway" -Location "UK West" -AllocationMethod Dynamic
43+
$vnet = New-AzureRmVirtualNetwork -AddressPrefix "10.254.0.0/27" -Location "UK West" -Name vnet-gateway -ResourceGroupName "vnet-gateway" -Subnet $subnet
44+
$subnet = Get-AzureRmVirtualNetworkSubnetConfig -name 'gatewaysubnet' -VirtualNetwork $vnet
45+
$ngwipconfig = New-AzureRMVirtualNetworkGatewayIpConfig -Name ngwipconfig -SubnetId $subnet.Id -PublicIpAddressId $ngwpip.Id
46+
47+
New-AzureRmVirtualNetworkGateway -Name myNGW -ResourceGroupName vnet-gateway -Location "UK West" -IpConfigurations $ngwIpConfig -GatewayType "Vpn" -VpnType "RouteBased" -GatewaySku "Basic"
4048
```
49+
The above will create a resource group, request a Public IP Address, create a Virtual Network and subnet and create a Virtual Network Gateway in Azure.
50+
51+
The gateway will be called "vngw" within the resource group "vnet-gateway" in the location "UK West" with the previously created IP configurations saved in the variable "ngwIPConfig," the gateway type of "VPN," the vpn type "RouteBased," and the sku "Basic."
4152

42-
Creates the Virtual Network Gateway in Azure with the name "myGW" within the resource group "myRG" in the location "West US" with the previously created IP configurations saved in the variable "gwIpConfig," the gateway type of "Vpn," the vpn type "RouteBased," and the sku "Standard."
4353

4454
## PARAMETERS
4555

0 commit comments

Comments
 (0)