Implement External Passthrough NLB - GSP658

A passionate full-stack developer from @ePlus.DEV
Search for a command to run...

A passionate full-stack developer from @ePlus.DEV
No comments yet. Be the first to comment.
Quick and practical tips to help users optimize tasks, improve skills, and solve common problems effectively across various areas like tech, lifestyle, productivity, and more.
Overview A regional internal proxy Network Load Balancer is used when you need to load balance internal traffic (from within your VPC or connected networks) and your application requires Layer 4 proxy
Một bản tin giúp Developer cập nhật nhanh AI, Cloud, Open Source và những công nghệ đáng chú ý trong ngày. 📌 Executive Summary OpenAI thay đổi thời điểm tính phí seat mới của ChatGPT Business từ n

Overview Dataplex is an intelligent data fabric that enables organizations to centrally discover, manage, monitor, and govern their data across data lakes, data warehouses, and data marts to power ana

Daily Tech Brief — 06/08/2026 Một bản tin giúp Developer cập nhật nhanh AI, Cloud, Open Source và những công nghệ đáng chú ý trong ngày. 📌 Executive Summary Claude Code 2.1.223 vá nhiều đường обх

Overview In a challenge lab you’re given a scenario and a set of tasks. Instead of following step-by-step instructions, you will use the skills learned from the labs in the course to figure out how to

🏕️ Arcade Base Camp August 2026 Welcome to Arcade Base Camp August 2026, where you’ll develop key Google Cloud skills and earn an exclusive credential that will open doors to the cloud for you. No pr

