Question

Difficulty: MediumPlanning Virtual Private Cloud (VPC) Networks and Subnets

A cloud engineering team needs to expand the primary IP range of a subnet within an auto-mode Virtual Private Cloud (VPC) network in Google Cloud to accommodate new Compute Engine instances without disrupting existing network traffic. Place the steps required to safely convert the network mode and expand the subnet IP range into the correct sequential order.

  1. 1Audit existing network routes and verify that the target expanded CIDR range will not overlap with on-premises or peered networks.
  2. 2Execute `gcloud compute networks update [VPC_NAME] --switch-to-custom-mode` to convert the VPC network from auto mode to custom mode.
  3. 3Execute `gcloud compute networks subnets expand-ip-range [SUBNET_NAME] --prefix-length [NEW_PREFIX]` to expand the primary IP range.
  4. 4Verify the expanded subnet configuration using `gcloud compute networks subnets describe` and launch new instances into the expanded address space.

Answer

The correct order begins with verifying that the target expanded CIDR range will not cause IP address overlap, followed by switching the VPC network from auto mode to custom mode using the gcloud compute networks update command. Next, expand the primary subnet range using gcloud compute networks subnets expand-ip-range, and finally verify the updated configuration and deploy workloads into the expanded subnet space.
Expanding a subnet primary IP range in Google Cloud requires IP planning first to avoid collisions, followed by converting an auto-mode VPC to custom mode, executing the gcloud expand-ip-range command, and finally verifying the change before deploying workloads.

Step-by-Step Solution

1
Perform IP range planning and overlap checks.
Ensures the prospective enlarged CIDR block does not collide with connected VPN/Interconnect routes or other VPC subnets.
Expanding a subnet into an already routed or overlapping CIDR range breaks routing and network communication.
2
Switch the VPC network mode from auto to custom.
The VPC network transition completes, enabling custom subnet management capabilities.
Google Cloud auto-mode VPC networks have predefined /20 subnets per region that cannot be manually expanded until switched to custom mode.
3
Expand the primary IP range of the target subnet.
The subnet's netmask is broadened (e.g., from /24 to /23), making more IP addresses available.
Subnet expansion can only increase the primary range (reduce prefix length) and must be contiguous with the current starting IP address.
4
Validate the expanded subnet and provision resources.
New Compute Engine instances are successfully assigned IP addresses from the newly expanded range.
Verifying status ensures the operation finished cleanly before launching new production workloads.

Key Concept

Auto-mode to custom-mode VPC conversion and primary IPv4 subnet expansion
Rate this question