Search code examples
google-cloud-platformgoogle-compute-enginenat

Is there a way to use Google NAT service in order to get a single IP to multiple compute engines in different projects


I'm trying to create a single outbound IP to multiple compute engines in different Google projects. The reason I want to do this is a third party service that needs whitelist in order to work and every addition of IP to its whitelist cause restart. Tried first to think of a Google NAT, but the solution is unclear in a case of multiple projects.

Can you help me solve this issue


Solution

  • Google NAT will provide you with a single public IP address for instances with only a private IP address in the same subnet of the same project.

    This means that you cannot use NAT to provide a single public IP address to represent instances in more than one project.

    The only method that I know of is to setup multiple VPNs with your data center and route all traffic for these instances to your data center via the VPN and then out to the public Internet. Your data center router's public interface will be the IP address that is whitelisted.