Soru

Zorluk: ZorManaging Networking Resources

A Cloud Operations engineer is managing networking resources in a Google Cloud project. An existing Cloud NAT gateway named `prod-nat` is deployed on Cloud Router `prod-router` in region `us-central1` to provide internet access for selected subnets within the `prod-vpc` network. The Cloud NAT gateway is currently configured with manual subnet mapping (`--nat-custom-subnet-option=LIST_OF_SUBNETWORKS`). A new subnet named `analytics-subnet` has been created in `us-central1`. The engineer needs to update `prod-nat` to enable Outbound NAT for the primary IP range of `analytics-subnet` while preserving the NAT configuration for all existing subnets. Which `gcloud` command should the engineer execute to achieve this?

  1. Execute `gcloud compute routers nats update prod-nat --router=prod-router --region=us-central1 --add-subnetworks=analytics-subnet`Cevap
  2. B
    Execute `gcloud compute routers nats update prod-nat --router=prod-router --region=us-central1 --nat-custom-subnet-option=analytics-subnet`
  3. C
    Execute `gcloud compute nats update prod-nat --router=prod-router --region=us-central1 --subnetworks=analytics-subnet`
  4. D
    Execute `gcloud compute networks subnets update analytics-subnet --region=us-central1 --enable-cloud-nat=prod-nat`

Cevap

The correct action is to execute `gcloud compute routers nats update prod-nat --router=prod-router --region=us-central1 --add-subnetworks=analytics-subnet`.
Updating an existing Cloud NAT configuration to include an additional subnet while keeping existing mappings intact requires using `gcloud compute routers nats update` with the `--add-subnetworks` flag. This correctly appends the primary IP range of the specified subnet to the Cloud NAT configuration.

Adım Adım Çözüm

1
Identify the correct gcloud CLI resource path for Cloud NAT operations
Cloud NAT configurations are sub-resources of Cloud Routers, so commands use `gcloud compute routers nats`.
Cloud NAT operates on top of Cloud Router instances in Google Cloud.
2
Select the appropriate flag for appending a subnet to an existing LIST_OF_SUBNETWORKS configuration
The `--add-subnetworks` flag appends specified subnets to the existing Cloud NAT gateway configuration.
Using `--subnetworks` would overwrite the entire existing subnet list, whereas `--add-subnetworks` appends the new subnet safely.
3
Construct and verify the complete gcloud command
The resulting command includes the NAT name (`prod-nat`), Cloud Router name (`--router=prod-router`), region (`--region=us-central1`), and the target subnet (`--add-subnetworks=analytics-subnet`).
All required scoping flags and modification parameters are correctly supplied.

Anahtar Kavram

Cloud NAT Subnet Mapping Management
Tahmini Süre:2m 0s
Bu soruyu puanla