An operations engineer needs to update an existing Cloud NAT gateway named `nat-gateway` managed by Cloud Router `router-central` in the `us-central1` region. The gateway must be updated to use a newly provisioned static regional external IP address named `nat-static-ip` instead of automatically allocated IPs, and detailed logging for all translation connections must be enabled. Which TWO commands should the engineer run to accomplish this setup?
- gcloud compute addresses create nat-static-ip --region=us-central1Cevap
- gcloud compute routers nats update nat-gateway --router=router-central --region=us-central1 --nat-external-ip-pool=nat-static-ip --enable-logging --log-filter=ALLCevap
- Cgcloud compute addresses create nat-static-ip --global
- Dgcloud compute routers nats update nat-gateway --router=router-central --region=us-central1 --auto-allocate-nat-external-ips --enable-logging
Cevap
The engineer must create a regional static external IP address using `gcloud compute addresses create nat-static-ip --region=us-central1` and update the NAT configuration using `gcloud compute routers nats update nat-gateway --router=router-central --region=us-central1 --nat-external-ip-pool=nat-static-ip --enable-logging --log-filter=ALL`.
To assign a specific static IP to a Cloud NAT gateway, a regional external IP address must first be created in the matching region (`us-central1`). Next, the Cloud NAT gateway configuration on the Cloud Router must be updated using `--nat-external-ip-pool` to bind the IP address, alongside `--enable-logging` and `--log-filter=ALL` to capture translation logs.
Adım Adım Çözüm
Anahtar Kavram
Cloud NAT configuration and static IP allocation using gcloud CLI