Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Using alias IP ranges with load balancing

I have below application configuration,

  • Application 1 on instance A is bound on primary internal IP 10.x.0.10
  • Application 2 on instance A is bound on internal alias IP 10.x.0.11
  • Application 1 on instance B is bound on primary internal IP 10.x.0.12
  • Application 2 on instance B is bound on internal alias IP 10.x.0.13

and wanted to have a load balancer configuration is responsible for load balancing requests to application 2, how could I make that possible? I can't use port mapping since application 1 and 2 are on same port number.  

Solved Solved
0 2 707
1 ACCEPTED SOLUTION

I found this discussion in google groups that can be useful to clarify your doubts.

Quoting:

Specific to network load balancing, since the load balancer has an external IP address, and because that type of load balancer is not a proxy, packets are delivered with the destination IP being the external IP of the load balancer itself.  The instances in the target pool are configured to receive those packets by virtue of a NAT mapping performed by the load balancer's forwarding rule. Traffic is then delivered to the primary network interface of the VM.

VMs can only have a single network interface per VPC network, and load balancing only delivers packets to the primary network interface of a VM.

If you have your application 2 bound to alias IP, you can't deliver packages from the load balancer because the LB only delivers in the primary network. 

View solution in original post

2 REPLIES 2

I found this discussion in google groups that can be useful to clarify your doubts.

Quoting:

Specific to network load balancing, since the load balancer has an external IP address, and because that type of load balancer is not a proxy, packets are delivered with the destination IP being the external IP of the load balancer itself.  The instances in the target pool are configured to receive those packets by virtue of a NAT mapping performed by the load balancer's forwarding rule. Traffic is then delivered to the primary network interface of the VM.

VMs can only have a single network interface per VPC network, and load balancing only delivers packets to the primary network interface of a VM.

If you have your application 2 bound to alias IP, you can't deliver packages from the load balancer because the LB only delivers in the primary network. 

Hi Pbijjala.

Do your application able to work if using hostname to access it? If yes you could use reverse proxy on each instance. The Loadbalancer then work within the hostname domain to the reverse proxy server on each instance. Unless your application have a certain requirement to bound to spesific interface.

Thank You.