'how to include list of IPs while creating egress rule via gcloud?
I try to create an egress firewall rule to open specific destination IPs, here is what I do for only one destination-ranges:
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
My question is how to have a list of IP ranges instead of just one (here instead of 43.249.72.0/22, I want 23.235.32.0/20, 43.249.72.0/22 for example)?
Solution 1:[1]
After some trial-and-error I found something useful here: https://cloud.google.com/sdk/gcloud/reference/compute/firewall-rules/create
It seems you need to put it inside "", without space, separated by comma.
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
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Ala Tarighati |
