Edit

Share via


New-AzP2sVpnGateway

Create a new P2SVpnGateway under VirtualHub for point to site connectivity.

Syntax

ByVirtualHubNameByVpnServerConfigurationObject (Default)

New-AzP2sVpnGateway
    -ResourceGroupName <String>
    -Name <String>
    -VpnGatewayScaleUnit <UInt32>
    -VirtualHubName <String>
    [-VpnServerConfiguration <PSVpnServerConfiguration>]
    [-VpnClientAddressPool <String[]>]
    [-CustomDnsServer <String[]>]
    [-RoutingConfiguration <PSRoutingConfiguration>]
    [-EnableInternetSecurityFlag]
    [-DisableInternetSecurityFlag]
    [-EnableRoutingPreferenceInternetFlag]
    [-P2SConnectionConfiguration <PSP2SConnectionConfiguration[]>]
    [-Tag <Hashtable>]
    [-AsJob]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ByVirtualHubNameByVpnServerConfigurationResourceId

New-AzP2sVpnGateway
    -ResourceGroupName <String>
    -Name <String>
    -VpnGatewayScaleUnit <UInt32>
    -VirtualHubName <String>
    -VpnServerConfigurationId <String>
    [-VpnClientAddressPool <String[]>]
    [-CustomDnsServer <String[]>]
    [-RoutingConfiguration <PSRoutingConfiguration>]
    [-EnableInternetSecurityFlag]
    [-DisableInternetSecurityFlag]
    [-EnableRoutingPreferenceInternetFlag]
    [-P2SConnectionConfiguration <PSP2SConnectionConfiguration[]>]
    [-Tag <Hashtable>]
    [-AsJob]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ByVirtualHubObjectByVpnServerConfigurationObject

New-AzP2sVpnGateway
    -ResourceGroupName <String>
    -Name <String>
    -VpnGatewayScaleUnit <UInt32>
    -VirtualHub <PSVirtualHub>
    [-VpnServerConfiguration <PSVpnServerConfiguration>]
    [-VpnClientAddressPool <String[]>]
    [-CustomDnsServer <String[]>]
    [-RoutingConfiguration <PSRoutingConfiguration>]
    [-EnableInternetSecurityFlag]
    [-DisableInternetSecurityFlag]
    [-EnableRoutingPreferenceInternetFlag]
    [-P2SConnectionConfiguration <PSP2SConnectionConfiguration[]>]
    [-Tag <Hashtable>]
    [-AsJob]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ByVirtualHubObjectByVpnServerConfigurationResourceId

New-AzP2sVpnGateway
    -ResourceGroupName <String>
    -Name <String>
    -VpnGatewayScaleUnit <UInt32>
    -VirtualHub <PSVirtualHub>
    -VpnServerConfigurationId <String>
    [-VpnClientAddressPool <String[]>]
    [-CustomDnsServer <String[]>]
    [-RoutingConfiguration <PSRoutingConfiguration>]
    [-EnableInternetSecurityFlag]
    [-DisableInternetSecurityFlag]
    [-EnableRoutingPreferenceInternetFlag]
    [-P2SConnectionConfiguration <PSP2SConnectionConfiguration[]>]
    [-Tag <Hashtable>]
    [-AsJob]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ByVirtualHubResourceIdByVpnServerConfigurationObject

New-AzP2sVpnGateway
    -ResourceGroupName <String>
    -Name <String>
    -VpnGatewayScaleUnit <UInt32>
    -VirtualHubId <String>
    [-VpnServerConfiguration <PSVpnServerConfiguration>]
    [-VpnClientAddressPool <String[]>]
    [-CustomDnsServer <String[]>]
    [-RoutingConfiguration <PSRoutingConfiguration>]
    [-EnableInternetSecurityFlag]
    [-DisableInternetSecurityFlag]
    [-EnableRoutingPreferenceInternetFlag]
    [-P2SConnectionConfiguration <PSP2SConnectionConfiguration[]>]
    [-Tag <Hashtable>]
    [-AsJob]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ByVirtualHubResourceIdByVpnServerConfigurationResourceId

