
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.
Click the Start Lab button. If you need to pay for the lab, a pop-up opens for you to select your payment method. On the left is the Lab Details panel 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 panel.
Click Next.
Copy the Password below and paste it into the Welcome dialog.
You can also find the Password in the Lab Details panel.
Click Next.
Click through the subsequent pages:
After a few moments, the Google Cloud console opens in this tab.
In this task, you configure firewall rules to allow internal traffic connectivity and health check probes for your application. You explore the existing network and create new firewall rules to permit traffic from specified IP ranges.
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 Google Cloud console, in 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.
In this task, you create a Cloud Router instance and configure Cloud NAT to enable your backend instances to send outbound traffic.
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.
In this task, you verify the pre-configured instance templates and managed instance groups. You execute startup scripts on the existing instances and create a utility VM to test connectivity to the backend instances.
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:
In this task you 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.
In this task, you 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