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)?
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.