
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
Configure internal traffic and health check firewall rules
/ 25
Create a NAT configuration using Cloud Router
/ 25
Configure instance templates and create instance groups
/ 25
Configure the internal Network Load Balancer
/ 25
Google Cloud offers internal Network Load Balancing for your TCP/UDP-based traffic. Internal Network Load Balancing enables you to run and scale your services behind a private load balancing IP address that is accessible only to your internal virtual machine instances.
In this lab, you create two managed instance groups in the same region. Then you configure and test an internal Network Load Balancer with the instances groups as the backends, as shown in this network diagram:
In this lab, you will learn how to perform the following tasks:
For each lab, you get a new Google Cloud project and set of resources for a fixed time at no cost.
Sign in to Qwiklabs using an incognito window.
Note the lab's access time (for example, 1:15:00
), and make sure you can finish within that time.
There is no pause feature. You can restart if needed, but you have to start at the beginning.
When ready, click Start lab.
Note your lab credentials (Username and Password). You will use them to sign in to the Google Cloud Console.
Click Open Google Console.
Click Use another account and copy/paste credentials for this lab into the prompts.
If you use other credentials, you'll receive errors or incur charges.
Accept the terms and skip the recovery resource page.
Configure firewall rules to allow internal traffic connectivity from sources in the 10.10.0.0/16 range. This rule allows incoming traffic from any client located in the subnet.
Health checks determine which instances of a load balancer can receive new connections. For Application Load Balancing (HTTP), the health check probes to your load-balanced instances come from addresses in the ranges 130.211.0.0/22 and 35.191.0.0/16. Your firewall rules must allow these connections.
The network my-internal-app with subnet-a and subnet-b and firewall rules for RDP, SSH, and ICMP traffic have been configured for you.
In the Cloud Console, on the Navigation menu (), click VPC network > VPC networks.
Notice the my-internal-app network with its subnets: subnet-a and subnet-b.
Each Google Cloud project starts with the default network. In addition, the my-internal-app network has been created for you as part of your network diagram.
You will create the managed instance groups in subnet-a and subnet-b. Both subnets are in the
Create a firewall rule to allow traffic in the 10.10.0.0/16 subnet.
On the Navigation menu (), click VPC network > Firewall.
Notice the app-allow-icmp and app-allow-ssh-rdp firewall rules.
These firewall rules have been created for you.
Click Create Firewall Rule.
Specify the following, and leave the remaining settings as their defaults.
Property | Value (type value or select option as specified) |
---|---|
Name | fw-allow-lb-access |
Network | my-internal-app |
Targets | Specified target tags |
Target tags | backend-service |
Source filter | IPv4 ranges |
Source IPv4 ranges | 10.10.0.0/16 |
Protocols and ports | Allow all |
Create a firewall rule to allow health checks.
On the Navigation menu (), click VPC network > Firewall.
Click Create Firewall Rule.
Specify the following, and leave the remaining settings as their defaults.
Property | Value (type value or select option as specified) |
---|---|
Name | fw-allow-health-checks |
Network | my-internal-app |
Targets | Specified target tags |
Target tags | backend-service |
Source filter | IPv4 Ranges |
Source IPv4 ranges | 130.211.0.0/22 and 35.191.0.0/16 |
Protocols and ports | Specified protocols and ports |
Click Check my progress to verify the objective.
The Google Cloud VM backend instances that you setup in Task 3 will not be configured with external IP addresses.
Instead, you will setup the Cloud NAT service to allow these VM instances to send outbound traffic only through the Cloud NAT, and receive inbound traffic through the load balancer.
On the Google Cloud console title bar, type Network services in the Search field, then click Network services in the Products & Page section.
On the Network service page, click Pin next to Network services.
Click Cloud NAT.
Click Get started to configure a NAT gateway.
Specify the following, and leave the remaining settings as their defaults.
Property | Value (type value or select option as specified) |
---|---|
Gateway name | nat-config |
Network | my-internal-app |
Region |
Click Cloud Router, and select Create new router.
For Name, type nat-router-
Click Create.
In Create Cloud NAT gateway, click Create.
Click Check my progress to verify the objective.
A managed instance group uses an instance template to create a group of identical instances. Use these to create the backends of the internal Network Load Balancer.
This task has been performed for you at the start of this lab. You will need to SSH into each instance group VM and run the following command to setup the environment.
On the Navigation menu, click Compute Engine > VM instances.
Notice the instances that start with instance-group-1 and instance-group-2.
Select the SSH button next to instance-group-1 to SSH into the VM.
If prompted allow SSH-in-browser to connect to VMs, click Authorize.
Run the following command to re-run the instance's startup script:
Repeat the previous steps for instance-group-2.
Wait for both startup scripts to finish executing, then close the SSH terminal to each VM. The output of the startup script should state the following:
Verify that VM instances are being created in both subnets and create a utility VM to access the backends' HTTP sites.
On the Navigation menu, click Compute Engine > VM instances.
Notice the instances that start with instance-group-1 and instance-group-2.
These instances are in separate zones, and their internal IP addresses are part of the subnet-a and subnet-b CIDR blocks.
Click Create Instance.
For the __Machine configuration__page, specify the following, and leave the remaining settings as their defaults:
Property | Value (type value or select option as specified) |
---|---|
Name | utility-vm |
Region | |
Zone | |
Series | E2 |
Machine type | e2-medium (2 vCPU, 4 GB memory) |
Click OS and storage.
If the Image shown is not Debian GNU/Linux 12 (bookworm), click Change and select Debian GNU/Linux 12 (bookworm), and then click Select.
Click Networking.
For Network interfaces, click the dropdown to edit the network interface.
Specify the following, and leave the remaining settings as their defaults.
Property | Value (type value or select option as specified) |
---|---|
Network | my-internal-app |
Subnetwork | subnet-a |
Primary internal IPv4 address | Ephemeral (Custom) |
Custom ephemeral IP address | 10.10.20.50 |
External IPv4 address | None |
Click Done.
Click Create.
Note that the internal IP addresses for the backends are 10.10.20.2 and 10.10.30.2.
Click Check my progress to verify the objective.
For utility-vm, click SSH to launch a terminal and connect.
If prompted allow SSH-in-browser to connect to VMs, click Authorize.
To verify the welcome page for instance-group-1-xxxx, run the following command:
The output should look like this.
Output:
The output should look like this.
Output:
Configure the internal Network Load Balancer to balance traffic between the two backends (instance-group-1 in
my-ilb
.my-internal-app
from the dropdown.The backend service monitors instance groups and prevents them from exceeding configured usage.
Click Backend configuration.
Specify the following, and leave the remaining settings as their defaults.
Property | Value (select option as specified) |
---|---|
Instance group | instance-group-1 ( |
Click Done.
Click Add a backend.
For Instance group, select instance-group-2 (
Click Done.
For Health Check, select Create a health check.
Specify the following, and leave the remaining settings as their defaults.
Property | Value (select option as specified) |
---|---|
Name | my-ilb-health-check |
Protocol | TCP |
Port | 80 |
Check interval | 10 sec |
Timeout | 5 sec |
Healthy threshold | 2 |
Unhealthy threshold | 3 |
The frontend forwards traffic to the backend.
Click Frontend configuration.
Specify the following, and leave the remaining settings as their defaults.
Property | Value (type value or select option as specified) |
---|---|
Subnetwork | subnet-b |
Internal IP purpose > IP address | Create IP address |
Specify the following, and leave the remaining settings as their defaults.
Property | Value (type value or select option as specified) |
---|---|
Name | my-ilb-ip |
Static IP address | Let me choose |
Custom IP address | 10.10.30.5 |
Click Reserve.
Under Ports, for Port number, type 80
.
Click Done.
Click Check my progress to verify the objective.
Verify that the my-ilb IP address forwards traffic to instance-group-1 in
The output should look like this.
Output:
You should be able to see responses from instance-group-1 in
In this lab, you created two managed instance groups in the
When you have completed your lab, click End Lab. Google Cloud Skills Boost removes the resources you’ve used and cleans the account for you.
You will be given an opportunity to rate the lab experience. Select the applicable number of stars, type a comment, and then click Submit.
The number of stars indicates the following:
You can close the dialog box if you don't want to provide feedback.
For feedback, suggestions, or corrections, please use the Support tab.
Copyright 2022 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