共用方式為


az network firewall nat-rule

備註

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

管理和設定 Azure 防火牆 NAT 規則。

命令

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

管理和設定 Azure 防火牆 NAT 規則。

擴充套件 GA
az network firewall nat-rule collection delete

刪除 Azure 防火牆 NAT 規則集合。

擴充套件 GA
az network firewall nat-rule collection list

列出 Azure 防火牆 NAT 規則集合。

擴充套件 GA
az network firewall nat-rule collection show

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

擴充套件 GA
az network firewall nat-rule create

建立 Azure 防火牆 NAT 規則。

擴充套件 GA
az network firewall nat-rule delete

刪除 Azure 防火牆 NAT 規則。

擴充套件 GA
az network firewall nat-rule list

列出 Azure 防火牆 NAT 規則。

擴充套件 GA
az network firewall nat-rule show

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

擴充套件 GA

az network firewall nat-rule create

建立 Azure 防火牆 NAT 規則。

az network firewall nat-rule create --collection-name
                                    --dest-addr
                                    --destination-ports
                                    --firewall-name
                                    --name
                                    --protocols {Any, ICMP, TCP, UDP}
                                    --resource-group
                                    --translated-port
                                    [--action {Dnat, Snat}]
                                    [--description]
                                    [--priority]
                                    [--source-addresses]
                                    [--source-ip-groups]
                                    [--translated-address]
                                    [--translated-fqdn]

必要參數

--collection-name -c

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

--dest-addr --destination-addresses

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

--destination-ports

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

--firewall-name -f

Azure 防火牆名稱。

--name -n

NAT 規則的名稱。

--protocols

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

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

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

--translated-port

此 NAT 規則的轉譯埠。

選擇性參數

--action

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

接受的值: Dnat, Snat
--description

規則描述。

--priority

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

--source-addresses

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

--source-ip-groups

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

--translated-address

此 NAT 規則的翻譯位址。

--translated-fqdn

此 NAT 規則的已翻譯 FQDN。

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

刪除 Azure 防火牆 NAT 規則。

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

選擇性參數

--collection-name -c

規則集合的名稱。

--firewall-name -f

Azure 防火牆名稱。

--ids

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

--name -n

NAT 規則的名稱。

--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 nat-rule list

列出 Azure 防火牆 NAT 規則。

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

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

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

選擇性參數

--collection-name -c

規則集合的名稱。

--firewall-name -f

Azure 防火牆名稱。

--ids

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

--name -n

NAT 規則的名稱。

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