2

What do people use to update the route-collection when having a NAT gateway compute instance fail? How do people setup multiple NAT gateways in a region and failover to each other?

Greg Dubicki
  • 1,239
  • 1
  • 17
  • 33

1 Answers1

2

One method is configuring multiple (two or more) NAT gateways for your Compute Engine VM instances. When creating routes to send traffic destined to the Internet through your gateway instances (step 5 of the article), specify the same value for the priority of all these routes. This should setup an automatic failover functionality.

gcloud compute routes create no-ip-internet-route --network gce-network \
         --destination-range 0.0.0.0/0 \
         --next-hop-instance nat1-gateway \
         --next-hop-instance-zone us-central1-a \
         --tags no-ip --priority 800


gcloud compute routes create no-ip-internet-route --network gce-network \
         --destination-range 0.0.0.0/0 \
         --next-hop-instance nat2-gateway \
         --next-hop-instance-zone us-central1-f \
         --tags no-ip --priority 800
chrispomeroy
  • 113
  • 3
Kamran
  • 1,425
  • 7
  • 17
  • Has anyone tried this solution and can confirm that it works? Or not? – Greg Dubicki Sep 30 '16 at 15:50
  • 1
    Well, it seems to work. I will test further and upvote when I will be sure. – Greg Dubicki Sep 30 '16 at 16:22
  • 4
    I got confirmation from "official" Google Support (from a ticket) that this is the right way to go. (I write "official" as Kamran is also from Google Support, but I assume that the above reply is unofficial one.) – Greg Dubicki Oct 03 '16 at 09:49