NAT gateway
Google allows us to provision a virtual machine that will act as a NAT gateway. This way, you are exposing only one VM to the internet. The gateway machine needs to be configured with the --can-ip-forward parameter, which allows traffic forwarding. You will also need to create default routes for the subnets that should be using the gateway. As you can see, this solution does not look scalable and introduces the concept of single point of failure.
To eliminate this problem, you can create multiple gateways and put them in managed instance groups. Next, you configure the routing rule to the NAT gateways with the same priority. In this case, GCP uses the equal-cost multi-path (ECMP) to distribute the traffic between the NAT gateways. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access