Skip to main content

Networking

The VM has no external IP. All outbound and inbound traffic flows through controlled paths:

Internet

│ (outbound only, via Cloud NAT in iac-foundation)

Cloud NAT ──► cloudflared ──► Cloudflare Edge (TCP 443 or UDP 7844)

Private Google Access (no NAT)

Cloud Run *.run.app TCP 443
GCP Secret Manager TCP 443
Instance Metadata Server HTTP 169.254.169.254

Traffic paths

PathMechanismFirewall tagRanges
cloudflared → CF edgeCloud NAT + allow-cf-tunnel egressallow-cf-tunnel0.0.0.0/0 (Cloudflare uses dynamic IPs)
cf-proxy → Cloud RunPrivate Google Access (restricted VIPs)allow-pga199.36.153.8/30
cf-proxy → Secret ManagerPrivate Google Access (restricted VIPs)allow-pga199.36.153.8/30
cloudflared binary downloadCloud NAT + GitHub egressallow-github-download0.0.0.0/0 (GitHub uses dynamic IPs)
MIG health check → :2000GCP health check prober ingressallow-health-check130.211.0.0/22, 35.191.0.0/16
SSH (ops only)IAP TCP tunnelallow-iap-ssh35.235.240.0/20
All other egressDenieddeny-all-egress (iac-foundation)0.0.0.0/0

Subnet

gateway-subnet, 10.0.2.0/24, europe-west1, private_ip_google_access = true.

Subnet allocation

VPC eigenoid-vpc uses the 10.0.0.0/8 private range. Current allocations:

CIDRSubnetRegionRepoStatus
10.0.0.0/24🟢 Available
10.0.1.0/24🟢 Available (was gateway-subnet in us-central1, freed after europe-west1 migration)
10.0.2.0/24gateway-subneteurope-west1iac-api-gateway🔴 In use
10.0.3.0/2410.0.255.0/24🟢 Available
warning

GCP requires unique CIDRs across all regions within a VPC. When adding subnets, always check this table and update it after allocation to prevent CIDR conflicts during Terraform operations.

Firewall rules

Firewall rules are managed in iac-foundation (network/firewall.tf) and select VMs by network tag. Tags are set on the instance template in vm.tf. All rules are on VPC eigenoid-vpc.

Ingress

RuleProtocol / PortsSource rangesTarget tagPurpose
deny-all-ingressall0.0.0.0/0(all instances)Default deny — no inbound traffic unless explicitly allowed
allow-health-checkTCP 2000130.211.0.0/22, 35.191.0.0/16allow-health-checkGCP health check probers → cloudflared readiness
allow-iap-sshTCP 2235.235.240.0/20allow-iap-sshIdentity-Aware Proxy SSH tunneling (ops debugging)

Egress

RuleProtocol / PortsDestination rangesTarget tagPurpose
deny-all-egressall0.0.0.0/0(all instances)Default deny — no outbound traffic unless explicitly allowed
allow-egress-cloudflareTCP 443, 7844 + UDP 78440.0.0.0/0allow-cf-tunnelcloudflared → Cloudflare edge (QUIC preferred, HTTP/2 fallback)
allow-egress-google-apisTCP 443199.36.153.8/30allow-pgaPrivate Google Access restricted VIPs (Cloud Run, Secret Manager)
allow-egress-githubTCP 4430.0.0.0/0allow-github-downloadcloudflared binary download from GitHub at VM boot
note

allow-egress-cloudflare and allow-egress-github use 0.0.0.0/0 because Cloudflare and GitHub publish dynamic IP ranges. The target tags ensure only the gateway VM can use these rules.