Can a single VM instance have multiple external IP address?

I know it possible by having two different custom VPC networks and then add that VPC while creating the instance and this doesn't work my solution. Is there any other possible way that VM instance can have multiple external IP's in one VPC and subnet?

1 8 4,567
8 REPLIES 8

Take a look at Protocol Forwarding

Apart from the static external IP address that you allocate to a Compute Engine, you can attach forwarding rules that points to the virtual machine's IP address. 

https://cloud.google.com/load-balancing/docs/forwarding-rule-concepts

It's possible because of custom VPC network service.

Is there a suitable answer to the above question?

Hello Jesse,

There is no way to directly add more Public IP addresses to a GCE VM's default Network Interface (nic0).

However, there are strategies available to allow for users to assign multiple external IP addresses to a single instance utilizing protocol forwarding. [1]

The steps outlined here[2] will be able to help you achieve this goal within two straightforward steps:
1) Creating (or defining) a Target Instance.
2) Creating Forwarding rule objects.

[1] https://cloud.google.com/compute/docs/ip-addresses#externaladdresses
[2] https://cloud.google.com/load-balancing/docs/protocol-forwarding#configuring

@Simrandeep . Hi, I have a highly complex problem and would like to know if there is any way to solve it. With one external(static) IP address, I installed cPanel and WHM on the Compute Engine. Here is how I set up cPanel and WHM on Compute Engine. 

Blog Article: https://www.incapio.com/post/how-to-install-cpanel-whm-on-centos-7-google-cloud-gcp

Later, I stated that I required additional external IP addresses; for example, I would like to host 20 websites on cPanel. As a result, each website must have its own IP address (External).

So I set up cPanel with various network interfaces, such as "nic0," "nic1," and "nic2" up to ten. The remaining are not routed, except for "nic0." 

Why not use SNI routing and just use multiple certificates with 1 IP?

Hi @incapio ,

Do u have any workaround for this case?

I face same problem with cpanel and whm in single ce