-
Forwarding rules overview
- A forwarding rule and its corresponding IP address represent the frontend configuration of a Google Cloud load balancer
- Forwarding rules are used for protocol forwarding, Classic VPN gateways, and Traffic Director to provide forwarding information in the control plane
- Each forwarding rule references an IP address and one or more ports on which the load balancer accepts traffic
- Some Google Cloud load balancers limit users to a predefined set of ports, and others let users specify arbitrary ports
- The forwarding rule also specifies an IP protocol
- For Google Cloud load balancers, the IP protocol is always either TCP or UDP
-
Depending on the load balancer type
- A forwarding rule specifies a backend service, target proxy, or target pool
- A forwarding rule and its IP address are internal or external
- Depending on the load balancer and its tier, a forwarding rule is either global or regional
-
Internal forwarding rules
- Internal forwarding rules forward traffic that originates inside a Google Cloud network
- The clients can be in the same Virtual Private Cloud (VPC) network as the backends, or the clients can be in a connected network
-
Internal forwarding rules are used by two types of Google Cloud load balancers
- Internal TCP/UDP load balancers
- Internal HTTP(S) load balancers
-
Internal TCP/UDP load balancers
- With an internal TCP/UDP load balancer, the supported traffic type is IPv4, and the supported protocol is either TCP or UDP (not both)
- Each internal TCP/UDP load balancer has at least one regional internal forwarding rule
- The regional internal forwarding rules point to the load balancer's regional internal backend service
- The internal forwarding rule must be in a region and a subnet, and the backend service only needs to be in the region
-
Internal HTTP(S) load balancers
- With an internal HTTP(S) load balancer, the supported traffic type is IPv4, and the supported protocol can be HTTP, HTTPS, or HTTP/2
- Each internal HTTP(S) load balancer has exactly one regional internal forwarding rule
- The regional internal forwarding rule points to the load balancer's regional target HTTP or HTTPS proxy
-
External forwarding rules
- External forwarding rules forward traffic that originates from the internet, outside of your VPC network
-
External forwarding rules are used by the following Google Cloud load balancers
- External HTTP(S) load balancers
- SSL proxy load balancers
- TCP proxy load balancers
- Network load balancers
-
HTTP(S) load balancers
- The external HTTP(S) load balancers support both Premium Tier and Standard Tier
- The forwarding rule and IP address both depend on the tier selected for the load balancer
- In an external HTTP(S) load balancer, a forwarding rule points to a target proxy
- In Premium Tier, an external HTTP(S) load balancer uses a global external IP address, which can be either IPv4 or IPv6, and a global external forwarding rule
- Users can provide a globally accessible application that directs end users to backends in the closest region and distributes traffic among multiple regions
- Because a global external forwarding rule uses a single external IP address, there is no need to maintain separate DNS records in different regions or wait for DNS changes to propagate
- Users can configure two different global external IP addresses pointing to the same external HTTP(S) load balancer
- In Premium Tier, the global external IP address for one forwarding rule can be IPv4, and the global external IP address for a second forwarding rule can be IPv6
- Both forwarding rules can point to the same target proxy
- Users can provide both an IPv4 and an IPv6 address for the same external HTTP(S) load balancer
- In Standard Tier, an external HTTP(S) load balancer uses a regional external IP address, which must be IPv4, and a regional external forwarding rule
- An external HTTP(S) load balancer in Standard Tier can only distribute traffic to backends within a single region
-
SSL proxy load balancers
- An SSL proxy load balancer is similar to an external HTTP(S) load balancer because it can terminate SSL (TLS) sessions
- SSL proxy load balancers do not support path-based redirection like external HTTP(S) load balancers, so they are best suited for handling SSL for protocols other than HTTPS, such as IMAP or WebSockets over SSL
- In an SSL proxy load balancer, a forwarding rule points to a target proxy
- SSL proxy load balancers support both Premium Tier and Standard Tier
- The forwarding rule and IP address both depend on the tier that is selected for the load balancer
- In Premium Tier, an SSL proxy load balancer uses a global external IP address, which can be either IPv4 or IPv6, and a global external forwarding rule
- Users can provide a globally accessible application that directs end users to backends in the closest region and distributes traffic among multiple regions
- Because a global external forwarding rule uses a single external IP address, users don't have to maintain separate DNS records in different regions or wait for DNS changes to propagate
- It is possible to have two different global external IP addresses pointing to the same SSL proxy load balancer
- In Premium Tier, the global external IP address for one forwarding rule can be IPv4, and the global external IP address for a second forwarding rule can be IPv6. Both forwarding rules can point to the same target proxy
- Users can provide both an IPv4 and an IPv6 address for the same SSL proxy load balancer
- In Standard Tier, an SSL proxy load balancer uses a regional external IP address, which must be IPv4, and a regional external forwarding rule
- An SSL proxy load balancer in Standard Tier can only distribute traffic to backends within a single region
-
TCP proxy load balancers
- A TCP proxy load balancer offers global TCP proxying capability, without SSL offload
- TCP proxy load balancers support both Premium Tier and Standard Tier
- The forwarding rule and IP address both depend on the tier selected for the load balancer
- In a TCP proxy load balancer, a forwarding rule points to a target proxy
- In Premium Tier, a TCP proxy load balancer uses a global external IP address, which can be either IPv4 or IPv6, and a global external forwarding rule
- Users can provide a globally accessible application that directs end users to backends in the closest region and distributes traffic among multiple regions
- Because a global external forwarding rule uses a single external IP address, users don't have to maintain separate DNS records in different regions or wait for DNS changes to propagate
- It is possible to have two different global external IP addresses pointing to the same TCP proxy load balancer
- In Premium Tier, the global external IP address for one forwarding rule can be IPv4, and the global external IP address for a second forwarding rule can be IPv6.
- Both forwarding rules can point to the same target proxy
- Users can provide both an IPv4 and an IPv6 address for the same TCP proxy load balancer
- In Standard Tier, a TCP proxy load balancer uses a regional external IP address, which must be IPv4, and a regional external forwarding rule
- A TCP proxy load balancer in Standard Tier can only distribute traffic to backends within a single region
-
Network load balancers
- The network load balancers distribute either TCP or UDP traffic among backends in a single region, and supports both Premium Tier and Standard Tier
- A network load balancer uses a regional external forwarding rule and a regional external IPv4 address (regardless of tier)
- The regional external IP address can be accessed anywhere on the internet
- A regional external forwarding rule points to the load balancer's target pool
- To use Network Load Balancing in different regions, create a network load balancer in each region.
- Each load balancer has its own regional external forwarding rule with its own regional external IPv4 address
-
How Network Service Tiers affect load balancers
- In Network Service Tiers, the distinction between Standard Tier and Premium Tier depends on how far traffic is routed over the public internet
- Standard Tier: Offloads traffic as close as possible to the Google data center
- Traffic is typically routed over the public internet for a longer distance, compared with Premium Tier
- Premium Tier: Routes traffic over Google's private network as far as possible before leaving Google Cloud to get to the end user
- The internal load balancers (HTTP(S) and TCP/UDP) must use Google's private network, and they are therefore always in the Premium Tier
- Internal load balancing is always regional
- Only the external load balancers (HTTP(S), TCP proxy, SSL proxy, and TCP/UDP network) can be routed over the public internet
- Users can choose whether external load balancer is in the Premium Tier, using Google's private network, or in the Standard Tier, using the public internet
- Network Load Balancing is always regional, regardless of tier
- With Premium Tier, external HTTP(S) load balancers, TCP proxy load balancers, and SSL proxy load balancers are global
- Their forwarding rules, IP addresses, and backend services are global
- In Standard Tier, these load balancers are effectively regional
- Their backend services remain global, but their forwarding rules and IP addresses are regional
-
Multiple forwarding rules with a common IP address
-
Two or more forwarding rules with the EXTERNAL load balancing scheme can share the same IP address if
- The ports used by each forwarding rule do not overlap
- The Network Service Tiers of each forwarding rule matches the Network Service Tiers of the external IP address
- A network load balancer that accepts traffic on TCP port 79 and another network load balancer that accepts traffic on TCP port 80 can share the same regional external IP address
- The same global external IP address can be used for an external HTTP(S) load balancer (HTTP and HTTPS)
-
If the forwarding rule's load balancing scheme is one of the following, it must have a unique IP address
- INTERNAL for internal TCP/UDP load balancers
- INTERNAL_MANAGED for internal HTTP(S) load balancers
- INTERNAL_SELF_MANAGED for Traffic Director
-
Cloud IAM Conditions
- With Cloud IAM Conditions, users can set conditions to control which roles are granted to members
- This feature lets users grant permissions to members if configured conditions are met
- A Cloud IAM condition checks the load balancing scheme (for example, INTERNAL or EXTERNAL) in the forwarding rule and allows (or disallows) creation of the forwarding rule
- If a member tries to create a forwarding rule without permission, an error message appears