Del via


az network p2s-vpn-gateway

Note

This reference is part of the virtual-wan extension for the Azure CLI (version 2.55.0 or higher). The extension will automatically install the first time you run an az network p2s-vpn-gateway command. Learn more about extensions.

Manage point-to-site VPN gateway.

Commands

Name Description Type Status
az network p2s-vpn-gateway connection

Manage point-to-site VPN gateway connections.

Extension Preview
az network p2s-vpn-gateway connection list

List all connections for a given point-to-site VPN gateway.

Extension Preview
az network p2s-vpn-gateway connection show

Show the details of a point-to-site VPN gateway connection.

Extension Preview
az network p2s-vpn-gateway create

Create a point-to-site VPN gateway.

Extension GA
az network p2s-vpn-gateway delete

Delete a point-to-site VPN gateway.

Extension GA
az network p2s-vpn-gateway disconnect

Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource group.

Extension GA
az network p2s-vpn-gateway list

List all point-to-site VPN gateway.

Extension GA
az network p2s-vpn-gateway reset

Resets the primary of the p2s vpn gateway in the specified resource group.

Extension GA
az network p2s-vpn-gateway show

Show the details of a point-to-site VPN gateway.

Extension GA
az network p2s-vpn-gateway update

Update settings of a point-to-site VPN gateway.

Extension GA
az network p2s-vpn-gateway vpn-client

Download a VPN client configuration required to connect to Azure via point-to-site.

Extension GA
az network p2s-vpn-gateway vpn-client generate

Generate VPN profile for P2S client of the P2SVpnGateway in the specified resource group.

Extension GA
az network p2s-vpn-gateway wait

Place the CLI in a waiting state until a condition of the point-to-site VPN gateway is met.

Extension GA

az network p2s-vpn-gateway create

Create a point-to-site VPN gateway.

az network p2s-vpn-gateway create --name
                                  --resource-group
                                  --scale-unit
                                  --vhub
                                  [--address-space]
                                  [--associated]
                                  [--associated-inbound-routemap]
                                  [--associated-outbound-routemap]
                                  [--config-name]
                                  [--labels]
                                  [--location]
                                  [--no-wait]
                                  [--propagated]
                                  [--tags]
                                  [--vpn-server-config]

Examples

Create a point-to-site VPN gateway.

az network p2s-vpn-gateway create -g MyRG -n MyP2SVPNGateway --scale-unit 2 --vhub MyVhub --vpn-server-config MyVPNServerConfig --address-space 10.0.0.0/24 11.0.0.0/24

Create a point-to-site VPN gateway with routing configuration.

az network p2s-vpn-gateway create -g MyRG -n MyP2SVPNGateway --scale-unit 2 --vhub MyVhub --vpn-server-config MyVPNServerConfig --address-space 10.0.0.0/24 11.0.0.0/24 --associated-route-table /subscriptions/MySub/resourceGroups/MyRG/providers/Microsoft.Network/virtualHubs/MyHub/hubRouteTables/MyRouteTable1 --propagated-route-tables /subscriptions/MySub/resourceGroups/MyRG/providers/Microsoft.Network/virtualHubs/MyHub/hubRouteTables/MyRouteTable1 /subscriptions/MySub/resourceGroups/MyRG/providers/Microsoft.Network/virtualHubs/MyHub/hubRouteTables/MyRouteTable2 --labels label1 label2

Required Parameters

--name -n

Name of the P2S Vpn Gateway.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--scale-unit

The scale unit for this VPN gateway.

--vhub

Name or ID of a virtual hub.

Optional Parameters

--address-space

Address space for P2S VpnClient. Space-separated list of IP address ranges.

--associated --associated-route-table
Preview

The resource id of route table associated with this routing configuration.

--associated-inbound-routemap

Resource uri of inbound routemap for this connection’s routing configuration.

--associated-outbound-routemap

Resource uri of outbound routemap for this connection’s routing configuration.

--config-name

Name or p2s connection configuration.

Default value: P2SConnectionConfigDefault
--labels
Preview

Space-separated list of labels for propagated route tables.

--location -l

Location. Values from: az account list-locations. You can configure the default location using az configure --defaults location=<location>.

--no-wait

Do not wait for the long-running operation to finish.

Default value: False
--propagated --propagated-route-tables
Preview

Space-separated list of resource id of propagated route tables.

--tags

Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.

--vpn-server-config

Name or ID of a vpn server configuration.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az network p2s-vpn-gateway delete

Delete a point-to-site VPN gateway.

az network p2s-vpn-gateway delete --name
                                  --resource-group
                                  [--yes]

Required Parameters

--name -n

Name of the P2S Vpn Gateway.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--yes -y

