
Before you begin
- Labs create a Google Cloud project and resources for a fixed time
- Labs have a time limit and no pause feature. If you end the lab, you'll have to restart from the beginning.
- On the top left of your screen, click Start lab to begin
Create a VPC network
/ 40
Create instance in primary region
/ 30
Create a VM instance in secondary region
/ 30
Google Cloud Virtual Private Cloud (VPC) provides networking functionality to Compute Engine virtual machine (VM) instances, Kubernetes Engine containers and App Engine Flex. In other words, without a VPC network you cannot create VM instances, containers or App Engine applications. Therefore, each Google Cloud project has a default network to get you started.
You can think of a VPC network the same way you would think of a physical network, except that it is virtualized within Google Cloud. A VPC network is a global resource which consists of a list of regional virtual subnetworks (subnets) in data centers, all connected by a global wide area network (WAN). VPC networks are logically isolated from each other in Google Cloud.
In this lab, you create an auto mode VPC network with firewall rules and two VM instances. Then, you explore the connectivity for the VM instances.
In this lab, you learn how to perform the following tasks:
Read these instructions. Labs are timed and you cannot pause them. The timer, which starts when you click Start Lab, shows how long Google Cloud resources are made available to you.
This hands-on lab lets you do the lab activities in a real cloud environment, not in a simulation or demo environment. It does so by giving you new, temporary credentials you use to sign in and access Google Cloud for the duration of the lab.
To complete this lab, you need:
Click the Start Lab button. If you need to pay for the lab, a dialog opens for you to select your payment method. On the left is the Lab Details pane with the following:
Click Open Google Cloud console (or right-click and select Open Link in Incognito Window if you are running the Chrome browser).
The lab spins up resources, and then opens another tab that shows the Sign in page.
Tip: Arrange the tabs in separate windows, side-by-side.
If necessary, copy the Username below and paste it into the Sign in dialog.
You can also find the Username in the Lab Details pane.
Click Next.
Copy the Password below and paste it into the Welcome dialog.
You can also find the Password in the Lab Details pane.
Click Next.
Click through the subsequent pages:
After a few moments, the Google Cloud console opens in this tab.
Each Google Cloud project has a default network with subnets, routes, and firewall rules.
The default network has a subnet in each Google Cloud region.
In the Cloud console, navigate to Navigation menu () > VPC network > VPC networks.
Click on the default network. Notice the default network details and the subnets.
Routes tell VM instances and the VPC network how to send traffic from an instance to a destination, either inside the network or outside of Google Cloud.
Each VPC network comes with some default routes to route traffic among its subnets and send traffic from eligible instances to the Internet.
In the left pane, click on Routes.
In the Effective Routes tab, select the default
network and the
Notice that there is a route for each subnet and one for the Default internet gateway (0.0.0.0./0).
Each VPC network implements a distributed virtual firewall that you can configure. Firewall rules allow you to control which packets are allowed to travel to which destinations.
Every VPC network has two implied firewall rules that block all incoming connections and allow all outgoing connections.
Notice that there are 4 Ingress firewall rules for the default network:
Select all firewall rules and click DELETE.
In the Cloud console, navigate to Navigation menu () > VPC network > VPC networks.
Click on the default network.
Click Delete VPC network at the top of the page,
Then click DELETE to confirm the deletion of the default network.
In the left pane, click on Routes.
Notice that there are no routes. You may need to click the Refresh button at the top of the page.
Verify that you cannot create a VM instance without a VPC network.
In the Cloud console, navigate to Navigation menu () > Compute Engine > VM instances.
To create a new instance, click Create Instance.
Leave all the values at their default and click Create.
Click Networking.
Go to Network interfaces section.
Click Cancel.
Create a VPC network so that you can create VM instances.
Replicate the default network by creating an auto mode network.
In the console, navigate to Navigation menu () > VPC network > VPC networks, and then click +CREATE VPC NETWORK.
Set the Name to mynetwork
.
For Subnet creation mode, click Automatic.
Auto mode networks create subnets in each region automatically.
For Firewall rules, check all available rules.
These are the same standard firewall rules that the default network had.
Click CREATE, then wait for mynetwork to be created.
Notice that a subnet was created for each region.
Click on the mynetwork name and record the IP address range for the subnets in
Click Check my progress to verify your performed task. If you have completed the task successfully, you are granted an assessment score.
Create a VM instance in the
In the console, navigate to Navigation menu () > Compute Engine > VM instances,
Click Create Instance.
In the Machine configuration:
Set the following values:
Property | Value (type value or select option as specified) |
---|---|
Name | mynet-us-vm |
Region | |
Zone | |
Series | E2 |
Machine Type | e2-micro |
Click Create, then wait for the instance to be created.
Verify that the Internal IP was assigned from the IP address range for the subnet in
Click Check my progress to verify your performed task. If you have completed the task successfully, you are granted an assessment score.
Create a VM instance in the
Click Create Instance.
In the Machine configuration:
Set the following values:
Property | Value (type value or select option as specified) |
---|---|
Name | mynet-second-vm |
Region | |
Zone | |
Series | E2 |
Machine Type | e2-micro |
Click Create, then wait for the instance to be created.
Verify that the Internal IP was assigned from the IP address range for the subnet in
The Internal IP should be
Click Check my progress to verify your performed task. If you have completed the task successfully, you are granted an assessment score.
Explore the connectivity for the VM instances. Specifically, SSH to your VM instances using tcp:22 and ping both the internal and external IP addresses of your VM instances using ICMP. Then, explore the effects of the firewall rules on connectivity by removing the firewall rules one-by-one.
The firewall rules that you created with mynetwork allow ingress SSH and ICMP traffic from within mynetwork (internal IP) and outside of that network (external IP).
In the console, navigate to Navigation menu () > Compute Engine > VM instances.
Note the external and internal IP addresses for mynet-second-vm.
For mynet-us-vm, click SSH to launch a terminal and connect. You may have to click SSH twice.
You are able to SSH because of the allow-ssh firewall rule, which allows incoming traffic from anywhere (0.0.0.0/0) for tcp:22.
To test connectivity to mynet-second-vm's internal IP, run the following command using mynet-second-vm's internal IP:
You are able to ping mynet-second-vm's internal IP because of the allow-custom firewall rule.
To test connectivity to mynet-second-vm's external IP, run the following command using mynet-second-vm's external IP:
Below are a multiple choice questions to reinforce your understanding of this lab's concepts. Answer them to the best of your abilities.
Remove the allow-icmp firewall rule and try to ping the internal and external IP address of mynet-second-vm.
In the console, navigate to Navigation menu () > VPC network > Firewall.
Check the mynetwork-allow-icmp rule.
Click DELETE.
Click DELETE to confirm the deletion.
Wait for the firewall rule to be deleted.
Return to the mynet-us-vm SSH terminal.
To test connectivity to mynet-second-vm's internal IP, run the following command using mynet-second-vm's internal IP:
You are able to ping mynet-second-vm's internal IP because of the allow-custom firewall rule.
To test connectivity to mynet-second-vm's external IP, run the following command using mynet-second-vm's external IP:
Remove the allow-custom firewall rule and try to ping the internal IP address of mynet-second-vm.
In the console, navigate to Navigation menu () > VPC network > Firewall.
Check the mynetwork-allow-custom rule and then click DELETE.
Click DELETE to confirm the deletion.
Wait for the firewall rule to be deleted.
Return to the mynet-us-vm SSH terminal.
To test connectivity to mynet-second-vm's internal IP, run the following command using mynet-second-vm's internal IP:
Close the SSH terminal:
Remove the allow-ssh firewall rule and try to SSH to mynet-us-vm.
In the console, navigate to Navigation menu () > VPC network > Firewall.
Check the mynetwork-allow-ssh rule and then click DELETE.
Click DELETE to confirm the deletion.
Wait for the firewall rule to be deleted.
In the console, navigate to Navigation menu () > Compute Engine > VM instances.
For mynet-us-vm, click SSH to launch a terminal and connect.
In this lab, you explored the default network along with its subnets, routes, and firewall rules. You deleted the default network and determined that you cannot create any VM instances without a VPC network. Thus, you created a new auto mode VPC network with subnets, routes, firewall rules and two VM instances. Then, you tested the connectivity for the VM instances and explored the effects of the firewall rules on connectivity.
Learn more about Google VPCs by reading Virtual Private Cloud (VPC) Network Overview.
Manual last updated March 16, 2025
Lab last tested March 16, 2025
Copyright 2025 Google LLC. All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.
This content is not currently available
We will notify you via email when it becomes available
Great!
We will contact you via email if it becomes available
One lab at a time
Confirm to end all existing labs and start this one