NAT is a service that translates source and/or destination addresses when traffic passes through a routing device. In the case of GCP, NAT allows us to hide the original IP address of our virtual machine when communicating with external networks. In the case of GCP, it allows VMs with internal addresses to access the internet.
There are currently two options for NAT, as follows:
- NAT gateway
- Cloud NAT
Google recommends using Cloud NAT over NAT gateway. If you are still using NAT gateway, Google recommends that you migrate it to Cloud NAT as it is a managed and self-scaling service.