An External passthrough Network Load Balancer is typically used when a service needs to be publicly accessible and handle high-volume, performance-sensitive non-HTTP/S traffic while needing to see the client's true IP address.
Non-HTTP/S Protocols: Ideal for load balancing traffic using TCP or UDP that is not HTTP/S (e.g., mail servers, gaming servers, VPN tunnels, or custom protocols).
Source IP Preservation: Critical when backend applications must see the original client's source IP address for logging, security, or custom logic.
Maximum Performance: For applications requiring the highest throughput and lowest latency because it is a passthrough (non-proxied) load balancer operating at Layer 4.
Global Reach (TCP/UDP): It can provide a single global IP address to distribute TCP/UDP traffic across backends in multiple regions (when configured globally), offering high availability for non-web protocols.
In this lab you learn how to configure an External passthrough Network Load Balancer by deploying and linking all of its essential componets and verifying public traffic distribution across the instances.
In this lab, you learn how to:
Deploy and configure backend VM instances using startup scripts and network tags to host a web application service.
Create a firewall rule to selectively permit external traffic to the tagged backend instances.
Configure the load balancer components, including a static external IP address, health check, backend service, and forwarding rule.
Test the load balancer to verify public traffic distribution.
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:
Note: Use an Incognito (recommended) or private browser window to run this lab. This prevents conflicts between your personal account and the student account, which may cause extra charges incurred to your personal account.
Note: Use only the student account for this lab. If you use a different Google Cloud account, you may incur charges to that account.
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 right is the Lab setup and access panel with the following:
The Open Google Cloud console button
The temporary credentials (username and password) that you must use for this lab
Other information, if needed, to step through this lab
Note that the lab timer is located near the top of the page, showing the remaining time.
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.
Note: If you see the Choose an account dialog, click Use Another Account.
If necessary, copy the Username below and paste it into the Sign in dialog.
student-02-9de8536ac0c5@qwiklabs.net
Copied!
You can also find the Username in the Lab setup and access panel.
Click Next.
Copy the Password below and paste it into the Welcome dialog.
YzmhLzoxnJBY
Copied!
You can also find the Password in the Lab setup and access panel.
Click Next.
Important: You must use the credentials the lab provides you. Do not use your Google Cloud account credentials.
Note: Using your own Google Cloud account for this lab may incur extra charges.
Click through the subsequent pages:
Accept the terms and conditions.
Do not add recovery options or two-factor authentication (because this is a temporary account).
Do not sign up for free trials.
After a few moments, the Google Cloud console opens in this tab.
Note: To access Google Cloud products and services, click the Navigation menu or type the service or product name in the Search field.
(2) Compute Engine VM instances with web server running on each.
Firewall rules configured to allow incoming HTTP traffic on port 80 to the VMs (using the network-lb-tag network tag)
Verify that the resources are ready:
In the console, go to Compute Engine.
Copy the External IP for one of the VMs that have been created.
Open a new browser, paste the copied IP, and navigate to the backend-vm-us-central1. You should see "Web Server 1!"
Repeat this step for the other instance, and navigate to "Web Server 2" and read the message.
In the Google Cloud Console, go to Navigation Menu > Compute Engine > Instance groups.
First, click Create Instance Group and select New unmanaged instance group for the us-central1 region.
| Property | Value |
|---|---|
| Name | web-server-1 |
| Region | us-central1 |
| Zone | Select the zone us-central1-c |
| Network | default |
| Select VMs | Add backend-vm-us-central1 |
Click Create.
Repeat the process for a second instance group named web-server-2.
| Property | Value |
|---|---|
| Name | web-server-2 |
| Region | us-central1 |
| Zone | Select the zone us-central1-c |
| Network | default |
| Select VMs | Add backend-vm1-us-central1 |
Click Check my progress to verify the objective.
Create Instance Groups
This is the core task where you build the load balancer itself. A Google Cloud Load Balancer isn't a single box; it's a set of distinct resources that work together. You will now create and link them:
Health Check: This tells the load balancer how to check if a backend VM is "alive." It ensures traffic is only sent to healthy, responsive instances.
Backend Service: This is the "brain" of the load balancer. It logically groups your backend VMs (your two instances) and tells the load balancer which Health Check to use on them.
Static External IP Address: This gives your load balancer a permanent, public-facing IP address. This is the single address your users will access.
Forwarding Rule: This is the "frontend" that ties everything together. It connects your public static IP (the frontend) to your backend service (the backend), telling the load balancer: "When traffic hits this IP on port 80, send it to one of the healthy VMs in that backend service."
The health check ensures the load balancer only sends traffic to healthy instances.
Navigate to Health Checks: In the Google Cloud Console, go to Navigation Menu > Compute Engine > Health checks.
Click Create a health check.
Name: basic-http-check
Scope: Regional
Region: us-central1
Protocol: TCP
Port: 80
Leave the default settings and click Create.
The backend service manages the backends (your VM instances) and distributes traffic to them.
Type Load balancing in the search bar on the top. Under Products & Pages, click on Load balancing.
Click Create Load Balancer.
On the Network Load Balancer (TCP/UDP/SSL), click Next.
Select Passthrough load balancer, click Next.
Select Public facing (external), then click Next and Configure.
Set the following values:
| Property | Value |
|---|---|
| Load Balancer Name | network-lb-backend-service |
| Region | us-central1 |
| Backend type | Instance group |
| Protocol | TCP |
| Health Check | basic-http-check |
In the New backends, select Instance group as web-server-1.
Click Done.
Click Add a backend then specify Instance group as web-server-2.
Click Done.
| Property | Value |
|---|---|
| IP version | IPv4 |
| IP address | click Create IP Address |
| Name | network-lb-ip, click Reserve |
| Port | 80 |
Click Done.
Click Create.
Click Check my progress to verify the objective.
Configure the load balancer
This final step is to verify that your entire configuration works. You will send repeated test requests to the load balancer's single public IP address. The goal is to confirm that your requests are being distributed across both of your backend instances, proving that the load balancer is successfully spreading the traffic.
Go to the Load balancing page.
Click on the network-lb-backend-service load balancer you created.
The IP address listed in the summary is the external IP of your load balancer.
curl http://[LOAD_BALANCER_IP_ADDRESS]
Copied!
You should see a response from either "Web Server 1" or "Web Server 2".
Run the command several times. You should see responses from both servers, confirming the load balancer is distributing traffic.
https://www.youtube.com/watch?v=BWF3MrW7JsU
curl -LO raw.githubusercontent.com/ePlus-DEV/storage/refs/heads/main/labs/GSP658/lab.sh
source lab.sh
Script Alternative
curl -LO raw.githubusercontent.com/prateekrajput08/Arcade-Google-Cloud-Labs/refs/heads/main/Implement%20External%20Passthrough%20NLB/TechCode.sh
sudo chmod +x TechCode.sh
./TechCode.sh