A cloud engineer needs to update an existing custom Virtual Private Cloud (VPC) network configuration in Google Cloud. The environment currently has a subnet `prod-subnet-uscentral1` with the primary IP range `10.1.0.0/24`. Due to rapid growth, the team needs to expand the primary IP address range of this existing subnetwork to `10.1.0.0/22` using the `gcloud` CLI without recreating the subnet or disrupting existing resources. Which of the following conditions and actions are required to successfully perform this subnet expansion? (Select TWO.)
- The new CIDR prefix length must be smaller than or equal to the existing prefix length (for example, expanding /24 to /22).Cevap
- BExecute `gcloud compute networks subnets update prod-subnet-uscentral1 --region=us-central1 --prefix-length=22` to update the primary IP block.
- Execute `gcloud compute networks subnets expand-ip-range prod-subnet-uscentral1 --region=us-central1 --ip-cidr-range=10.1.0.0/22` to increase the primary range.Cevap
- DThe existing IP address range can be shrunk or modified to a non-overlapping base IP block such as `172.16.0.0/22` directly via the expand command.
Cevap
Expanding an existing Google Cloud VPC subnet primary range requires that the new netmask prefix length be smaller than or equal to the current range (such as expanding from /24 to /22), and it is executed using the command `gcloud compute networks subnets expand-ip-range prod-subnet-uscentral1 --region=us-central1 --ip-cidr-range=10.1.0.0/22`.
To expand an existing VPC subnet's primary IP range without recreating it, Google Cloud requires that the new prefix length be smaller (allocating a larger block of IP addresses, such as moving from /24 to /22). The correct CLI tool procedure is invoking `gcloud compute networks subnets expand-ip-range` specifying the subnet name, `--region`, and the expanded `--ip-cidr-range`.
Adım Adım Çözüm
Anahtar Kavram
VPC Subnet IP Range Expansion via gcloud CLI
Tahmini Süre:1m 30s