Question

Difficulty: MediumManaging Networking Resources

An administrator notices that virtual machine instances in a private subnet are dropping outbound internet connections during peak traffic hours due to Cloud NAT port exhaustion. A second static regional IP address named `nat-ip-2` has already been allocated in region `us-central1`. The administrator must add `nat-ip-2` to the active Cloud NAT gateway `prod-nat` attached to Cloud Router `prod-router` in region `us-central1` without removing the existing assigned static IP `nat-ip-1`. Which `gcloud` command should the administrator execute?

  1. gcloud compute routers nats update prod-nat --router=prod-router --region=us-central1 --nat-external-ip-pool=nat-ip-1,nat-ip-2Answer
  2. B
    gcloud compute routers nats update prod-nat --router=prod-router --region=us-central1 --nat-external-ip-pool=nat-ip-2
  3. C
    gcloud compute nats update prod-nat --router=prod-router --region=us-central1 --nat-external-ip-pool=nat-ip-1,nat-ip-2
  4. D
    gcloud compute routers nats update prod-nat --router=prod-router --zone=us-central1-a --nat-external-ip-pool=nat-ip-1,nat-ip-2

Answer

Execute `gcloud compute routers nats update prod-nat --router=prod-router --region=us-central1 --nat-external-ip-pool=nat-ip-1,nat-ip-2` to include both static external IPs in the Cloud NAT pool.
Updating a Cloud NAT gateway's manually assigned external IP pool requires invoking `gcloud compute routers nats update` with the `--region` flag and listing all IP addresses intended for the pool in a comma-separated format under `--nat-external-ip-pool`.

Step-by-Step Solution

1
Identify the resource scope and command structure for Cloud NAT management in gcloud.
Cloud NAT configurations are managed under Cloud Routers using `gcloud compute routers nats`.
Cloud NAT is non-zonal regional infrastructure defined within a Cloud Router.
2
Determine how static IP allocation updates operate for Cloud NAT external IP pools.
The `--nat-external-ip-pool` flag expects a complete list of all active IP resources assigned to the gateway.
Passing only new IP addresses overwrites the existing pool rather than appending to it.
3
Select the command that specifies the regional flag along with the full comma-separated list of IP addresses.
The command containing `--region=us-central1` and `--nat-external-ip-pool=nat-ip-1,nat-ip-2` correctly modifies the configuration.
This updates the pool without dropping existing connections or raising scope parameter errors.

Key Concept

Cloud NAT Configuration and IP Pool Management
Estimated Time:1m 30s
Rate this question