New-AzP2sVpnGateway
    -ResourceGroupName <String>
    -Name <String>
    -VpnGatewayScaleUnit <UInt32>
    -VirtualHubId <String>
    -VpnServerConfigurationId <String>
    [-VpnClientAddressPool <String[]>]
    [-CustomDnsServer <String[]>]
    [-RoutingConfiguration <PSRoutingConfiguration>]
    [-EnableInternetSecurityFlag]
    [-DisableInternetSecurityFlag]
    [-EnableRoutingPreferenceInternetFlag]
    [-P2SConnectionConfiguration <PSP2SConnectionConfiguration[]>]
    [-Tag <Hashtable>]
    [-AsJob]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The New-AzP2sVpnGateway cmdlet enables you to create a new P2SVpnGateway under VirtualHub for Point to site connectivity from Point to site clients to Azure VirtualWan.

Examples

Example 1

$virtualHub = Get-AzVirtualHub -ResourceGroupName P2SCortexGATesting -Name WestUsVirtualHub
$vpnServerConfig1 = Get-AzVpnServerConfiguration -ResourceGroupName P2SCortexGATesting -Name WestUsConfig
$vpnClientAddressSpaces = New-Object string[] 1
$vpnClientAddressSpaces[0] = "192.168.2.0/24"
$createdP2SVpnGateway = New-AzP2sVpnGateway -ResourceGroupName P2SCortexGATesting -Name 683482ade8564515aed4b8448c9757ea-westus-gw -VirtualHub $virtualHub -VpnGatewayScaleUnit 1 -VpnClientAddressPool $vpnClientAddressSpaces -VpnServerConfiguration $vpnServerConfig1 -EnableInternetSecurityFlag -EnableRoutingPreferenceInternetFlag
ResourceGroupName              : P2SCortexGATesting
Name                           : 683482ade8564515aed4b8448c9757ea-westus-gw
Id                             : /subscriptions/b1f1deed-af60-4bab-9223-65d340462e24/resourceGroups/P2SCortexGATesting/providers/Microsoft.Network/p2sVpnGateways/683482ade8564515a
                                 ed4b8448c9757ea-westus-gw
Location                       : westus
VpnGatewayScaleUnit            : 1
VirtualHub                     : /subscriptions/b1f1deed-af60-4bab-9223-65d340462e24/resourceGroups/P2SCortexGATesting/providers/Microsoft.Network/virtualHubs/WestUsVirtualHub
VpnServerConfiguration         : /subscriptions/b1f1deed-af60-4bab-9223-65d340462e24/resourceGroups/P2SCortexGATesting/providers/Microsoft.Network/vpnServerConfigurations/WestUsConfig
VpnServerConfigurationLocation :
VpnClientConnectionHealth      : null
Type                           : Microsoft.Network/p2sVpnGateways
ProvisioningState              : Succeeded
P2SConnectionConfigurations    : [
                                   {
                                     "ProvisioningState": "Succeeded",
                                     "VpnClientAddressPool": {
                                       "AddressPrefixes": [
                                         "192.168.2.0/24"
                                       ]
                                     },
                                     "EnableInternetSecurity": True,
                                     "RoutingConfiguration": {
                                       "AssociatedRouteTable": {
                                         "Id": "/subscriptions/b1f1deed-af60-4bab-9223-65d340462e24/resourceGroups/P2SCortexGATesting/providers/Microsoft.Network/virtualHubs/WestUsVirtualHub/hubRouteTables/defaultRouteTable"
                                       }
                                       "PropagatedRouteTables": {
                                         "Labels": [],
                                         "Ids": [
                                           {
                                            "Id": "/subscriptions/b1f1deed-af60-4bab-9223-65d340462e24/resourceGroups/P2SCortexGATesting/providers/Microsoft.Network/virtualHubs/WestUsVirtualHub/hubRouteTables/defaultRouteTable"
                                           }
                                        ]
                                       },
                                       "VnetRoutes": {
                                         "StaticRoutes": []
                                       }
                                     },
                                     "Name": "P2SConnectionConfigDefault",
                                     "Etag": "W/\"4b96e6a2-b4d8-46b3-9210-76d40f359bef\"",
                                     "Id": "/subscriptions/b1f1deed-af60-4bab-9223-65d340462e24/resourceGroups/P2SCortexGATesting/providers/Microsoft.Network/p2sVpnGateways/683482
                                 ade8564515aed4b8448c9757ea-westus-gw/p2sConnectionConfigurations/P2SConnectionConfigDefault"
                                   }
                                 ]

