Azure CLI: 创建NSG规则时传递多个协议值

huangapple go评论44阅读模式
英文:

Azure CLI: Passing multiple protocol values while creating NSG rule

问题

如何在创建网络安全组规则时使用 Azure CLI 传递多个协议值。

RG="Test-RG"

az network nsg create --name "${RG}-nsg" --location "eastus" -g $RG

az network nsg rule create -g ${RG} --nsg-name "${RG}-nsg" -n ${RG}-nsg-rule1 --priority 100
--source-address-prefixes '' --source-port-ranges '' --destination-address-prefixes ''
--destination-port-ranges '
' --access Allow --protocol Tcp --description "Allowing All Traffic"

对于协议参数,我尝试传递多个值,比如 Icmp 和 Udp。

--protocol {Tcp,Icmp}

--protocol [Tcp, Icmp}

我尝试了这两种方式都不起作用。

英文:

How to pass multiple protocol values using Azure CLI while creating nsg rule.

RG="Test-RG"

az network nsg create --name "${RG}-nsg" --location "eastus" -g $RG

az network nsg rule create -g ${RG} --nsg-name "${RG}-nsg" -n ${RG}-nsg-rule1 --priority 100
--source-address-prefixes '' --source-port-ranges '' --destination-address-prefixes ''
--destination-port-ranges '
' --access Allow --protocol Tcp --description "Allowing All Traffic"

For protocol parameter I am trying to pass multiple values like Icmp Udp

--protocol {Tcp,Icmp}

--protocol [Tcp, Icmp}

I have tried both ways not working

答案1

得分: 0

NSG规则允许这些协议 *, Ah, Esp, Icmp, Tcp, Udp 在创建NSG规则时,您只能使用一个协议,而不能使用多个。

参数protocol只能接受字符串,您不能传递多个协议。您可以使用通配符字符(*)来匹配所有协议。

英文:

NSG rules allow these protocols *, Ah, Esp, Icmp, Tcp, Udp While creating NSG rule you can use only one protocols not multiple.

The parameter protocol can accepts only string you cannot pass more than one protocol. You can use Wildcard character (*) to match all.

huangapple
  • 本文由 发表于 2023年5月22日 22:50:58
  • 转载请务必保留本文链接:https://go.coder-hub.com/76307397.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定