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