Your company prohibits external IP addresses on production Compute Engine VMs. You just deployed a Linux VM in the us-central1-a zone without an external address. Working from your laptop on the public internet, you must open an SSH session to troubleshoot the VM. A firewall rule already permits Identity-Aware Proxy (IAP) TCP traffic to port 22. Which additional flag should you include when running gcloud compute ssh so you can connect without changing network settings?
When a Compute Engine VM has no external IP, you can still reach its SSH port by tunneling the connection through Google Cloud's Identity-Aware Proxy (IAP). Adding the --tunnel-through-iap flag instructs gcloud compute ssh to establish a secure tunnel via IAP to the VM's internal IP, allowing access from the public internet without exposing the instance. The --internal-ip flag only works if the client is already on the same VPC or connected via VPN/Interconnect. The other flags do not exist or do not provide connectivity for instances without an external address.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is Identity-Aware Proxy (IAP) in Google Cloud?
Open an interactive chat with Bash
What does the `--tunnel-through-iap` flag do?
Open an interactive chat with Bash
How does `gcloud compute ssh` handle VMs with no external IP addresses?
Open an interactive chat with Bash
What is Identity-Aware Proxy (IAP)?
Open an interactive chat with Bash
How does the `--tunnel-through-iap` flag work in the `gcloud compute ssh` command?
Open an interactive chat with Bash
Why is using `--internal-ip` invalid for this scenario?
Open an interactive chat with Bash
GCP Associate Cloud Engineer
Ensuring successful operation of a cloud solution
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99 $11.99
$11.99/mo
Billed monthly, Cancel any time.
$19.99 after promotion ends
3 Month Pass
$44.99 $26.99
$8.99/mo
One time purchase of $26.99, Does not auto-renew.
$44.99 after promotion ends
Save $18!
MOST POPULAR
Annual Pass
$119.99 $71.99
$5.99/mo
One time purchase of $71.99, Does not auto-renew.
$119.99 after promotion ends
Save $48!
BEST DEAL
Lifetime Pass
$189.99 $113.99
One time purchase, Good for life.
Save $76!
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .