Virtual Private Cloud (VPC) network overview

A Virtual Private Cloud network, sometimes just called a "network," is a virtual version of a physical network, like a data center network. It provides connectivity for your Compute Engine virtual machine (VM) instances, Kubernetes Engine clusters, App Engine Flex instances, and other resources in your project.

Projects can contain multiple VPC networks. Unless you create an organizational policy that prohibits it, new projects start with a default network that has one subnet in each region (an auto mode network).


VPC networks have the following properties:

  • VPC networks, including their associated routes and firewall rules, are global resources. They are not associated with any particular region or zone.

  • Subnets are regional resources. Each subnet defines a range of IP addresses. For more information about networks and subnets, see networks and subnets.

  • Traffic to and from instances can be controlled with network firewall rules.

  • Resources within a VPC network can communicate with one another using internal (private) IPv4 addresses, subject to applicable network firewall rules. For more information, see communication within the network.

  • Instances with internal IP addresses can communicate with Google APIs and services. For more information, see Private Access Options.

  • Network administration can be secured using Identity and Access Management (IAM) roles.

  • An organization can use Shared VPC to keep a VPC network in a common host project. Authorized IAM members from other projects in the same organization can create resources that use subnets of the Shared VPC network.

  • VPC networks can be connected to other VPC networks in different projects or organizations by using VPC Network Peering.

  • VPC networks can be securely connected in hybrid environments using Cloud VPN or Cloud Interconnect.

  • VPC networks only support IPv4 unicast traffic. They do not support broadcast, multicast, or IPv6 traffic within the network: VMs in the VPC network can only send to IPv4 destinations and only receive traffic from IPv4 sources. It is possible to create an IPv6 address for a global load balancer, however.

Networks and subnets

Each VPC network consists of one or more useful IP range partitions called subnetworks or subnets. Each subnet is associated with a region. By themselves, VPC networks do not have any IP address ranges associated with them. IP ranges are defined for the subnets.

A network must have at least one subnet before you can use it. Auto mode networks create subnets in each region automatically. Custom mode networks start with no subnets, giving you full control over subnet creation. You can create more than one subnet per region. For information about the differences between auto and custom mode networks, see types of VPC networks.

When you create a resource in GCP, you choose a network and subnet. For resources other than instance templates, you also select a zone or a region. Selecting a zone implicitly selects its parent region. Because subnets are regional objects, the region you select for a resource determines the subnets it can use:

  • The process of creating an instance involves selecting a zone, a network, and a subnet. The subnets available for selection are restricted to those in the selected region. GCP assigns the instance an IP address from the range of available addresses in the subnet.

  • The process of creating a managed instance group involves selecting a zone or region, depending on the group type, and an instance template. The instance templates available for selection are restricted to those whose defined subnets are in the same region selected for the managed instance group.

    • Instance templates are global resources. The process of creating an instance template involves selecting a network and a subnet. If you select an auto mode network, you can choose “auto subnet” to defer subnet selection to one that is available in the selected region of any managed instance group that would use the template, because auto mode networks have a subnet in every region by definition.
  • The process of creating a Kubernetes container cluster involves selecting a zone or region (depending on the cluster type), a network, and a subnet. The subnets available for selection are restricted to those in the selected region.

Network and subnet terminology

The terms “subnet” and “subnetwork” are synonymous. They are used interchangeably in the GCP Console, gcloud commands, and API documentation.

Subnet creation mode

GCP offers two types of VPC networks, determined by their subnet creation mode:

  • When an auto mode network is created, one subnet from each region is automatically created within it. These automatically created subnets use a set of predefined IP ranges which fit within the CIDR block. As new GCP regions become available, new subnets in those regions are automatically added to auto mode networks using an IP range from that block. In addition to the automatically created subnets, you can add more subnets manually to auto mode networks, in regions you choose, using IP ranges outside of

  • When a custom mode network is created, no subnets are automatically created. This type of network provides you with complete control over its subnets and IP ranges. You decide which subnets to create, in regions you choose, and using IP ranges you specify.

You can switch a network from auto mode to custom mode. This conversion is one-way; custom mode networks cannot be changed to auto mode networks. Carefully review the considerations for auto mode networks to help you decide which type of network meets your needs.

Default network

