共用方式為


az network vpn-gateway connection

備註

此參考是 Azure CLI 的 虛擬 wan 擴充功能的一部分(2.55.0 版或更新版本)。 擴充功能會在您第一次執行 az network vpn-gateway connection 命令時自動安裝。 深入瞭解擴充功能

管理站對站 VPN 網關聯機。

命令

名稱 Description 類型 狀態
az network vpn-gateway connection create

建立站對站 VPN 網關聯機。

擴充套件 GA
az network vpn-gateway connection delete

刪除站對站 VPN 網關聯機。

擴充套件 GA
az network vpn-gateway connection ipsec-policy

管理站對站 VPN 網關聯機 IPSec 原則。

擴充套件 GA
az network vpn-gateway connection ipsec-policy add

將IPSec原則新增至站對站 VPN 網關聯機。

擴充套件 GA
az network vpn-gateway connection ipsec-policy list

列出站對站 VPN 網關聯機 IPSec 原則。

擴充套件 GA
az network vpn-gateway connection ipsec-policy remove

從站對站 VPN 網關聯機移除 IPSec 原則。

擴充套件 GA
az network vpn-gateway connection list

列出站對站 VPN 網關聯機。

擴充套件 GA
az network vpn-gateway connection packet-capture

管理站對站 VPN 網關聯機封包擷取。

擴充套件 GA
az network vpn-gateway connection packet-capture start

在指定的資源群組中的 Vpn 連線上啟動封包擷取。

擴充套件 GA
az network vpn-gateway connection show

取得站對站 VPN 網關聯機的詳細數據。

擴充套件 GA
az network vpn-gateway connection update

更新 VPN 網關聯機的設定。

擴充套件 GA
az network vpn-gateway connection vpn-site-link-conn

管理站對站 VPN 網關聯機 VPN 月臺連結連線。

擴充套件 GA
az network vpn-gateway connection vpn-site-link-conn add

將 VPN 月台連結連線新增至站對站 VPN 網關聯機。

擴充套件 GA
az network vpn-gateway connection vpn-site-link-conn ipsec-policy

管理站對站 VPN 網關聯機 VPN 月臺連結 IPSec 原則。

擴充套件 GA
az network vpn-gateway connection vpn-site-link-conn ipsec-policy add

將IPSec原則新增至站對站 VPN 網關聯機 VPN 網站連結。

擴充套件 GA
az network vpn-gateway connection vpn-site-link-conn ipsec-policy list

列出站對站 VPN 網關聯機 VPN 月臺連結 IPSec 原則。

擴充套件 GA
az network vpn-gateway connection vpn-site-link-conn ipsec-policy remove

從站對站 VPN 網關聯機 VPN 網站連結移除 IPSec 原則。

擴充套件 GA
az network vpn-gateway connection vpn-site-link-conn list

列出站對站 VPN 網關聯機 VPN 月臺連結連線。

擴充套件 GA
az network vpn-gateway connection vpn-site-link-conn remove

從站對站 VPN 網關聯機移除 VPN 月台連結連線。

擴充套件 GA
az network vpn-gateway connection wait

將 CLI 置於等候狀態,直到符合站對站 VPN 網關聯機的條件為止。

擴充套件 GA

az network vpn-gateway connection create

建立站對站 VPN 網關聯機。

az network vpn-gateway connection create --gateway-name
                                         --name
                                         --remote-vpn-site
                                         --resource-group
                                         [--associated]
                                         [--associated-inbound-routemap]
                                         [--associated-outbound-routemap]
                                         [--connection-bandwidth]
                                         [--enable-bgp {false, true}]
                                         [--internet-security {false, true}]
                                         [--labels]
                                         [--no-wait]
                                         [--propagated]
                                         [--protocol-type {IKEv1, IKEv2}]
                                         [--rate-limiting {false, true}]
                                         [--routing-weight]
                                         [--shared-key]
                                         [--vpn-site-link]
                                         [--with-link {false, true}]

範例

建立站對站 VPN 網關聯機

az network vpn-gateway connection create -g MyRG -n MyConnection --gateway-name MyGateway --remote-vpn-site /subscriptions/MySub/resourceGroups/MyRG/providers/Microsoft.Network/vpnSites/MyVPNSite --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

必要參數

--gateway-name

VPN 閘道名稱。

--name -n

VPN 網關聯機的名稱。

--remote-vpn-site

遠端 VPN 月臺的識別碼名稱。

--resource-group -g

資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。

選擇性參數

--associated --associated-route-table
預覽

與此路由組態相關聯的路由表資源標識符。

--associated-inbound-routemap

此連線路由組態的輸入路由對應資源 URI。

--associated-outbound-routemap

此連線路由組態的輸出路由對應資源 URI。

--connection-bandwidth

以 Mbps 為單位的預期頻寬。

--enable-bgp

啟用 BGP。

接受的值: false, true
--internet-security

啟用因特網安全性。

接受的值: false, true
--labels
預覽

傳播路由表的標籤以空格分隔的清單。

--no-wait

請勿等候長時間執行的作業完成。

