如何在通过 gcloud 创建出口规则时包含 IP 列表?
how to include list of IPs while creating egress rule via gcloud?
我尝试创建一个出口防火墙规则来打开特定的目标 IP,这是我只针对一个目标范围所做的:
gcloud compute firewall-rules create my_egress \
--network ${NETWORK_NAME} \
--action allow \
--rules all \
--direction egress \
--destination-ranges 43.249.72.0/22 \
--priority 1000
我的问题是如何获得一个 IP 范围列表而不是一个(这里不是 43.249.72.0/22
,例如我想要 23.235.32.0/20, 43.249.72.0/22
)?
经过一些 trial-and-error 我在这里发现了一些有用的东西:https://cloud.google.com/sdk/gcloud/reference/compute/firewall-rules/create
好像需要放在""里面,不用space,用逗号隔开。
gcloud compute firewall-rules create my_egress \
--network ${NETWORK_NAME} \
--action allow \
--rules all \
--direction egress \
--destination-ranges "43.249.72.0/22,23.235.32.0/20" \
--priority 1000
我尝试创建一个出口防火墙规则来打开特定的目标 IP,这是我只针对一个目标范围所做的:
gcloud compute firewall-rules create my_egress \
--network ${NETWORK_NAME} \
--action allow \
--rules all \
--direction egress \
--destination-ranges 43.249.72.0/22 \
--priority 1000
我的问题是如何获得一个 IP 范围列表而不是一个(这里不是 43.249.72.0/22
,例如我想要 23.235.32.0/20, 43.249.72.0/22
)?
经过一些 trial-and-error 我在这里发现了一些有用的东西:https://cloud.google.com/sdk/gcloud/reference/compute/firewall-rules/create
好像需要放在""里面,不用space,用逗号隔开。
gcloud compute firewall-rules create my_egress \
--network ${NETWORK_NAME} \
--action allow \
--rules all \
--direction egress \
--destination-ranges "43.249.72.0/22,23.235.32.0/20" \
--priority 1000