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...

Once the network and subnets are created, we'll create instances in the subnets and try to establish a communication. As there is no connectivity, the communication will fail. Next, we'll establish VPC peering to connect the two networks and verify the communication between the instance created:

  1. Let's create a VM in the subnet alpha-subnet-1 with default attributes:
gcloud beta compute instances create "alpha-instance" \--zone "us-central1-a" --machine-type "n1-standard-1" \--subnet "alpha-subnet-1" --image "debian-9-stretch-v20171213" \--image-project "debian-cloud"
  1. We'll create a firewall rule for all SSH and ICMP traffic in the network alpha:
gcloud compute firewall-rules create alpha-firewall --network alpha --allow ...

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