Prepare and test your skills

Prepare and test your skills

IP address management and network modes determine how IP space is divided and controlled inside a Virtual Private Cloud (VPC) network (opens in a new tab). A VPC network is a global virtual network that contains regional subnets, and each subnet holds a block of IP addresses for resources in that region. The network mode controls whether Google Cloud creates those subnets automatically or whether you create and size each subnet yourself.
Auto mode and custom mode VPC networks are the two modes that control subnet creation and address control. An auto mode network sets auto_create_subnetworks to true, so Google Cloud automatically creates one subnet in each region with a predefined IPv4 range. A custom mode network sets auto_create_subnetworks to false, so no subnets are created automatically and you define the name, region, and CIDR range for each subnet. You cannot create virtual machine instances in a region that has no subnet, so custom mode requires you to plan coverage region by region.
| Network mode | Subnet creation | Control and use |
|---|---|---|
| Auto mode | Google Cloud creates one subnet per region automatically | Simple to start with less control over ranges; can be converted to custom mode later |
| Custom mode | You create each subnet manually in chosen regions | Full control over region coverage and CIDR sizing; used for production and custom address planning |
An auto mode network can be converted to custom mode, and conversion preserves all existing subnets with their names and ranges unchanged. Conversion is one-way, and a converted network then operates exactly like a network that was created in custom mode. After conversion, tools must reference the subnet explicitly, including the --subnet flag in gcloud commands.
Planning valid CIDR ranges is the process of choosing a primary IPv4 block in CIDR notation that fits inside the VPC network without overlapping another subnet. A new subnet allocation requires three related choices that together place address space in the network:
10.0.1.0/24, 10.0.0.0/24, or 192.168.200.0/24.The primary range and any optional secondary ranges must not overlap with existing primary or secondary ranges in the same network. Private RFC 1918 addresses are preferred for internal use, and any non-RFC 1918 range must be checked so it does not conflict with an existing on-premises or cloud configuration. Secondary IPv4 ranges can be added at creation or later for uses such as container pods and services, but they follow the same non-overlapping rule.
Adding a subnet to an existing VPC network is the act of reserving a new regional address block inside that network for future resources. The new subnet depends on the parent network for routing, firewall policy, and global connectivity, while instances in a region depend on a subnet in that same region to obtain internal IP addresses. Each subnet in the network can have a different configuration, and an IPv4-only subnet can later be changed to dual-stack.
Exam tip: Choose custom mode when you need to control regions and CIDR ranges, and remember that auto-to-custom conversion is one-way and keeps existing subnets unchanged.
Implementation methods and resource validation describe how to add a new subnet to an existing Virtual Private Cloud (VPC) (opens in a new tab) network and confirm that the subnet is usable. A VPC network is a global resource that holds routes and firewall rules, while each subnet is a regional resource that defines IP address ranges. Adding a subnet expands the VPC without changing its architecture, but the new subnet must be explicitly linked to the target VPC and placed in a specific region.
The VPC and subnet relationship defines how a new subnet attaches to an existing network. A VPC network and its subnets are different resource types, so creating a subnet requires selecting the parent VPC network by name. Because subnets are regional resources, the region chosen for the subnet controls which zonal resources, such as virtual machine (VM) instances, can use it. A resource in a zone can only use a subnet whose parent region contains that zone.
Adding a subnet in the Google Cloud console uses the VPC networks page to attach a new regional IP range to a selected VPC network. The console flow moves from the existing network to the new subnet definition in order, and the selected network becomes the parent of the subnet.
The console requires the Compute Network Admin role (roles/compute.networkAdmin) to create the subnet. The primary IPv4 range must be a valid range that does not overlap other ranges in the VPC.
Adding a subnet with the gcloud command-line interface (CLI) uses one subnets create command that links the subnet to the target VPC through the --network flag. The command creates a regional subnet resource under the global VPC network, so traffic and IP allocation flow from the VPC network to the new subnet.
gcloud compute networks subnets create SUBNET_NAME \
--network=NETWORK_NAME \
--range=IP_RANGE \
--region=REGION \
--resolve-subnet-mask=ARP_RANGES
The command depends on values on both sides of the association between the new subnet and its parent network:
SUBNET_NAME: a name for the new subnet being created.NETWORK_NAME: the existing VPC network that will contain the subnet.IP_RANGE: the primary IPv4 address range for the subnet in CIDR notation, for example 10.1.2.0/24.REGION: the region for the subnet, which determines which zones can use it.ARP_RANGES: which ranges receive ARP replies, either ARP_PRIMARY_RANGE or ARP_ALL_RANGES.Validating the new subnet resource confirms that the subnet exists in the correct VPC and can host workloads. Validation creates a Compute Engine VM instance that is connected to the subnet, which proves that the region, network link, and IP range are correct. The instance must be created in a zone whose parent region matches the subnet region, and the instance creation depends on the subnet name.
gcloud compute instances create INSTANCE_NAME \
--zone=ZONE \
--subnet=SUBNET_NAME
After the instance starts, verification checks that the DHCP server configures the correct netmask on the instance and that the instance receives ARP replies from the expected ranges. If the instance cannot be created or networking does not match, the subnet region, VPC association, or IP range must be corrected before use.
Exam tip: A subnet is not the same as a network — proper association requires selecting the target VPC in the console or passing its name in --network with gcloud, plus a region for the subnet.
Regional configuration and subnet features describe where a subnet lives and which options are set when the subnet is added to an existing network. A Virtual Private Cloud (VPC) (opens in a new tab) network holds subnets, while each subnet operates in one region with its own address range and optional settings. Understanding this split lets you expand a network region by region without changing the existing subnets.
A subnet to region relationship means each subnet is a regional resource that belongs to one VPC network and to one Google Cloud region. The VPC network itself can span multiple regions, but traffic for resources such as virtual machine instances depends on a subnet in the same region where the resources will run. You do not have to create subnets in every region at once, but you cannot create instances in a region that has no subnet defined for that network. For example, one network can contain subnet-1-us in us-central1 with 10.0.0.0/24 and subnet-2-sg in asia-southeast1 with 192.168.200.0/24, and each subnet keeps its own name, region, and range.
Required configuration for a new subnet consists of a name, a region, and at least a primary IPv4 address range for every new IPv4-only subnet. The subnet depends on the existing VPC network, so the creation request must identify both the network that will contain the subnet and the region that will contain its addresses. In the Google Cloud console, adding a subnet to an existing VPC network follows this order:
The same relationship appears in the command line, where data flows from the command to the Compute Engine control plane with the network, range, and region identified: gcloud compute networks subnets create SUBNET --network=NETWORK --range=PRIMARY_RANGE --region=REGION.
Optional subnet features are extra address space and per-subnet behaviors that can be set at creation time or later by editing the subnet. The subnet keeps its name, region, and primary range while these options change, so expansion does not require recreating the subnet.
Because Private Google Access and VPC Flow Logs apply to the subnet, the choice applies only to resources that use that subnet in that region. Each subnet in the same VPC network can have a different configuration.
Exam tip: You cannot place an instance in a region with no subnet, and Private Google Access and VPC Flow Logs do not require recreating the subnet because both can be enabled at creation or later by editing.
--network=NETWORK_NAME along with --range and --region.Auto mode Virtual Private Cloud (VPC) networks automatically create one subnet in each region with a predefined IPv4 range, while custom mode networks require you to create each subnet manually with its own name, region, and CIDR range. An auto mode network can be converted to custom mode one-way, which preserves all existing subnets with their names and ranges unchanged.
Adding a subnet to an existing Virtual Private Cloud (VPC) network requires a unique subnet name, a region where addresses will be reserved, and a primary IPv4 range in CIDR notation that does not overlap any existing primary or secondary range in the same network. The subnet must be linked to its parent VPC network, and a resource in a zone can only use a subnet whose parent region contains that zone.
Yes, Private Google Access and Virtual Private Cloud (VPC) Flow Logs are per-subnet settings that can be enabled when the subnet is created or later by editing the subnet. Each subnet in the same network can have a different configuration, so the choice applies only to resources that use that subnet in that region.
An organization operates an existing auto mode Virtual Private Cloud (VPC) network. A cloud engineer needs to manually add a new subnet to this network in the us-central1 region to host a dedicated internal testing service.
The engineer must select a valid primary IPv4 CIDR range that does not overlap with any existing subnets or the predefined IP block allocated for auto mode networks.
Which CIDR range should the engineer assign to the new subnet?
10.10.0.0/24
10.170.0.0/24
169.254.10.0/24
10.128.0.0/20
Last updated