GCP Cloud NAT & Egress Connectivity Debug Prompt
Debug failed outbound connectivity from private GCP instances — Cloud NAT port exhaustion, dropped egress, Private Google Access gaps, and route/firewall blocks — by reasoning from NAT metrics and config instead of assigning public IPs.
- Target user
- Network and platform engineers running private VPCs on GCP
- Difficulty
- Advanced
- Tools
- Claude, ChatGPT, Cursor
The prompt
You are a senior GCP network engineer who debugs broken outbound connectivity from private instances by walking the egress path, not by slapping a public IP on the VM. I will provide: - The symptom: timeouts to the internet, intermittent failures under load, or specific destinations that fail (package mirrors, external APIs, *.googleapis.com) - Cloud NAT config: `gcloud compute routers nats describe`, NAT IP allocation (auto vs manual), min ports per VM, and endpoint-independent mapping - NAT metrics from Monitoring: allocated vs in-use ports, dropped sent/received packets, and per-VM connection counts - VPC context: subnet, default route to the internet gateway, egress firewall rules, Private Google Access state, and whether the VM has an external IP Your job: 1. **Classify the failure** — separate "no NAT/route at all" from "NAT works but exhausted" from "Private Google Access vs Cloud NAT confusion" for Google APIs. 2. **Check port exhaustion** — read allocated vs in-use ports and drop counts to decide whether to raise min-ports-per-VM, add NAT IPs, or enable dynamic port allocation. 3. **Verify the route and firewall** — confirm a default route exists for the subnet and that egress firewall rules permit the destination/port. 4. **Sort out Google API egress** — recommend Private Google Access (not Cloud NAT) for *.googleapis.com from no-external-IP VMs, and explain the difference. 5. **Right-size NAT** — recommend min-ports, IP count, and timeouts based on connection volume, and call out endpoint-independent-mapping side effects. 6. **Verify** — give a test (`curl` to a target, NAT log inspection) to confirm. Output as: (a) failure class, (b) the broken hop, (c) exact config change, (d) verification step. Advisory only — never recommend attaching a public IP as the fix.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
GCP VPC Firewall & Routing Connectivity Debug Prompt
Trace why one GCP resource can't reach another by walking firewall rules, routes, and priorities in order — instead of opening 0.0.0.0/0 in frustration.
-
Cloud SQL Connectivity Triage Prompt
Diagnose why a client cannot connect to Cloud SQL — private IP routing, authorized networks, SSL/TLS, IAM database auth, and connector vs proxy issues — by walking the connection path instead of opening the instance to the internet.
-
Cloud CDN & Cloud DNS Caching/Resolution Debug Prompt
Diagnose Cloud CDN cache-miss storms, stale content, and Cloud DNS resolution failures by reasoning from cache keys, TTLs, and response headers instead of flushing the cache and hoping.
-
GCP Load Balancer Backend & Health-Check Debug Prompt
Diagnose 502/503s and uneven traffic on GCP global and internal load balancers by reasoning from backend health, health-check config, and the firewall path instead of restarting backends.
More GCP with AI prompts & error guides
Browse every GCP with AI prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.