Search code examples
google-cloud-platformnat

Cloud NAT instead of assigning a Static External IP Address?


I'm gonna be trying to set up my own VPN on GCP. So I'll be needing a static external IP address.
However, it costs a couple dollars every month.
I read this where it says The idea behind this change is to reduce global static IP usage and to encourage users to use private VM instances (without static external IP) and expose them to the outside via Cloud NAT, thus reducing the attack surface.

So is Cloud NAT like a free alternative to static external IPs?
Can I use Cloud NAT to get a static external IP? Or something similar?

If this is a very stupid question, please be patient with me and help me understand.
Thank you.


Solution

  • Cloud NAT is a SNAT service that allows your virtual machine that don't have an external IP address to have internet access. Cloud NAT cannot be used to receive incoming connections (DNAT) for those machines - you'll need an external IP address for that.