Share via


az network local-gateway

Manage local gateways.

For more information on local gateways, visit: https://docs.microsoft.com/azure/vpn-gateway/vpn-gateway-howto-site-to-site-resource-manager-cli#localnet.

Commands

Name Description Type Status
az network local-gateway create

Create a local VPN gateway.

Core GA
az network local-gateway delete

Delete a local VPN gateway.

Core GA
az network local-gateway list

List all local VPN gateways in a resource group.

Core GA
az network local-gateway show

Get the details of a local VPN gateway.

Core GA
az network local-gateway update

Update a local VPN gateway.

Core GA
az network local-gateway wait

Place the CLI in a waiting state until a condition is met.

Core GA

az network local-gateway create

Create a local VPN gateway.

az network local-gateway create --name
                                --resource-group
                                [--address-prefixes]
                                [--asn]
                                [--bgp-peering-address]
                                [--gateway-ip-address]
                                [--location]
                                [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                                [--peer-weight]
                                [--tags]

Examples

Create a Local Network Gateway to represent your on-premises site.

az network local-gateway create -g MyResourceGroup -n MyLocalGateway --gateway-ip-address 23.99.221.164 --local-address-prefixes 10.0.0.0/24 20.0.0.0/24

Required Parameters

--name -n

Name of the local network gateway.

--resource-group -g

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

Optional Parameters

--address-prefixes --local-address-prefixes

List of CIDR block prefixes representing the address space of the OnPremise VPN's subnet. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--asn

Autonomous System Number to use for the BGP settings.

--bgp-peering-address

IP address from the OnPremise VPN's subnet to use for BGP peering.

--gateway-ip-address

Gateway's public IP address. (e.g. 10.1.1.1).

--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.

Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--peer-weight

Weight (0-100) added to routes learned through BGP peering.

--tags

Space-separated tags: key[=value] [key[=value] ...]. 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 local-gateway delete

Delete a local VPN gateway.

In order to delete a Local Network Gateway, you must first delete ALL Connection objects in Azure that are connected to the Gateway. After deleting the Gateway, proceed to delete other resources now not in use. For more information, follow the order of instructions on this page: https://docs.microsoft.com/azure/vpn-gateway/vpn-gateway-delete-vnet-gateway-portal.

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

Examples

Delete a Local Network Gateway.

az network local-gateway delete -g MyResourceGroup -n MyLocalGateway

Delete a local VPN gateway. (autogenerated)

az network local-gateway delete --name MyLocalGateway --resource-group MyResourceGroup --subscription MySubscription

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

Name of the local network 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 local-gateway list

List all local VPN gateways in a resource group.

az network local-gateway list --resource-group

Examples

List all local VPN gateways in a resource group.

az network local-gateway list -g MyResourceGroup

Required 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 local-gateway show

Get the details of a local VPN gateway.

az network local-gateway show [--ids]
                              [--name]
                              [--resource-group]
                              [--subscription]

Examples

Get the details of a local VPN gateway.

az network local-gateway show -g MyResourceGroup -n MyLocalGateway

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

Name of the local network gateway.

--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 local-gateway update

Update a local VPN gateway.

az network local-gateway update [--add]
                                [--address-prefixes]
                                [--asn]
                                [--bgp-peering-address]
                                [--force-string {0, 1, f, false, n, no, t, true, y, yes}]
                                [--gateway-ip-address]
                                [--ids]
                                [--name]
                                [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                                [--peer-weight]
                                [--remove]
                                [--resource-group]
                                [--set]
                                [--subscription]
                                [--tags]

Examples

Update a Local Network Gateway provisioned with a 10.0.0.0/24 address prefix with additional prefixes.

az network local-gateway update -g MyResourceGroup -n MyLocalGateway --address-prefixes 10.0.0.0/24 20.0.0.0/24 30.0.0.0/24

Update a local VPN gateway. (autogenerated)

az network local-gateway update --gateway-ip-address 23.99.221.164 --name MyLocalGateway --resource-group MyResourceGroup

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>.

--address-prefixes --local-address-prefixes

List of CIDR block prefixes representing the address space of the OnPremise VPN's subnet. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--asn

Autonomous System Number to use for the BGP settings.

--bgp-peering-address

IP address from the OnPremise VPN's subnet to use for BGP peering.

--force-string

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

Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--gateway-ip-address

Gateway's public IP address. (e.g. 10.1.1.1).

--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

Name of the local network 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
--peer-weight

Weight (0-100) added to routes learned through BGP peering.

--remove

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

--resource-group -g

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

--set

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

--subscription

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

--tags

Space-separated tags: key[=value] [key[=value] ...]. 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 local-gateway wait

Place the CLI in a waiting state until a condition is met.

az network local-gateway wait [--created]
                              [--custom]
                              [--deleted]
                              [--exists]
                              [--ids]
                              [--interval]
                              [--name]
                              [--resource-group]
                              [--subscription]
                              [--timeout]
                              [--updated]

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
--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.

--interval

Polling interval in seconds.

Default value: 30
--name -n

Name of the local network gateway.

--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.

--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.