Created
August 28, 2019 16:13
-
-
Save kongou-ae/6f16e3e19ae9f24cdfef8402c4a54438 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$region = "YOUR-REGION" | |
$rg = New-AzureRmResourceGroup -Location $region -Name "vnet-gateway" | |
$subnet = New-AzureRMVirtualNetworkSubnetConfig -Name 'gatewaysubnet' -AddressPrefix '10.254.0.0/27' | |
$ngwpip = New-AzureRMPublicIpAddress -Name ngwpip -ResourceGroupName $rg.ResourceGroupName -Location $region -AllocationMethod Dynamic | |
$vnet = New-AzureRmVirtualNetwork -AddressPrefix "10.254.0.0/27" -Location $region -Name vnet-gateway ` | |
-ResourceGroupName $rg.ResourceGroupName -Subnet $subnet | |
$subnet = Get-AzureRmVirtualNetworkSubnetConfig -name 'gatewaysubnet' -VirtualNetwork $vnet | |
$ngwipconfig = New-AzureRMVirtualNetworkGatewayIpConfig -Name ngwipconfig -SubnetId $subnet.Id -PublicIpAddressId $ngwpip.Id | |
New-AzureRmVirtualNetworkGateway -Name myNGW -ResourceGroupName $rg.ResourceGroupName -Location $region ` | |
-IpConfigurations $ngwIpConfig -GatewayType "Vpn" -VpnType "RouteBased" -GatewaySku "Basic" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment