
Answer-first summary for fast verification
Answer: gcloud compute instances add-tags [existing-instance] --tags no-ip
The route created with the `--tags no-ip` flag applies to instances that have the matching network tag. To make existing instances use this route, they must be tagged with `no-ip`. Option B (`gcloud compute instances add-tags`) adds the required tag to existing instances. Options A configures IP forwarding on the NAT gateway (already handled during setup). Option C is unrelated to networking. Option D creates a new instance with the tag, but the question specifies existing instances.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
You have set up a Compute Engine VM instance as a NAT gateway and created a route with the following command:
gcloud compute routes create no-ip-internet-route \
--network custom-network1 \
--destination-range 0.0.0.0/0 \
--next-hop-instance nat-gateway \
--next-hop-instance-zone us-central1-a \
--tags no-ip \
--priority 800
gcloud compute routes create no-ip-internet-route \
--network custom-network1 \
--destination-range 0.0.0.0/0 \
--next-hop-instance nat-gateway \
--next-hop-instance-zone us-central1-a \
--tags no-ip \
--priority 800
To ensure existing instances use this NAT gateway, what command should you run next?
A
sudo sysctl -w net.ipv4.ip_forward=1
B
gcloud compute instances add-tags [existing-instance] --tags no-ip
C
gcloud builds submit --config=cloudbuild.waml --substitutions=TAG_NAME=no-ip
D
gcloud compute instances create example-instance --network custom-network1 \ --subnet subnet-us-central \ --no-address \ --zone us-central1-a \ --image-family debian-9 \ --image-project debian-cloud \ --tags no-ip
No comments yet.