預設值: False
--propagated --propagated-route-tables
預覽

已傳播路由表的資源標識符空間分隔清單。

--protocol-type

線上通訊協定。

接受的值: IKEv1, IKEv2
--rate-limiting

啟用速率限制。

接受的值: false, true
--routing-weight

路由權數。

--shared-key

共用金鑰。

--vpn-site-link

VPN 網站鏈接的資源識別碼。

--with-link

使用預設連結建立 VpnConnection。

接受的值: false, true
全域參數
--debug

提高日誌詳細程度以顯示所有調試日誌。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。

az network vpn-gateway connection delete

刪除站對站 VPN 網關聯機。

az network vpn-gateway connection delete [--gateway-name]
                                         [--ids]
                                         [--name]
                                         [--resource-group]
                                         [--subscription]

範例

刪除站對站 VPN 網關聯機

az network vpn-gateway connection delete -g MyRG -n MyConnection --gateway-name MyGateway

選擇性參數

--gateway-name

VPN 閘道名稱。

--ids

一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

--name -n

VPN 網關聯機的名稱。

--resource-group -g

資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。

全域參數
--debug

提高日誌詳細程度以顯示所有調試日誌。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。

az network vpn-gateway connection list

列出站對站 VPN 網關聯機。

az network vpn-gateway connection list --gateway-name
                                       --resource-group

範例

列出指定站對站 VPN 閘道的所有連線

az network vpn-gateway connection list -g MyRG --gateway-name MyGateway

必要參數

--gateway-name

VPN 閘道名稱。

--resource-group -g

資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。

全域參數
--debug

提高日誌詳細程度以顯示所有調試日誌。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。

az network vpn-gateway connection show

取得站對站 VPN 網關聯機的詳細數據。

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

範例

取得站對站 VPN 網關聯機的詳細數據

az network vpn-gateway connection show -g MyRG -n MyConnection --gateway-name MyGateway

選擇性參數

--gateway-name

VPN 閘道名稱。

--ids

一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

--name -n

VPN 網關聯機的名稱。

--resource-group -g

資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。

全域參數
--debug

提高日誌詳細程度以顯示所有調試日誌。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。

az network vpn-gateway connection update

更新 VPN 網關聯機的設定。

az network vpn-gateway connection update [--add]
                                         [--associated]
                                         [--associated-inbound-routemap]
                                         [--associated-outbound-routemap]
                                         [--force-string]
                                         [--gateway-name]
                                         [--ids]
                                         [--labels]
                                         [--name]
                                         [--no-wait]
                                         [--propagated]
                                         [--remove]
                                         [--resource-group]
                                         [--set]
                                         [--subscription]

範例

在路由組態下新增傳播路由表的標籤。

az network vpn-gateway connection update -g MyRG -n MyConnection --gateway-name MyGateway --labels NewLabel1 NewLabels2

選擇性參數

--add

藉由指定路徑和索引鍵值組,將物件加入物件清單。 範例: --add property.listProperty <key=value, string or JSON string>.

預設值: []
--associated --associated-route-table
預覽

與此路由組態相關聯的路由表資源標識符。

--associated-inbound-routemap

此連線路由組態的輸入路由對應資源 URI。

--associated-outbound-routemap

此連線路由組態的輸出路由對應資源 URI。

--force-string

使用 'set' 或 'add' 時,請保留字串常值,而不是嘗試轉換成 JSON。

預設值: False
--gateway-name

VPN 閘道名稱。

--ids

一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

--labels
預覽

傳播路由表的標籤以空格分隔的清單。

--name -n

VPN 網關聯機的名稱。

--no-wait

請勿等候長時間執行的作業完成。

預設值: False
--propagated --propagated-route-tables
預覽

已傳播路由表的資源標識符空間分隔清單。

--remove

從清單中移除屬性或專案。 範例: --remove property.list <indexToRemove>--remove propertyToRemove

預設值: []
--resource-group -g

資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。

--set

指定要設定的屬性路徑和值,以更新物件。 範例: --set property1.property2=<value>.

預設值: []
--subscription

訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。

全域參數
--debug

提高日誌詳細程度以顯示所有調試日誌。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。

az network vpn-gateway connection wait

將 CLI 置於等候狀態,直到符合站對站 VPN 網關聯機的條件為止。

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

選擇性參數

--created

請等候在 'Succeeded' 使用 'provisioningState' 建立。

預設值: False
--custom

等到條件符合自定義 JMESPath 查詢為止。 例如 provisioningState!='InProgress', instanceView.statuses[?code=='PowerState/running']。

--deleted

等到刪除為止。

預設值: False
--exists

等候資源存在。

預設值: False
--gateway-name

VPN 閘道名稱。

--ids

一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

--interval

輪詢間隔以秒為單位。

預設值: 30
--name -n

VPN 網關聯機的名稱。

--resource-group -g

資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。

--timeout

以秒為單位的等候上限。

預設值: 3600
--updated

等到 provisioningState 更新為 'Succeeded'。

預設值: False
全域參數
--debug

提高日誌詳細程度以顯示所有調試日誌。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。