A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cloud.google.com/load-balancing/docs/switch-between-target-instance-and-backend-service below:

Switch between a target instance and a backend service | Load Balancing

Switch between a target instance and a backend service

Stay organized with collections Save and categorize content based on your preferences.

This page describes how to switch the target of a forwarding rule between a target instance and a backend service.

External protocol forwarding

To switch an external forwarding rule's target from a target instance to a backend service (or the other way around), you need to delete and re-create the forwarding rule with the new target. This method requires a static IP address so that you can use the same address with the new forwarding rule.

Deleting and re-creating the forwarding rule is the only way to switch between external protocol forwarding and a backend service-based external passthrough Network Load Balancer.

Internal protocol forwarding

There are two ways to switch between internal protocol forwarding and an internal passthrough Network Load Balancer:

A target instance does not specify any protocol—it inherits the protocols and ports of the forwarding rule. Therefore, when switching a forwarding rule to reference a backend service, you must ensure that the IP protocol of the forwarding rule (either TCP or UDP) matches the protocol of the backend service (either TCP or UDP).

The following diagram shows an example that uses internal protocol forwarding.

Switch between a target instance and a backend service. Change the target of an internal forwarding rule

To change a forwarding rule from pointing to a target instance to pointing to a regional backend service, use the following command:

gcloud compute forwarding-rules set-target FORWARDING_RULE \
    --backend-service=BACKEND_SERVICE \
    --region=REGION

To transition back to a target instance, use the following command:

gcloud compute forwarding-rules set-target FORWARDING_RULE \
    --target-instance=TARGET_INSTANCE \
    --target-instance-zone=ZONE

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-08-07 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[],[]]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4