An organization maintains two Virtual Private Cloud (VPC) networks in Google Cloud: a central network named `hub-vpc` and a workload network named `spoke-vpc`. The two networks are connected using VPC Network Peering via a peering connection named `peering-hub-to-spoke` created on `hub-vpc`. The workload team recently added custom static routes in `spoke-vpc` and enabled custom route exporting on their peering end. However, virtual machines in `hub-vpc` cannot route traffic to those custom destinations because `hub-vpc` is not receiving the advertised routes. Which `gcloud` command should the cloud engineer execute to configure `hub-vpc` to receive the exported custom routes from `spoke-vpc`?
- gcloud compute networks peerings update peering-hub-to-spoke --network=hub-vpc --import-custom-routesCevap
- Bgcloud compute networks peerings update peering-hub-to-spoke --network=hub-vpc --export-custom-routes
- Cgcloud compute routes create peering-route --network=hub-vpc --next-hop-peering=peering-hub-to-spoke
- Dgcloud compute networks update hub-vpc --peering-route-exchange=enable-import
Cevap
The correct action is to execute `gcloud compute networks peerings update peering-hub-to-spoke --network=hub-vpc --import-custom-routes`.
In Google Cloud VPC Network Peering, custom route exchange is bi-directional but independently controlled. For `hub-vpc` to receive custom routes from `spoke-vpc`, the peering connection on `spoke-vpc` must have custom route exporting enabled, and the peering connection on `hub-vpc` (`peering-hub-to-spoke`) must have custom route importing enabled via `gcloud compute networks peerings update peering-hub-to-spoke --network=hub-vpc --import-custom-routes`.
Adım Adım Çözüm
Anahtar Kavram
VPC Network Peering Custom Route Exchange