• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Archives

GCP Create Firewall with Tags

May 28, 2020

Here’s another way to create a firewall in GCP using network tag as targets.

gcloud compute firewall-rules create "firewall-name" \
    --description="egress rule to allow port 8000 to destination" \
    --priority "1000" \
    --direction EGRESS \
    --action allow \
    --network "your-network" \
    --target-tags="your-network-tag" \
    --destination-ranges="10.0.0.1/32" \
    --rules tcp:8000

gcloud compute firewall-rules create "firewall-name" \ --description="egress rule to allow port 8000 to destination" \ --priority "1000" \ --direction EGRESS \ --action allow \ --network "your-network" \ --target-tags="your-network-tag" \ --destination-ranges="10.0.0.1/32" \ --rules tcp:8000

Filed Under: Cloud Tagged With: destination, egress, firewall, gcp, tags, target

Search This Website

Subscribe Via Email

  • Home
  • About
  • Archives

Copyright © 2023