Befriend Networks!
While preparing for the certifications you might come across the term VPC. Multiple VPC Networks is one of the advanced labs in the Cloud Engineering Quest which will help you in understanding and working with VPCs. Before moving forward with the lab, let’s understand what VPC networks are.
“A Virtual Private Cloud (VPC) network is a virtual version of a physical network, such as a data center network. It provides connectivity for your Compute Engine virtual machine (VM) instances, Google Kubernetes Engine (GKE) clusters, App Engine flexible environment instances, and other resources in your project.”
Now let’s get some hands on experience with the lab!
Objectives
Let us have a look at the objectives of this lab.

Setup and Requirements
The set-up and requirements of this lab are very basic. All you need is an incognito window. Activate the Cloud shell as explained in the lab instructions. Once that is done, you are all set to proceed with the lab.
Create custom mode VPC networks with firewall rules
In this first section, you will see the following subsections:

Create the managementnet network
We will be creating two networks out of which the first one is the managementnet network. You will create a VPC network and also a subnet. Once you click on the command line option you will see a list of commands which will illustrate that networks and subnets can be created using the Cloud Shell command line:
Take note of these commands as they will come in handy for your exam preparations.
Create the privatenet network
While creating the managementnet network we used the Google Cloud Console, while creating the privatenet network we will use the Cloud Shell. All you need to do is run the commands given in the Cloud Shell after understanding them. Once you run the command you will see an output similar to this:
Create the firewall rules for managementnet
Now, it’s time to create the firewall rules for managementnet. Here is where you will find them:
Set the values as given in the instructions and leave all other values at their defaults. It should look exactly like this:
Click on the create button once you are done. Your firewall rule is ready!
Create the firewall rules for privatenet
We will be creating firewall rules for the privatenet network as well. The only difference will be that you will be creating these rules through a command line. You need to run a few commands which are given in the lab instructions in order to create the firewall rules for privatenet.
Create VM instances
In this lab you will create two VM instances: managementnet-us-vm in the managementnet-us-vm network and privatenet-us-vm in privatesubnet-us network. You will use the GCP console for creating the managementnet-us-vm.
When you navigate, you will see the mynet-eu-vm and mynet-us-vm VM instances which are already created for you. Refer to the screenshots below
Click on the Create Instance button and set the values as given in the lab instructions. Once you click “done”, your VM instance will be created in a couple of minutes.
For creating the privatenet-us-vm, enter the command given in the lab instructions in the cloud shell and wait for a couple of minutes till the job is done. To confirm the creation of the instances, navigate to the VM instances page. You will see four VM instances instead of two.
Explore the connectivity between VM instances
To explore the connectivity between the VM instances, you will do a ping test and see how it works.
In order to do that you will SSH into VM instances and ping the external IP address. Note the external IP addresses of the created VMs. You will be trying different permutations and combinations to see what will work and what will not. Discover how to test the connectivity and in which scenario you will see packets dropping.
Create a VM instance with multiple network interfaces
This is the last section of this lab. Let us look above at the different things which you will be doing here.
First you will be creating networks with multiple network interfaces, then explore the network interface details and then the network interface connectivity.
Create the VM instance with multiple network interfaces
While creating the vm-appliance instance with network interfaces in privatesubnet-us, managementsubnet-us and mynetwork, the CIDR ranges of these subnets do not overlap, which is a requirement for creating a VM with multiple network interface controllers (NICs).
Creating VM instances is quite an easy task and as you are already familiar with it having done it before you can easily do it this time with the updated instructions.
Explore the network interface details
You will explore the network interface details of vm-appliance within the Console and within the VM’s terminal. Follow the instructions step by step as given in the instructions and run the command sudo ifconfig. This will list all the network interfaces within the VM instance.
Explore the network interface connectivity
For exploring the network interface connectivity, you need to do the same thing which you did earlier i.e. the ping test using the external and internal IPs. Once the ping tests are completed, your lab has been completed. Congratulations on getting a step ahead in the #30daychallenge.
For those late to join the challenge, we have something for you as well. Enter code 1q-vpc-384 for 3 credits off the quest (valid through January 31st).
