Soru

Zorluk: OrtaManaging Networking Resources

A network administrator needs to route all outbound internet traffic from a private subnet through a custom network virtual appliance (NVA) instance named 'nva-gateway' located in zone 'us-central1-a'. The route must be named 'route-outbound-nva', reside in the custom VPC network 'prod-vpc', target destination '0.0.0.0/0', and have a priority of 800. Which gcloud command should the administrator run to implement this custom route?

  1. gcloud compute routes create route-outbound-nva --network=prod-vpc --destination-range=0.0.0.0/0 --next-hop-instance=nva-gateway --next-hop-instance-zone=us-central1-a --priority=800Cevap
  2. B
    gcloud compute routes create route-outbound-nva --network=prod-vpc --destination=0.0.0.0/0 --next-hop-vm=nva-gateway --zone=us-central1-a --priority=800
  3. C
    gcloud compute networks subnets update prod-vpc --add-route=0.0.0.0/0 --next-hop-instance=nva-gateway --priority=800
  4. D
    gcloud compute firewall-rules create route-outbound-nva --network=prod-vpc --destination-ranges=0.0.0.0/0 --action=route --next-hop-instance=nva-gateway

Cevap

The administrator should run 'gcloud compute routes create route-outbound-nva --network=prod-vpc --destination-range=0.0.0.0/0 --next-hop-instance=nva-gateway --next-hop-instance-zone=us-central1-a --priority=800'.
The correct answer specifies the proper gcloud command 'gcloud compute routes create' along with the required parameters '--network', '--destination-range', '--next-hop-instance', '--next-hop-instance-zone', and '--priority'.

Adım Adım Çözüm

1
Identify the required Google Cloud resource type for custom routing.
Routing decisions in VPC networks require a custom route resource under 'gcloud compute routes'.
Firewall rules and subnet updates do not define traffic next-hops.
2
Determine the mandatory CLI flags for creating a custom route to an instance.
The command requires '--destination-range', '--next-hop-instance', and '--next-hop-instance-zone' alongside the network name.
Compute Engine needs the zone of the target NVA instance to resolve the next hop correctly.
3
Construct the exact gcloud CLI command.
'gcloud compute routes create route-outbound-nva --network=prod-vpc --destination-range=0.0.0.0/0 --next-hop-instance=nva-gateway --next-hop-instance-zone=us-central1-a --priority=800'
This matches all specifications and syntax rules for Google Cloud CLI.

Anahtar Kavram

Creating and managing custom static routes in Google Cloud VPC networks using gcloud CLI
Tahmini Süre:1m 30s
Bu soruyu puanla