az network vhub route-table route

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 vhub route-table route command. Learn more about extensions.

Manage routes of route table in the virtual hub.

Commands

Name Description Type Status
az network vhub route-table route add

Add a route into route table of the virtual hub.

Extension GA
az network vhub route-table route list

List routes in the virtual hub route table.

Extension GA
az network vhub route-table route remove

Remove a route from route table of the virtual hub.

Extension GA

az network vhub route-table route add

Add a route into route table of the virtual hub.

az network vhub route-table route add --destination-type {CIDR, ResourceId, Service}
                                      --destinations
                                      --name
                                      --next-hop-type {ResourceId}
                                      --resource-group
                                      --vhub-name
                                      [--next-hop]
                                      [--no-wait]
                                      [--route-name]

Examples

Add a route with firewall as next hop into route table of the virtual hub (route table v3).

az network vhub route-table route add -n MyRouteTable -g MyResourceGroup --vhub-name MyVhub --destination-type CIDR --destinations "10.4.0.0/16" "10.6.0.0/16" --next-hop-type ResourceId --next-hop /subscriptions/MySub/resourceGroups/MyResourceGroup/providers/Microsoft.Network/azureFirewalls/MyFirewall

Required Parameters

--destination-type

The type of destinations.

accepted values: CIDR, ResourceId, Service
--destinations

Space-separated list of all destinations.

--name -n

Name of the virtual hub route table.

--next-hop-type

The type of next hop.

accepted values: ResourceId
--resource-group -g

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

--vhub-name

Name of the virtual hub.

Optional Parameters

--next-hop

The resource ID of the next hop.

--no-wait

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

default value: False
--route-name

The name of the route.

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 vhub route-table route list

List routes in the virtual hub route table.

az network vhub route-table route list --name
                                       --resource-group
                                       --vhub-name

Required Parameters

--name -n

Name of the virtual hub route table.

--resource-group -g

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

--vhub-name

Name of the virtual hub.

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 vhub route-table route remove

Remove a route from route table of the virtual hub.

az network vhub route-table route remove --index
                                         --name
                                         --resource-group
                                         --vhub-name
                                         [--no-wait]

Required Parameters

--index

List index of the item (starting with 1).

--name -n

Name of the virtual hub route table.

--resource-group -g

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

--vhub-name

Name of the virtual hub.

Optional Parameters

--no-wait

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

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.