az network firewall network-rule

注意

此參考是 Azure CLI 的 azure 防火牆延伸模組的一部分(2.55.0 版或更高版本)。 擴充功能會在您第一次執行 az network firewall network-rule 命令時自動安裝。 深入了解擴充功能。

管理及設定 Azure 防火牆 網路規則。

命令

名稱 Description 類型 狀態
az network firewall network-rule collection

管理及設定 Azure 防火牆 網路規則集合。

副檔名 GA
az network firewall network-rule collection delete

刪除 Azure 防火牆 網路規則集合。

副檔名 GA
az network firewall network-rule collection list

列出 Azure 防火牆 網路規則集合。

副檔名 GA
az network firewall network-rule collection show

取得 Azure 防火牆 網路規則集合的詳細數據。

副檔名 GA
az network firewall network-rule create

建立 Azure 防火牆 網路規則。

副檔名 GA
az network firewall network-rule delete

刪除 Azure 防火牆 網路規則。 如果您想要刪除集合中的最後一個規則,請改為刪除集合。

副檔名 GA
az network firewall network-rule list

列出 Azure 防火牆 網路規則。

副檔名 GA
az network firewall network-rule show

取得 Azure 防火牆 網路規則的詳細數據。

副檔名 GA

az network firewall network-rule create

建立 Azure 防火牆 網路規則。

az network firewall network-rule create --collection-name
                                        --destination-ports
                                        --firewall-name
                                        --name
                                        --protocols {Any, ICMP, TCP, UDP}
                                        --resource-group
                                        [--action {Allow, Deny}]
                                        [--description]
                                        [--dest-addr]
                                        [--destination-fqdns]
                                        [--destination-ip-groups]
                                        [--priority]
                                        [--source-addresses]
                                        [--source-ip-groups]

必要參數

--collection-name -c

要用來建立規則的集合名稱。 如果集合不存在,將會建立集合。

--destination-ports

目的地埠的空間分隔清單。 使用 『*』 來比對全部。

--firewall-name -f

Azure 防火牆 名稱。

--name -n

網路規則的名稱。

--protocols

以空格分隔的通訊協議清單。

接受的值: Any, ICMP, TCP, UDP
--resource-group -g

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

選擇性參數

--action

要套用至規則集合的動作。 只有在您要建立集合時,才提供 。

接受的值: Allow, Deny
--description

規則描述。

--dest-addr --destination-addresses

目的地IP位址的空間分隔清單。 使用 『*』 來比對全部。

--destination-fqdns

目的地 FQDN 的空間分隔清單。

--destination-ip-groups

以空格分隔的目的地 IpGroups 名稱或資源識別碼清單。

--priority

規則集合的優先順序從 100 (高) 到 65000 (低)。 只有在您要建立集合時,才提供 。

--source-addresses

來源IP位址的空間分隔清單。 使用 『*』 來比對全部。

--source-ip-groups

以空格分隔的來源 IpGroups 名稱或資源識別碼清單。

全域參數
--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 firewall network-rule delete

刪除 Azure 防火牆 網路規則。 如果您想要刪除集合中的最後一個規則,請改為刪除集合。

az network firewall network-rule delete [--collection-name]
                                        [--firewall-name]
                                        [--ids]
                                        [--name]
                                        [--resource-group]
                                        [--subscription]

選擇性參數

--collection-name -c

規則集合的名稱。

--firewall-name -f

Azure 防火牆 名稱。

--ids

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

--name -n

網路規則的名稱。

--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 firewall network-rule list

列出 Azure 防火牆 網路規則。

az network firewall network-rule list --collection-name
                                      --firewall-name
                                      --resource-group

必要參數

--collection-name -c

規則集合的名稱。

--firewall-name -f

Azure 防火牆 名稱。

--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 firewall network-rule show

取得 Azure 防火牆 網路規則的詳細數據。

az network firewall network-rule show [--collection-name]
                                      [--firewall-name]
                                      [--ids]
                                      [--name]
                                      [--resource-group]
                                      [--subscription]

選擇性參數

--collection-name -c

規則集合的名稱。

--firewall-name -f

Azure 防火牆 名稱。

--ids

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

--name -n

網路規則的名稱。

--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 來取得完整偵錯記錄。