New-AzLocalNetworkGateway
Creates a Local Network Gateway
Syntax
New-AzLocalNetworkGateway
-Name <String>
-ResourceGroupName <String>
-Location <String>
[-GatewayIpAddress <String>]
[-AddressPrefix <String[]>]
[-Asn <UInt32>]
[-BgpPeeringAddress <String>]
[-PeerWeight <Int32>]
[-Tag <Hashtable>]
[-Force]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzLocalNetworkGateway
-Name <String>
-ResourceGroupName <String>
-Location <String>
[-Fqdn <String>]
[-AddressPrefix <String[]>]
[-Asn <UInt32>]
[-BgpPeeringAddress <String>]
[-PeerWeight <Int32>]
[-Tag <Hashtable>]
[-Force]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Local Network Gateway is the object representing your VPN device On-Premises.
The New-AzLocalNetworkGateway cmdlet creates the object representing your on-prem gateway
based on the Name, Resource Group Name, Location, and IP Address of the gateway, as well as the
Address Prefix of the On-Premises network which will be connecting to Azure.
Examples
Example 1: Create a Local Network Gateway
New-AzLocalNetworkGateway -Name myLocalGW -ResourceGroupName myRG -Location "West US" -GatewayIpAddress 23.99.221.164 -AddressPrefix "10.5.51.0/24"
Creates the object of the Local Network Gateway with the name "myLocalGW" within the resource group
"myRG" in location "West US" with the IP address "23.99.221.164" and the address prefix
"10.5.51.0/24" on-prem.
Parameters
-AddressPrefix
Type: String [ ]
Position: Named
Default value: None
Required: False
Accept pipeline input: True
Accept wildcard characters: False
-AsJob
Run cmdlet in the background
Type: SwitchParameter
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False
-Asn
Type: UInt32
Position: Named
Default value: None
Required: False
Accept pipeline input: True
Accept wildcard characters: False
-BgpPeeringAddress
Type: String
Position: Named
Default value: None
Required: False
Accept pipeline input: True
Accept wildcard characters: False
-Confirm
Prompts you for confirmation before running the cmdlet.
Type: SwitchParameter
Aliases: cf
Position: Named
Default value: False
Required: False
Accept pipeline input: False
Accept wildcard characters: False
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with azure.
Type: IAzureContextContainer
Aliases: AzContext, AzureRmContext, AzureCredential
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False
-Force
Forces the command to run without asking for user confirmation.
Type: SwitchParameter
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False
-Fqdn
FQDN of local network gateway.
Type: String
Position: Named
Default value: None
Required: False
Accept pipeline input: True
Accept wildcard characters: False
-GatewayIpAddress
Type: String
Position: Named
Default value: None
Required: False
Accept pipeline input: True
Accept wildcard characters: False
-Location
Type: String
Position: Named
Default value: None
Required: True
Accept pipeline input: True
Accept wildcard characters: False
-Name
Type: String
Aliases: ResourceName
Position: Named
Default value: None
Required: True
Accept pipeline input: True
Accept wildcard characters: False
-PeerWeight
Type: Int32
Position: Named
Default value: None
Required: False
Accept pipeline input: True
Accept wildcard characters: False
-ResourceGroupName
Specifies the resource group that the local network gateway belongs to.
Type: String
Position: Named
Default value: None
Required: True
Accept pipeline input: True
Accept wildcard characters: False
-Tag
Key-value pairs in the form of a hash table. For example:
@{key0="value0";key1=$null;key2="value2"}
Type: Hashtable
Position: Named
Default value: None
Required: False
Accept pipeline input: True
Accept wildcard characters: False
-WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
Type: SwitchParameter
Aliases: wi
Position: Named
Default value: False
Required: False
Accept pipeline input: False
Accept wildcard characters: False
String
String [ ]
UInt32
Int32
Hashtable
Outputs
PSLocalNetworkGateway