Soru

Zorluk: ZorManaging Networking Resources

A Cloud Operations engineer is managing Virtual Private Cloud (VPC) networking resources in Google Cloud. The engineer needs to route all outbound traffic destined for a third-party vendor's network range 198.51.100.0/24198.51.100.0/24 through an existing custom gateway Virtual Machine instance named `gateway-instance-1` located in zone `us-east1-b`. The target VPC network is named `enterprise-vpc`. Which `gcloud` command should the engineer execute to correctly configure this routing resource?

  1. gcloud compute routes create vendor-route --network=enterprise-vpc --destination-range=198.51.100.0/24 --next-hop-instance=gateway-instance-1 --next-hop-instance-zone=us-east1-bCevap
  2. B
    gcloud compute routes create vendor-route --vpc=enterprise-vpc --destination-cidr=198.51.100.0/24 --next-hop-vm=gateway-instance-1 --region=us-east1
  3. C
    gcloud compute firewall-rules create vendor-route --network=enterprise-vpc --direction=EGRESS --action=ALLOW --destination-ranges=198.51.100.0/24 --priority=1
  4. D
    gcloud compute networks subnets update enterprise-vpc --add-secondary-ranges=vendor-route=198.51.100.0/24 --next-hop-instance=gateway-instance-1

Cevap

Execute the command `gcloud compute routes create vendor-route --network=enterprise-vpc --destination-range=198.51.100.0/24 --next-hop-instance=gateway-instance-1 --next-hop-instance-zone=us-east1-b` to create a custom static route in the VPC network targeting the gateway instance.
Creating a static route via `gcloud compute routes create` with `--destination-range`, `--network`, `--next-hop-instance`, and `--next-hop-instance-zone` correctly directs packets targeting 198.51.100.0/24198.51.100.0/24 to the specified VM instance in the target VPC network.

Adım Adım Çözüm

1
Identify the resource type to manage
Custom traffic steering requires creating a VPC route resource using `gcloud compute routes create`.
Firewall rules or subnet configurations cannot forward traffic to a next-hop Compute Engine instance.
2
Determine the required command flags
Specify `--network=enterprise-vpc`, `--destination-range=198.51.100.0/24`, `--next-hop-instance=gateway-instance-1`, and `--next-hop-instance-zone=us-east1-b`.
The gcloud CLI requires exact parameter names for custom route definition and instance scope specification.
3
Validate the command structure against gcloud CLI standards
The correct command syntax uses valid flags `--destination-range` and `--next-hop-instance` with its corresponding `--next-hop-instance-zone`.
Using improper flag aliases like `--vpc` or `--destination-cidr` causes command invocation failures.

Anahtar Kavram

Managing Custom VPC Routes with gcloud CLI
Tahmini Süre:2m 0s
Bu soruyu puanla