Connect to an instance via VPN

0 votes
How to use a VPN to connect to a VM instance on GCP?
Nov 8 in GCP by anonymous
• 4,320 points
22 views

1 answer to this question.

0 votes

To use a Virtual Private Network (VPN) to connect to an instance without an external IP address, you must have a computer that's already connected to the same VPN as the instance you want to reach. For example, you might have a VPN that your local on-premises network shares with your GCP VPC. 

Connect to an instance without an external IP address by using the gcloud compute ssh command with the --internal-ip flag.

gcloud compute ssh [INTERNAL_INSTANCE_NAME] --internal-ip

Where [INTERNAL_INSTANCE_NAME] is the name of the instance that you want to connect to.

After connecting, run commands on your instance using this terminal. When you have finished using the instance, disconnect from it by using the exit command.

answered Nov 8 by Sirajul
• 38,820 points

Related Questions In GCP

0 votes
1 answer
0 votes
1 answer

Creating a SQL Server instance using Google Compute engine.

Google Compute Engine provides public images preconfigured with ...READ MORE

answered Sep 23 in GCP by Sirajul
• 38,820 points
38 views
0 votes
1 answer

How do i install gcloud compute?

The gcloud compute command-line tool enables you to easily ...READ MORE

answered Sep 23 in GCP by Sirajul
• 38,820 points
48 views
0 votes
1 answer

Connect to an instance as a root user in GCP

If you configured an instance to allow ...READ MORE

answered Sep 24 in GCP by Sirajul
• 38,820 points
32 views
0 votes
1 answer

Cannot connect to my VM instance on GCP via SSH.

This might be because UFW is installed. ...READ MORE

answered Sep 27 in GCP by Sirajul
• 38,820 points
57 views