Unless you choose to disable it, each new project starts with a default network. The default network is an auto mode network with pre-populated firewall rules.

You can disable the creation of default networks by creating an organization policy with the compute.skipDefaultNetworkCreation constraint. Projects that inherit this policy won't have a default network.

Considerations for auto mode networks

Auto mode networks are easy to set up and use, and they are well suited for use cases with these attributes:

  • Having subnets automatically created in each region is useful.

  • The predefined IP ranges of the subnets do not overlap with IP ranges you would use for different purposes (for example, Cloud VPN connections to on-premises resources).

However, custom mode networks are more flexible and are better suited to production. The following attributes highlight use cases where custom mode networks are recommended or required:

  • Having one subnet automatically created in each region isn't necessary.

  • Having new subnets automatically created as new regions become available could overlap with IP addresses used by manually created subnets or static routes, or could interfere with your overall network planning.

  • You need complete control over the subnets created in your VPC network, including regions and IP address ranges used.

  • You plan to connect VPC networks using VPC Network Peering or Cloud VPN. Because the subnets of every auto mode network use the same predefined range of IP addresses, you cannot connect auto mode networks to one another.

Subnets and IP ranges

When you create a subnet, you must define a primary IP address range. You can optionally define secondary IP address ranges:

  • Primary IP address range: You can choose any private RFC 1918 CIDR block for the primary IP address range of the subnet. These IP addresses can be used for VM primary internal IP addresses, VM alias IP addresses, and the IP addresses of internal load balancers.

  • Secondary IP address ranges: You can define one or more secondary IP address ranges, which are separate RFC 1918 CIDR blocks. These IP address ranges are used only for alias IP addresses. The per network limits describe the maximum number of secondary ranges that you can define for each subnet.

Your subnets don't need to form a predefined contiguous CIDR block, but you can do that if desired. For example, auto mode networks do create subnets that fit within a predefined auto mode IP range.

Refer to working with subnets on the Using VPC Networks page for more details.

Reserved IPs

Every subnet has four reserved IP addresses in its primary IP range. There are no reserved IP addresses in the secondary IP ranges.

Reserved Address Description Example
Network First address in the primary IP range for the subnet in
Default gateway Second address in the primary IP range for the subnet in
Second-to-last address Second-to-last address in the primary IP range for the subnet that is reserved by GCP for potential future use in
Broadcast Last address in the primary IP range for the subnet in

Auto mode IP ranges

This table lists the IP ranges for the automatically created subnets in an auto mode network. IP ranges for these subnets fit inside the CIDR block. Auto mode networks are built with one subnet per region at creation time, and will automatically receive new subnets in new regions. Hence, unused portions of are reserved for future GCP use.

Region IP Range (CIDR) Default Gateway Usable Addresses (Inclusive)
asia-east1 to
asia-east2 to
asia-northeast1 to
asia-northeast2 to
asia-south1 to
asia-southeast1 to
australia-southeast1 to
europe-north1 to
europe-west1 to
europe-west2 to
europe-west3 to
europe-west4 to
europe-west6 to
northamerica-northeast1 to
southamerica-east1 to
us-central1 to
us-east1 to
us-east4 to
us-west1 to
us-west2 to

Routes and firewall rules


Routes define paths for packets leaving instances (egress traffic). Routes in GCP are divided into two categories: system-generated and custom. This section briefly describes the two types of system generated routes. You can create custom routes in your network as well. See the routes overview for complete details about routing in GCP.

Every new network starts with two types of system-generated routes:

  • The default route defines a path for traffic to leave the VPC network. It provides general Internet access to VMs that meet the Internet access requirements. It also provides the typical path for Private Google Access.

  • A subnet route is created for each of the IP ranges associated with a subnet. Every subnet has at least one subnet route for its primary IP range, and additional subnet routes are created for a subnet if you add secondary IP ranges to it. Subnet routes define paths for traffic to reach VMs that use the subnets.

Dynamic routing mode

