Multiple External / Static IP Addresses on One Instance

5,498 views
Skip to first unread message

William Sharlow

unread,
Jul 31, 2017, 8:10:06 PM7/31/17
to gce-discussion
I'm running Centos 7 along with CPanel, hosting a single website without any problems.  I have plenty of capacity on the machine I terms of storage, memory, and CPUs so I want to run a second website from the same server.  The catch is I want each website to have its own external / static IP address.  Is there any way to do this other than load balancing / creating forwarding rules.  Quite frankly, I don't want to spend another $20 per month for what amounts to a second IP address being assigned to the same VM.

Bill

Navi Aujla (Google Cloud Support)

unread,
Aug 1, 2017, 10:54:40 AM8/1/17
to gce-discussion

Hi William,

To assign multiple external static IP addresses to a VM instance, you can add additional IP interfaces when creating an instance under networking option.


However, It will require to create a VPC network [1] with subnets to assign the IP from, before adding an interface. Each VM instance could have up to eight network interfaces, and at least one depending machine type and the number of vCPUs. Network without subnetworks can not be used for multiple network interfaces for an instance. Same way, You can assign static external IP to the added interfaces.

Adding multiple interfaces feature is in currently in beta state and is not covered by any SLA. Also, currently there is limitation for this feature that You cannot add a supplementary network interface to assign an additional IP address to existing VM instance, so in that case you can take a snapshot [2] of existing VM and use that snapshot to create new VM [3] and add additional interface with the static external IP to the new VM. For more detailed information regarding multiple interfaces refer to this public documentation [4].


[1] https://cloud.google.com/compute/docs/vpc/#vpc_networks_and_subnets

[2] https://cloud.google.com/compute/docs/disks/create-snapshots

[3] https://cloud.google.com/compute/docs/instances/create-start-instance#createsnapshot

[4] https://cloud.google.com/compute/docs/create-use-multiple-interfaces

William Sharlow

unread,
Aug 2, 2017, 8:22:46 AM8/2/17
to gce-discussion
Thank you Navi - I walked through the process last night - very helpful!

Bruno M

unread,
Mar 12, 2018, 11:56:04 AM3/12/18
to gce-discussion
Hi William, 

How is your experience using Cpanel with GCP? Are you able to use more than 1 IP per VM and 1 IP dedicated per domain in Cpanel?


Thanks.

William Sharlow

unread,
Mar 16, 2018, 5:13:35 PM3/16/18
to gce-discussion
While I have stepped through the process as described above, I have not yet actually run multiple IPs from a single VM. I plan to do this over the summer.  Overall, my experience is very good with Cpanel and GCP.

Roberto Carlos Morano

unread,
Apr 12, 2018, 12:24:39 PM4/12/18
to gce-discussion
Aloha everybody,


El martes, 1 de agosto de 2017, 16:54:40 (UTC+2), Navi Aujla (Google Cloud Support) escribió:

Hi William,

To assign multiple external static IP addresses to a VM instance, you can add additional IP interfaces when creating an instance under networking option.


However, It will require to create a VPC network [1] with subnets to assign the IP from, before adding an interface. Each VM instance could have up to eight network interfaces, and at least one depending machine type and the number of vCPUs. Network without subnetworks can not be used for multiple network interfaces for an instance. Same way, You can assign static external IP to the added interfaces.

Adding multiple interfaces feature is in currently in beta state and is not covered by any SLA. Also, currently there is limitation for this feature that You cannot add a supplementary network interface to assign an additional IP address to existing VM instance, so in that case you can take a snapshot [2] of existing VM and use that snapshot to create new VM [3] and add additional interface with the static external IP to the new VM. For more detailed information regarding multiple interfaces refer to this public documentation [4].


I've followed every mentioned step successfully, but I'm still not able to reach my GCE instance from Internet using the extra external IPs :(

I have an Ubuntu instance with 4 NICs that are plugged to 4 different VPCs (default + 3 extra ones I've created using different subnets). This way I could attach an external IP to each NIC and everything seems correct in the GCP console right now.

I have also followed this [5] step (btw, here [6] you can find a snippet I made for iterating on every interface).

Navi, do you think I'm missing something?

Thanks in advance,

Best!

master weber

unread,
Apr 8, 2019, 2:10:24 PM4/8/19
to gce-discussion
I have been moved to google cloud from amazon cloud. My idea is the same as you, but cannot be completed. You may setup alias ips to one instance by adding network interface, but they do not work with cpanel which supports only one nic. I think this is business matter, not technology capability. cPanel must have other license type for multiple ips controlled by license verification. The instance with cpanel is only 1 license for primary ip. cPanel has one port open for its frequent license verification.


On Monday, July 31, 2017 at 8:10:06 PM UTC-4, William Sharlow wrote:

Justin Reiners

unread,
Apr 8, 2019, 3:59:05 PM4/8/19
to master weber, gce-discussion
I'm just curious, but can you possibly set up virtual hosts for cpanel? I'm not sure if it's possible because I don't use Cpanel, but I do host many different domains using a single external IP address with SSL without issues

--
© 2018 Google Inc. 1600 Amphitheatre Parkway, Mountain View, CA 94043
 
Email preferences: You received this email because you signed up for the Google Compute Engine Discussion Google Group (gce-dis...@googlegroups.com) to participate in discussions with other members of the Google Compute Engine community and the Google Compute Engine Team.
---
You received this message because you are subscribed to the Google Groups "gce-discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gce-discussio...@googlegroups.com.
To post to this group, send email to gce-dis...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gce-discussion/45720169-ac7b-4006-a788-0b62bb2a4b3a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

William Sharlow

unread,
Apr 9, 2019, 9:41:27 AM4/9/19
to gce-discussion
This does work in CPanel, it does support multiple NIC interfaces, this can be set up through WHM. I have done so by following the instructions provided by Navi as well as WHM documentation. This works quite well except for the problem I describe here: 


Interestingly, the status of this bug changed earlier today.


On Monday, April 8, 2019 at 3:59:05 PM UTC-4, Justin Reiners wrote:
I'm just curious, but can you possibly set up virtual hosts for cpanel? I'm not sure if it's possible because I don't use Cpanel, but I do host many different domains using a single external IP address with SSL without issues

On Mon, Apr 8, 2019 at 1:10 PM master weber <cgcm...@gmail.com> wrote:
I have been moved to google cloud from amazon cloud. My idea is the same as you, but cannot be completed. You may setup alias ips to one instance by adding network interface, but they do not work with cpanel which supports only one nic. I think this is business matter, not technology capability. cPanel must have other license type for multiple ips controlled by license verification. The instance with cpanel is only 1 license for primary ip. cPanel has one port open for its frequent license verification.

On Monday, July 31, 2017 at 8:10:06 PM UTC-4, William Sharlow wrote:
I'm running Centos 7 along with CPanel, hosting a single website without any problems.  I have plenty of capacity on the machine I terms of storage, memory, and CPUs so I want to run a second website from the same server.  The catch is I want each website to have its own external / static IP address.  Is there any way to do this other than load balancing / creating forwarding rules.  Quite frankly, I don't want to spend another $20 per month for what amounts to a second IP address being assigned to the same VM.

Bill

--
© 2018 Google Inc. 1600 Amphitheatre Parkway, Mountain View, CA 94043
 
Email preferences: You received this email because you signed up for the Google Compute Engine Discussion Google Group (gce-dis...@googlegroups.com) to participate in discussions with other members of the Google Compute Engine community and the Google Compute Engine Team.
---
You received this message because you are subscribed to the Google Groups "gce-discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gce-dis...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages