hardgcloud

Create a firewall rule to allow TCP traffic on a specific port within a VPC network

command

gcloud compute firewall-rules create RULE_NAME --allow tcp:PORT --network NETWORK_NAME

also accepted

gcloud compute firewall-rules create

Command breakdown

Part of the Google Cloud CLI (gcloud) — Networking category.

gcloudcomputefirewall-rulescreateRULE_NAME--allowtcp:PORT--networkNETWORK_NAME
FlagPurpose
--allowBoolean flag
--networkBoolean flag

Test your recall — not just your reading.

Practice with interactive quiz →