Attach multiple static IP to single windows server instance on Google Cloud

0

My aim is this

  1. Host multiple websites/apps on IIS that is configured on my windows server instance on Google cloud.
  2. Have each website use attached individual static IPS already reserved
  3. Requests are routed to the exact app it is meant for based on the ip addressing

What I've done

  1. Created a windows server 2012 instance on google cloud
  2. Attached a static ip to the instance and currently have one website pointing to that static ip
  3. Reserved extra static ip and attempted to attach to the existing instance

Challenges

Google cloud won't allow me attach an IP to an existing instance that already has an IP (fair enough). So I thought it would make sense creating multiple network interfaces and attach separate IP to them. However google cloud docs says:

  1. You can only configure a network interface when you create an instance - I really do not have the luxury of recreating this instance.
  2. You cannot attach multiple network interfaces to the same VPC network. - I do not have needs for multiple VPC network. I'm trying to use IIS as a web server hosting multiple applications that can each be reached via its own IP.

I also attempted IP Forwarding rules but it turns out It can only be toggled on creation and since I have a running instance with IP forwarding turned off, I would have to recreate the instance to fit my needs.

Is there a way out for me? what do I have to do?

ibnhamza

Posted 2018-04-09T09:44:22.480

Reputation: 101

Answers

1

I think that you are confusing Google IP Forwarding for Google Protocol Forwarding.

IP Forwarding is used for VPN, NAT Gateway, etc. IP Forwarding routes traffic thru an instance bound for somewhere else. This is a feature to disable the source / destination check that normally happens when evaluating IP traffic so that the network interfaces on a VM instance can route traffic thru the instance.

For your usage case (multiple IP addresses for one VM instance), you can use Google Protocol Forwarding (GPF for short in this answer).

GPF is used to create forwarding rules for traffic and supports multiple public IP addresses. In essence, GPF is a load balancer that has an IP address bound to a forwarding rule. You would configure your Apache, IIS, etc. services to use the public IP addresses bound to the forwarding rules.

Note: The Google Cloud Console (at this time) does not support creating GPF. You must use the API or gcloud.

In summary, create a target-instance. Then bind rules to this target-instance. This target-instance is not a normal VM instance that you will see in the Google Console.

Protocol forwarding is charged at the same rates as the load balancing service. Keep this in mind if your goal is a low cost solution. Google Load Balancer Pricing.

This document on Google Protocol Forwarding will help you understand how to implement this feature.

Using Protocol Forwarding

John Hanley

Posted 2018-04-09T09:44:22.480

Reputation: 146