Each VPC network has an associated dynamic routing mode that controls the behavior of all of its Cloud Routers. Cloud Routers share routes to your VPC network and learn custom dynamic routes from connected networks when you connect your VPC network to another network with a Cloud VPN tunnel using dynamic routing, Dedicated Interconnect, or Partner Interconnect.

  • Regional dynamic routing is the default. In this mode, routes to on-premises resources learned by a given Cloud Router in the VPC network only apply to the subnets in the same region as the Cloud Router. Unless modified by custom advertisements, each Cloud Router only shares the routes to subnets in its region with its on-premises counterpart.

  • Global dynamic routing changes the behavior of all Cloud Routers in the network such that the routes to on-premises resources that they learn are available in all of subnets in the VPC network, regardless of region. Unless modified by custom advertisements, each Cloud Router shares routes to all subnets in the VPC network with its on-premises counterpart.

See custom advertisements for information about how the set of routes shared by a Cloud Router can be customized.

The dynamic routing mode can be set when you create a VPC network or modify it. You can change the dynamic routing mode from regional to global and vice-versa without restriction. Refer to using VPC networks for instructions.

Firewall rules

Firewall rules apply to both outgoing (egress) and incoming (ingress) traffic in the network. Firewall rules control traffic even if it is entirely within the network, including communication among VM instances.

Every VPC network has two implied firewall rules. One implied rule allows most egress traffic, and the other denies all ingress traffic. You cannot delete the implied rules, but you can override them with your own. GCP always blocks some traffic, regardless of firewall rules. For more information, see blocked traffic.

See the firewall rules overview for more information.

You can monitor which firewall rule allowed or denied a particular connection. See Firewall Rules Logging for more information.

Communications and access

Communication within the network

The system-generated subnet routes define the paths for sending traffic among instances within the network using internal (private) IP addresses. For one instance to be able to communicate with another, appropriate firewall rules must also be configured because every network has an implied deny firewall rule for ingress traffic.

Except for the default network, you must explicitly create higher priority ingress firewall rules to allow instances to communicate with one another. The default network includes a number of firewall rules in addition to the implied ones, including the default-allow-internal rule, which permits instance-to-instance communication within the network. The default network also comes with ingress rules allowing protocols like RDP and SSH.

Rules that come with the default network are also presented as options for you to apply to new auto mode networks that you create using the GCP Console.

Internet access requirements

The following criteria must be satisfied for an instance to have outgoing Internet access:

  • The network must have a valid default Internet gateway route or custom route whose destination IP range is the most general ( This route simply defines the path to the Internet. See Routes for more information about routes.

  • Firewall rules must allow egress traffic from the instance. Unless overridden by a higher priority rule, the implied allow rule for egress traffic permits outbound traffic from all instances.

  • One of the following must be true:

    • The instance must have an external IP address. An external IP can be assigned to an instance when it is created or after it has been created.

    • The instance must be able to use Cloud NAT or an instance-based proxy that is the target for a static route.

Communications and access for App Engine

VPC firewall rules apply to resources running in the VPC network, such as Compute Engine VMs. For App Engine instances, firewall rules work as follows:

  • App Engine Standard: Only App Engine firewall rules apply to ingress traffic. Since App Engine Standard instances do not run inside your VPC network, VPC firewall rules do not apply to them.

  • App Engine Flexible (Flex): Both App Engine and VPC firewall rules apply to ingress traffic. Inbound traffic is only permitted if it is allowed by both types of firewall rule. For outbound traffic, VPC firewall rules apply.

For more information about App Engine Firewall rules, refer to the rules for Standard or Flex.

For more information about how to control access to App Engine instances, refer to Application security.

VPC network example

The following example illustrates custom mode network with three subnets in two regions:

VPC network example (click to enlarge)
VPC network example (click to enlarge)
  • Subnet1 is defined as in the us-west1 region.
    • Two VM instances in the us-west1-a zone are in this subnet. Their IP addresses both come from the available range of addresses in subnet1.
  • Subnet2 is defined as in the us-east1 region.
    • Two VM instances in the us-east1-a zone are in this subnet. Their IP addresses both come from the available range of addresses in subnet2.
  • Subnet3 is defined as, also in the us-east1 region.
    • One VM instance in the us-east1-a zone and a second instance in the us-east1-b zone are in subnet3, each receiving an IP addresses from its available range. Because subnets are regional resources, instances can have their network interfaces associated with any subnet in the same region that contains their zones.

What's next

  • See Using VPC for instructions on creating and modifying VPC networks.
क्या यह पेज उपयोगी था? हमारे काम के बारे में अपनी राय दें:

निम्न के बारे में फ़ीडबैक भेजें...