az network nic
Note
此命令群組具有 Azure CLI 和至少一個擴充功能中定義的命令。 安裝每個擴充功能以受益於其擴充功能。 Learn more about extensions.
管理網路介面。
若要深入瞭解 Azure 中的網路介面,請流覽 https://learn.microsoft.com/en-us/azure/virtual-network/virtual-network-network-interface?tabs=network-interface-portal。
命令
az network nic create
建立網路介面。
az network nic create --name
--resource-group
--subnet
[--accelerated-networking {0, 1, f, false, n, no, t, true, y, yes}]
[--ag-address-pools --app-gateway-address-pools]
[--application-security-groups --asgs]
[--auxiliary-mode {AcceleratedConnections, Floating, MaxConnections, None}]
[--auxiliary-sku {A1, A2, A4, A8, None}]
[--dns-servers]
[--edge-zone]
[--gateway-name]
[--internal-dns-name]
[--ip-forwarding {0, 1, f, false, n, no, t, true, y, yes}]
[--lb-address-pools]
[--lb-inbound-nat-rules]
[--lb-name]
[--location]
[--network-security-group]
[--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
[--private-ip-address]
[--private-ip-address-version {IPv4, IPv6}]
[--public-ip-address]
[--tags]
[--vnet-name]
範例
在指定的虛擬網路上建立指定子網的網路介面。
az network nic create -g MyResourceGroup --vnet-name MyVnet --subnet MySubnet -n MyNic
在虛擬網路上建立指定子網的網路介面,以允許IP轉送受限於網路安全組。
az network nic create -g MyResourceGroup --vnet-name MyVnet --subnet MySubnet -n MyNic --ip-forwarding --network-security-group MyNsg
使用網路安全組和應用程式安全組,在虛擬網路上建立指定子網的網路介面。
az network nic create -g MyResourceGroup --vnet-name MyVnet --subnet MySubnet -n MyNic --network-security-group MyNsg --application-security-groups Web App
必要參數
網路介面的名稱(NIC)。
資源組名。 您可以使用 az configure --defaults group=<name>
來設定預設群組。
現有子網的名稱或標識碼。 如果指定名稱,請同時指定 --vnet-name
;如果您想要在其他資源群組中使用現有的子網,請提供標識碼,而不是子網的名稱。
屬性 | 值 |
---|---|
Parameter group: | IP Configuration Arguments |
選擇性參數
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
是否要啟用加速網路。
屬性 | 值 |
---|---|
接受的值: | 0, 1, f, false, n, no, t, true, y, yes |
應用程式閘道後端位址池名稱或識別碼的空間分隔清單,以與 NIC 產生關聯。 如果使用名稱,則必須指定 --gateway-name
。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。
屬性 | 值 |
---|---|
Parameter group: | Application Gateway Arguments |
應用程式安全組的空間分隔清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。
屬性 | 值 |
---|---|
Parameter group: | IP Configuration Arguments |
網路介面資源的輔助模式。
屬性 | 值 |
---|---|
Parameter group: | Properties Arguments |
接受的值: | AcceleratedConnections, Floating, MaxConnections, None |
網路介面資源的輔助 SKU。
屬性 | 值 |
---|---|
Parameter group: | Properties Arguments |
接受的值: | A1, A2, A4, A8, None |
DNS 伺服器 IP 位址的空間分隔清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。
屬性 | 值 |
---|---|
Parameter group: | DNS Arguments |
邊緣區域的名稱。
應用程式閘道的名稱。
屬性 | 值 |
---|---|
Parameter group: | Application Gateway Arguments |
內部 DNS 標籤的名稱。
屬性 | 值 |
---|---|
Parameter group: | DNS Arguments |
是否要啟用IP轉送。
屬性 | 值 |
---|---|
接受的值: | 0, 1, f, false, n, no, t, true, y, yes |
負載平衡器位址池名稱或標識符的空間分隔清單,以與 NIC 產生關聯。 如果使用名稱,則必須指定 --lb-name
。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。
屬性 | 值 |
---|---|
Parameter group: | Load Balancer Arguments |
負載平衡器輸入NAT規則的名稱或標識碼以空格分隔的清單,以與 NIC 產生關聯。 如果使用名稱,則必須指定 --lb-name
。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。
屬性 | 值 |
---|---|
Parameter group: | Load Balancer Arguments |
負載平衡器的名稱。
屬性 | 值 |
---|---|
Parameter group: | Load Balancer Arguments |
Location. 值的來源:az account list-locations
。 您可以使用 az configure --defaults location=<location>
來設定預設位置。
現有網路安全組的名稱或識別碼。
請勿等候長時間執行的作業完成。
屬性 | 值 |
---|---|
接受的值: | 0, 1, f, false, n, no, t, true, y, yes |
要使用的靜態私人IP位址。
屬性 | 值 |
---|---|
Parameter group: | IP Configuration Arguments |
要使用的私人IP位址版本。
屬性 | 值 |
---|---|
Parameter group: | IP Configuration Arguments |
預設值: | IPv4 |
接受的值: | IPv4, IPv6 |
現有公用IP位址名稱或識別碼。
屬性 | 值 |
---|---|
Parameter group: | IP Configuration Arguments |
以空格分隔的標記:key[=value] [key[=value] ...]。支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。
虛擬網路的名稱。
屬性 | 值 |
---|---|
Parameter group: | IP Configuration Arguments |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
屬性 | 值 |
---|---|
預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
屬性 | 值 |
---|---|
預設值: | False |
Output format.
屬性 | 值 |
---|---|
預設值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID
來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
屬性 | 值 |
---|---|
預設值: | False |
az network nic delete
刪除網路介面。
az network nic delete [--ids]
[--name]
[--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
[--resource-group]
[--subscription]
範例
刪除網路介面。
az network nic delete -g MyResourceGroup -n MyNic
選擇性參數
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。
屬性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
網路介面的名稱(NIC)。
屬性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
請勿等候長時間執行的作業完成。
屬性 | 值 |
---|---|
接受的值: | 0, 1, f, false, n, no, t, true, y, yes |
資源組名。 您可以使用 az configure --defaults group=<name>
來設定預設群組。
屬性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID
來設定預設訂用帳戶。
屬性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
屬性 | 值 |
---|---|
預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
屬性 | 值 |
---|---|
預設值: | False |
Output format.
屬性 | 值 |
---|---|
預設值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
屬性 | 值 |
---|---|
預設值: | False |
az network nic list
列出網路介面。
若要列出連結至 VM 擴展集中 VM 的網路介面,請使用 az vmss nic list
或 az vmss nic list-vm-nics
。
az network nic list [--max-items]
[--next-token]
[--resource-group]
範例
依內部 DNS 後綴列出所有 NIC。
az network nic list --query "[?dnsSettings.internalDomainNameSuffix=`{dnsSuffix}`]"
選擇性參數
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
命令輸出中要傳回的項目總數。 如果可用的專案總數超過指定的值,則會在命令的輸出中提供令牌。 若要繼續分頁,請在後續命令的 --next-token
自變數中提供令牌值。
屬性 | 值 |
---|---|
Parameter group: | Pagination Arguments |
標記,指定要開始分頁的位置。 這是先前截斷回應中的令牌值。
屬性 | 值 |
---|---|
Parameter group: | Pagination Arguments |
資源組名。 您可以使用 az configure --defaults group=<name>
來設定預設群組。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
屬性 | 值 |
---|---|
預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
屬性 | 值 |
---|---|
預設值: | False |
Output format.
屬性 | 值 |
---|---|
預設值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID
來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
屬性 | 值 |
---|---|
預設值: | False |
az network nic list-effective-nsg
列出套用至網路介面的所有有效網路安全組。
若要深入瞭解使用有效安全性規則進行疑難解答,請造訪 https://learn.microsoft.com/en-us/azure/virtual-network/diagnose-network-traffic-filter-problem。
az network nic list-effective-nsg [--ids]
[--name]
[--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
[--resource-group]
[--subscription]
範例
列出與 NIC 相關聯的有效安全組。
az network nic list-effective-nsg -g MyResourceGroup -n MyNic
選擇性參數
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。
屬性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
網路介面的名稱(NIC)。
屬性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
請勿等候長時間執行的作業完成。
屬性 | 值 |
---|---|
接受的值: | 0, 1, f, false, n, no, t, true, y, yes |
資源組名。 您可以使用 az configure --defaults group=<name>
來設定預設群組。
屬性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID
來設定預設訂用帳戶。
屬性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
屬性 | 值 |
---|---|
預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
屬性 | 值 |
---|---|
預設值: | False |
Output format.
屬性 | 值 |
---|---|
預設值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
屬性 | 值 |
---|---|
預設值: | False |
az network nic show
取得網路介面的詳細數據。
az network nic show [--expand]
[--ids]
[--name]
[--resource-group]
[--subscription]
範例
取得 NIC 的內部功能變數名稱後綴。
az network nic show -g MyResourceGroup -n MyNic --query "dnsSettings.internalDomainNameSuffix"
選擇性參數
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
展開參考的資源。
一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。
屬性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
網路介面的名稱(NIC)。
屬性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
資源組名。 您可以使用 az configure --defaults group=<name>
來設定預設群組。
屬性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID
來設定預設訂用帳戶。
屬性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
屬性 | 值 |
---|---|
預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
屬性 | 值 |
---|---|
預設值: | False |
Output format.
屬性 | 值 |
---|---|
預設值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
屬性 | 值 |
---|---|
預設值: | False |
az network nic show-effective-route-table
顯示套用至網路介面的有效路由表。
若要深入瞭解如何使用有效的路由表進行疑難解答,請造訪 https://learn.microsoft.com/en-us/azure/virtual-network/diagnose-network-routing-problem#using-effective-routes-to-troubleshoot-vm-traffic-flow。
az network nic show-effective-route-table [--ids]
[--name]
[--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
[--resource-group]
[--subscription]
範例
顯示套用至網路介面的有效路由。
az network nic show-effective-route-table -g MyResourceGroup -n MyNic
選擇性參數
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。
屬性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
網路介面的名稱(NIC)。
屬性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
請勿等候長時間執行的作業完成。
屬性 | 值 |
---|---|
接受的值: | 0, 1, f, false, n, no, t, true, y, yes |
資源組名。 您可以使用 az configure --defaults group=<name>
來設定預設群組。
屬性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID
來設定預設訂用帳戶。
屬性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
屬性 | 值 |
---|---|
預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
屬性 | 值 |
---|---|
預設值: | False |
Output format.
屬性 | 值 |
---|---|
預設值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
屬性 | 值 |
---|---|
預設值: | False |
az network nic update
更新網路介面。
az network nic update [--accelerated-networking {0, 1, f, false, n, no, t, true, y, yes}]
[--add]
[--auxiliary-mode {AcceleratedConnections, Floating, MaxConnections, None}]
[--auxiliary-sku {A1, A2, A4, A8, None}]
[--dns-servers]
[--force-string {0, 1, f, false, n, no, t, true, y, yes}]
[--ids]
[--internal-dns-name]
[--ip-configurations]
[--ip-forwarding {0, 1, f, false, n, no, t, true, y, yes}]
[--name]
[--network-security-group]
[--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
[--remove]
[--resource-group]
[--set]
[--subscription]
範例
更新網路介面以使用不同的網路安全組。
az network nic update -g MyResourceGroup -n MyNic --network-security-group MyNewNsg
選擇性參數
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
是否要啟用加速網路。
屬性 | 值 |
---|---|
接受的值: | 0, 1, f, false, n, no, t, true, y, yes |
藉由指定路徑和索引鍵值組,將物件加入物件清單。 範例: --add property.listProperty <key=value, string or JSON string>
.
屬性 | 值 |
---|---|
Parameter group: | Generic Update Arguments |
網路介面資源的輔助模式。
屬性 | 值 |
---|---|
Parameter group: | Properties Arguments |
接受的值: | AcceleratedConnections, Floating, MaxConnections, None |
網路介面資源的輔助 SKU。
屬性 | 值 |
---|---|
Parameter group: | Properties Arguments |
接受的值: | A1, A2, A4, A8, None |
DNS 伺服器 IP 位址的空間分隔清單。 使用 null 還原為預設的 Azure 伺服器。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。
屬性 | 值 |
---|---|
Parameter group: | DNS Arguments |
使用 'set' 或 'add' 時,請保留字串常值,而不是嘗試轉換成 JSON。
屬性 | 值 |
---|---|
Parameter group: | Generic Update Arguments |
接受的值: | 0, 1, f, false, n, no, t, true, y, yes |
一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。
屬性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
內部 DNS 標籤的名稱。
屬性 | 值 |
---|---|
Parameter group: | DNS Arguments |
網路介面的IP組態清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。
屬性 | 值 |
---|---|
Parameter group: | Properties Arguments |
是否要啟用IP轉送。
屬性 | 值 |
---|---|
接受的值: | 0, 1, f, false, n, no, t, true, y, yes |
網路介面的名稱(NIC)。
屬性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
現有網路安全組的名稱或識別碼。
請勿等候長時間執行的作業完成。
屬性 | 值 |
---|---|
接受的值: | 0, 1, f, false, n, no, t, true, y, yes |
從清單中移除屬性或專案。 範例: --remove property.list <indexToRemove>
或 --remove propertyToRemove
。
屬性 | 值 |
---|---|
Parameter group: | Generic Update Arguments |
資源組名。 您可以使用 az configure --defaults group=<name>
來設定預設群組。
屬性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
指定要設定的屬性路徑和值,以更新物件。 範例: --set property1.property2=<value>
.
屬性 | 值 |
---|---|
Parameter group: | Generic Update Arguments |
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID
來設定預設訂用帳戶。
屬性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
屬性 | 值 |
---|---|
預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
屬性 | 值 |
---|---|
預設值: | False |
Output format.
屬性 | 值 |
---|---|
預設值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
屬性 | 值 |
---|---|
預設值: | False |
az network nic wait
將 CLI 置於等候狀態,直到符合條件為止。
az network nic wait [--created]
[--custom]
[--deleted]
[--exists]
[--expand]
[--ids]
[--interval]
[--name]
[--resource-group]
[--subscription]
[--timeout]
[--updated]
選擇性參數
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
請等候在 'Succeeded' 使用 'provisioningState' 建立。
屬性 | 值 |
---|---|
Parameter group: | Wait Condition Arguments |
預設值: | False |
等到條件符合自定義 JMESPath 查詢為止。 例如 provisioningState!='InProgress', instanceView.statuses[?code=='PowerState/running']。
屬性 | 值 |
---|---|
Parameter group: | Wait Condition Arguments |
等到刪除為止。
屬性 | 值 |
---|---|
Parameter group: | Wait Condition Arguments |
預設值: | False |
等候資源存在。
屬性 | 值 |
---|---|
Parameter group: | Wait Condition Arguments |
預設值: | False |
展開參考的資源。
一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。
屬性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
輪詢間隔以秒為單位。
屬性 | 值 |
---|---|
Parameter group: | Wait Condition Arguments |
預設值: | 30 |
網路介面的名稱(NIC)。
屬性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
資源組名。 您可以使用 az configure --defaults group=<name>
來設定預設群組。
屬性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID
來設定預設訂用帳戶。
屬性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
以秒為單位的等候上限。
屬性 | 值 |
---|---|
Parameter group: | Wait Condition Arguments |
預設值: | 3600 |
等到 provisioningState 更新為 'Succeeded'。
屬性 | 值 |
---|---|
Parameter group: | Wait Condition Arguments |
預設值: | False |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
屬性 | 值 |
---|---|
預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
屬性 | 值 |
---|---|
預設值: | False |
Output format.
屬性 | 值 |
---|---|
預設值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
屬性 | 值 |
---|---|
預設值: | False |