Do not prompt for confirmation.

Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az network p2s-vpn-gateway disconnect

Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource group.

az network p2s-vpn-gateway disconnect [--ids]
                                      [--name]
                                      [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                                      [--resource-group]
                                      [--subscription]
                                      [--vpn-connection-ids]

Examples

Disconnect P2S vpn connections.

az network p2s-vpn-gateway disconnect -g MyResourceGroup -n MyP2sGateway --vpn-connection-ids "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup/providers/Microsoft.Network/p2sVpnGateways/MyP2sGateway/p2sConnectionConfigurations/P2SConnectionConfigDefault"

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--name -n

The name of the P2S Vpn Gateway.

--no-wait

Do not wait for the long-running operation to finish.

Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--vpn-connection-ids

List of p2s vpn connection Ids. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az network p2s-vpn-gateway list

List all point-to-site VPN gateway.

az network p2s-vpn-gateway list [--resource-group]

Optional Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az network p2s-vpn-gateway reset

Resets the primary of the p2s vpn gateway in the specified resource group.

az network p2s-vpn-gateway reset [--ids]
                                 [--name]
                                 [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                                 [--resource-group]
                                 [--subscription]

Examples

Resets the primary of the p2s vpn gateway.

az network p2s-vpn-gateway reset -g MyResourceGroup -n MyP2sGateway

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--name -n

The name of the gateway.

--no-wait

Do not wait for the long-running operation to finish.

Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az network p2s-vpn-gateway show

Show the details of a point-to-site VPN gateway.

az network p2s-vpn-gateway show --name
                                --resource-group

Required Parameters

--name -n

Name of the P2S Vpn Gateway.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az network p2s-vpn-gateway update

Update settings of a point-to-site VPN gateway.

az network p2s-vpn-gateway update --name
                                  --resource-group
                                  [--add]
                                  [--address-space]
                                  [--associated]
                                  [--associated-inbound-routemap]
                                  [--associated-outbound-routemap]
                                  [--config-name]
                                  [--force-string]
                                  [--labels]
                                  [--no-wait]
                                  [--propagated]
                                  [--remove]
                                  [--scale-unit]
                                  [--set]
                                  [--tags]
                                  [--vpn-server-config]

Examples

Add labels for propagated route tables under routing configuration.

az network p2s-vpn-gateway update -g MyRG -n MyP2SVPNGateway --labels Newlabel1 Newlabel2 Newlabel3

Required Parameters

--name -n

Name of the P2S Vpn Gateway.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--add

Add an object to a list of objects by specifying a path and key value pairs. Example: --add property.listProperty <key=value, string or JSON string>.

Default value: []
--address-space

Address space for P2S VpnClient. Space-separated list of IP address ranges.

--associated --associated-route-table
Preview

The resource id of route table associated with this routing configuration.

--associated-inbound-routemap

Resource uri of inbound routemap for this connection’s routing configuration.

--associated-outbound-routemap

Resource uri of outbound routemap for this connection’s routing configuration.

--config-name

Name or p2s connection configuration.

--force-string

When using 'set' or 'add', preserve string literals instead of attempting to convert to JSON.

Default value: False
--labels
Preview

Space-separated list of labels for propagated route tables.

--no-wait

Do not wait for the long-running operation to finish.

Default value: False
--propagated --propagated-route-tables
Preview

Space-separated list of resource id of propagated route tables.

--remove

Remove a property or an element from a list. Example: --remove property.list <indexToRemove> OR --remove propertyToRemove.

Default value: []
--scale-unit

The scale unit for this VPN gateway.

--set

Update an object by specifying a property path and value to set. Example: --set property1.property2=<value>.

Default value: []
--tags

Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.

--vpn-server-config

Name or ID of a vpn server configuration.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az network p2s-vpn-gateway wait

Place the CLI in a waiting state until a condition of the point-to-site VPN gateway is met.

az network p2s-vpn-gateway wait --name
                                --resource-group
                                [--created]
                                [--custom]
                                [--deleted]
                                [--exists]
                                [--interval]
                                [--timeout]
                                [--updated]

Required Parameters

--name -n

Name of the P2S Vpn Gateway.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--created

Wait until created with 'provisioningState' at 'Succeeded'.

Default value: False
--custom

Wait until the condition satisfies a custom JMESPath query. E.g. provisioningState!='InProgress', instanceView.statuses[?code=='PowerState/running'].

--deleted

Wait until deleted.

Default value: False
--exists

Wait until the resource exists.

Default value: False
--interval

Polling interval in seconds.

Default value: 30
--timeout

Maximum wait in seconds.

Default value: 3600
--updated

Wait until updated with provisioningState at 'Succeeded'.

Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.