Medium1 markMultiple Choice

GCP ACE · Question 39 · Domain 4.5: Managing networking resources

You have a custom VPC with a subnet in the us-east1 region using the CIDR block 10.0.0.0/24. You have run out of IP addresses in this subnet and need to expand it to accommodate more VMs. You want to do this without recreating the subnet or disrupting existing VMs.

Which command should you use?

Answer options:

A.

gcloud compute networks subnets update [SUBNET_NAME] --add-secondary-range=10.0.1.0/24

B.

gcloud compute networks subnets expand-ip-range [SUBNET_NAME] --prefix-length=20

C.

gcloud compute networks subnets expand-ip-range [SUBNET_NAME] --prefix-length=28

D.

You cannot expand a subnet. You must create a new one and migrate the VMs.

How to approach this question

Understand that GCP allows dynamic subnet expansion and remember how CIDR notation works (smaller number = more IPs).

Full Answer

B.gcloud compute networks subnets expand-ip-range [SUBNET_NAME] --prefix-length=20✓ Correct
Google Cloud allows you to expand the IP range of an existing subnet without downtime. You use the `expand-ip-range` command. In CIDR notation, a smaller prefix length means a larger network. Therefore, changing from /24 (256 IPs) to /20 (4096 IPs) expands the network.

Common mistakes

Choosing /28 thinking a larger number means more IPs. In CIDR, the number represents the network bits; fewer network bits mean more host bits (more IPs).

Practice the full GCP Associate Cloud Engineer Practice Exam 7

50 questions · hints · full answers · grading

More questions from this exam