The New-AzP2sVpnGateway cmdlet enables you to create a new P2SVpnGateway under VirtualHub for Point to site connectivity.

Parameters

-AsJob

Run cmdlet in the background

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-CustomDnsServer

The list of Custom Dns Servers.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DisableInternetSecurityFlag

Flag to disable internet security feature on this P2SVpnGateway P2SConnectionConfiguration.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-EnableInternetSecurityFlag

Enable internet security flag for this P2SVpnGateway connections

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-EnableRoutingPreferenceInternetFlag

Flag to enable Routing Preference Internet on this P2SVpnGateway.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Name

The resource name.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:ResourceName, P2SVpnGatewayName

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-P2SConnectionConfiguration

The list of P2SConnectionConfigurations that this P2SVpnGateway needs to have.

Parameter properties

Type:

PSP2SConnectionConfiguration[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ResourceGroupName

The resource name.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-RoutingConfiguration

Routing configuration for this connection

Parameter properties

Type:PSRoutingConfiguration
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Tag

A hashtable which represents resource tags.

Parameter properties

Type:Hashtable
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-VirtualHub

The VirtualHub this P2SVpnGateway needs to be associated with.

Parameter properties

Type:PSVirtualHub
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByVirtualHubObjectByVpnServerConfigurationObject
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False
ByVirtualHubObjectByVpnServerConfigurationResourceId
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-VirtualHubId

The Id of the VirtualHub this P2SVpnGateway needs to be associated with.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByVirtualHubResourceIdByVpnServerConfigurationObject
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False
ByVirtualHubResourceIdByVpnServerConfigurationResourceId
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-VirtualHubName

The Id of the VirtualHub this P2SVpnGateway needs to be associated with.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByVirtualHubNameByVpnServerConfigurationObject
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ByVirtualHubNameByVpnServerConfigurationResourceId
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-VpnClientAddressPool

P2S VpnClient AddressPool for this P2SVpnGateway P2SConnectionConfiguration.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-VpnGatewayScaleUnit

The scale unit for this P2SVpnGateway.

Parameter properties

Type:UInt32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-VpnServerConfiguration

The VpnServerConfiguration to be attached to this P2SVpnGateway.

Parameter properties

Type:PSVpnServerConfiguration
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByVirtualHubNameByVpnServerConfigurationObject
Position:Named
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False
ByVirtualHubObjectByVpnServerConfigurationObject
Position:Named
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False
ByVirtualHubResourceIdByVpnServerConfigurationObject
Position:Named
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-VpnServerConfigurationId

The id of Vpn server configuration object this P2SVpnGateway will be attached to.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByVirtualHubNameByVpnServerConfigurationResourceId
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False
ByVirtualHubObjectByVpnServerConfigurationResourceId
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False
ByVirtualHubResourceIdByVpnServerConfigurationResourceId
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

PSVirtualHub

System.String Microsoft.Azure.Commands.Network.Models.PSVpnServerConfiguration

Outputs

PSP2SVpnGateway