O'Reilly logo

Google Cloud Platform Cookbook by Legorie Rajan PS

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to do it...

Initially, the instances in the subnets created will not have connectivity. We'll setup a VPN connection and verify that we are able to establish a connection between the instances in the two separate networks:

  1. Let's create a VM in the subnet alpha-subnet-vpn with default attributes:
gcloud beta compute instances create "alpha-instance" --zone"us-east1-c" --machine-type "n1-standard-1" --subnet"alpha-subnet-vpn" --image "debian-9-stretch-v20171213"--image-project "debian-cloud"
  1. Similarly, let's create another VM in the beta-subnet-vpn:
gcloud beta compute instances create "beta-instance" --zone"us-central1-c" --machine-type "n1-standard-1" --subnet"beta-subnet-vpn" --image "debian-9-stretch-v20171213"--image-project "debian-cloud" ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required