Prepare and test your skills
Prepare and test your skills
Shared VPC (opens in a new tab) is a centralized network model where one host project owns Shared VPC networks and multiple service projects attach to use them. Instances and load balancer backends live in the service projects, but their internal IP addresses come from subnets in the host project. Traffic flows between service projects over internal IP addresses, while central teams retain ownership of subnets, routes, and firewall rules and workload teams own only resources in their own service projects.
The host and service project model defines where network ownership sits and where workload ownership sits. A Shared VPC Admin must first enable a project as a host project and then attach each service project to that host project. A project cannot be both a host project and a service project at the same time, and each service project can attach to only one host project, while an organization can operate multiple host projects.
Host and service projects must belong to the same organization, except temporarily during project migration between organizations. Linked projects can sit in the same or different folders, but when folders differ the Shared VPC Admin must hold Shared VPC Admin rights to both folders. A standalone project that is neither a host nor a service project does not use Shared VPC, and networks defined inside a service project itself are never shared.
Exam tip: A service project attaches to only one host project, and a project cannot be a host and a service at the same time — use multiple host projects when you need stronger isolation.
Administrative role separation enforces least privilege by splitting network control from workload control. The Shared VPC Admin controls host enablement and service project attachment, then delegates network work to Network Admins and Security Admins and workload work to Service Project Admins. Network Admins create and manage shared network objects such as Cloud VPN gateways, Cloud Routers, and subnets, while Security Admins create and manage firewall rules in the Shared VPC network.
Establishing the trust boundary follows an ordered delegation where each step depends on the prior grant:
A Service Project Admin for one service project has no permissions in another service project by default, which isolates cross-functional teams. For example, Tier 1 web admins manage only the Tier 1 service project and Tier 2 service admins manage only the Tier 2 service project, while oversight admins hold rights in both service projects.
Subnet-level access control limits which shared subnets a Service Project Admin can consume for new workloads. A grant at the subnet level permits instance creation only in named subnets, such as 10.0.1.0/24 in us-west1 or 10.15.2.0/24 in us-east1, and the instance zone must sit in the same region as the selected subnet. A grant at the project level permits instance creation in any subnet in any Virtual Private Cloud (VPC) network in the host project. In both cases the instance receives its primary internal IPv4 address from the free range of the selected shared subnet, and internal communication between service projects remains subject to host firewall rules.
The choice of grant scope controls isolation versus flexibility:
| Access scope | Permitted subnets | Choose when |
|---|---|---|
| Subnet-level grant | Only explicitly authorized subnets | The team must be confined to one tier, environment, or region |
| Project-level grant | Any subnet in any VPC network in the host project | A central or oversight team must place workloads across the whole shared network |
IP ownership is split between value and object for static addresses. Ephemeral addresses are automatically assigned from the shared subnet range when the instance or internal load balancer forwarding rule is created. Static internal addresses also take their value from the shared subnet range, but the address object must be reserved in the same service project as the resource that uses it. Use of Shared VPC is not mandatory, and existing resources do not migrate automatically, so an existing instance cannot be reconfigured to use a Shared VPC network and the Service Project Admin must create a new eligible resource that selects the shared subnet.
Secure Shared VPC topologies centralize policy while isolating environments by host project. A single host project with a single Shared VPC network and multiple service projects is the simplest pattern for teams with common requirements, because firewall, routing, and subnet policy apply consistently to all attached teams. Multiple host projects isolate stronger boundaries, such as a Test Environment host with testing service projects separate from a Production Environment host with production service projects, which supports audit needs such as PCI, separate quota pools, and separate administration policies.
Choose the host count by operational constraints described in the best practices for VPC design (opens in a new tab). Use a single host project when workloads require multiple network interfaces that must attach to shared networks, because that attachment depends on one host. Use multiple host projects when resource needs exceed the quota or scaling limits of a single project or when each VPC needs independent IAM administration. A shared-services VPC can host common proxies, authentication, and directory services to avoid replicating them into every isolated host.
Hybrid connectivity extends the same centralized boundary to on-premises networks. The Network Admin creates a Cloud VPN gateway in the host project and a Cloud Router in the same region to exchange routes with the on-premises gateway, and traffic flows from service project instances through the host VPN gateway to on-premises services. If the VPC dynamic routing mode is global, the Cloud Router applies learned on-premises routes to all subnets in the VPC and advertises all VPC subnet routes on-premises. Security Admins control that flow with host firewall rules, so service instances can reach internal database or directory servers only when firewall rules permit, and outbound VPN billing is attributed to the host project that contains the gateway while other instance egress is attributed to its service project.
VPC Network Peering (opens in a new tab) is a direct, bilateral connection between two Virtual Private Cloud (VPC) networks that exchanges subnet routes and selected custom routes without merging firewall or identity boundaries. Each peering relationship has an exporting side that offers routes and an importing side that accepts them, and each VPC network retains its own firewall rules, IAM controls, and routing table. Route governance decides which prefixes cross that boundary and where they become usable.
VPC Network Peering non-transitivity means traffic flows only between the two directly peered VPC networks and never forwards through one peer to reach a third network. If network A is peered to network B, and network B is peered to network C or to an on-premises network, hosts in network A cannot reach network C through network B. This boundary holds even when Export custom routes is enabled on the middle network, so enabling export does not create transit.
The non-transitive boundary creates two operational consequences for return traffic. Traffic sent from a service-producer network, such as Agent Platform over Private Services Access, into your VPC network can be forwarded by your VPC network to on-premises destinations, but responses fail unless the on-premises network has an explicit route back to the allocated service-producer IP range. Similarly, endpoints in a second peered network cannot send responses back through your network to the original producer, which produces timeout or host-unreachable errors when a transitive path is attempted.
Exam tip: Exporting custom routes from your VPC network to a peered service-producer network does not allow that producer to reach a different VPC network or on-premises network peered to yours, because transitive peering is not supported.
Custom route exchange in VPC Network Peering governs how eligible static routes and dynamic routes learned by Cloud Router (opens in a new tab) move from an exporting VPC network to an importing peer network. The exporting VPC network must enable export of custom routes, and the peer network must enable import before the routes are programmed as peering routes. Exporting sends all eligible static and dynamic routes in the VPC network, such as routes to an on-premises network learned over a VPN tunnel or Interconnect, into the peer.
Privately used public IP ranges have stricter governance and are not imported by default. Both sides must explicitly opt in: the exporting VPC network must enable export of subnet routes using privately used public IPv4 addresses, and the importing VPC network must enable import of those ranges. The same bilateral requirement applies to stack-type changes that would newly import conflicting IPv6 subnet routes, so a configuration update is rejected unless both route tables remain consistent.
Subnet route overlap rules in VPC Network Peering prevent two peered VPC networks from claiming the same or nested IPv4 destination. Peering prohibits identical IPv4 subnet routes, so two peered VPC networks cannot both use 100.64.0.0/10. Peering also prohibits containment, so if the local VPC network has 100.64.0.0/24, no peered VPC network can have 100.64.0.0/10 that contains it.
Google Cloud enforces IPv4 overlap prohibitions at three times: when VPC networks are first peered, while the networks remain peered, and when a peering configuration changes such as enabling import of privately used public IPv4 addresses. While peered, the following operations return an error if they would create an overlap:
IPv6 subnet routes are globally unique by definition and provide a stronger boundary than IPv4 checks. No two VPC networks in Google Cloud can use the same internal or external IPv6 subnet range, such as fc:1000:1000:1000::/64, whether or not the networks are peered. Because subnet IPv6 ranges must use a 64-bit mask length, any conflict is an exact /64 collision.
Subnet route precedence in VPC Network Peering requires that subnet routes and peering subnet routes hold the most specific destination, so a static route cannot undercut them. A local static route in one VPC network cannot have a destination that exactly matches or fits within an imported peering subnet route. A peering static route imported from a peer cannot have a destination that exactly matches or fits within a local subnet route.
The two directions of conflict block different operations but share the same containment logic:
| Conflict direction | Blocked peering action | Blocked post-peering action |
|---|---|---|
| Local static route versus peering subnet route | Cannot establish a new peering that would import a subnet route that exactly matches or contains the local static destination, such as local 10.0.0.0/24 versus peer 10.0.0.0/8. Cannot update an existing peering to newly import the conflicting subnet route, such as enabling privately used public IP import when local 11.0.0.0/24 conflicts with peer 11.0.0.0/8. | Cannot create a new local static route that would match or fit within an already imported peering subnet route. Cannot create a new subnet range in the peered VPC network that would match or contain an existing local static route. |
| Peering static route versus local subnet route | Cannot establish a new peering that would import a peer static route that exactly matches or fits within the local subnet destination, such as local subnet 10.0.0.0/8 versus peer static 10.0.0.0/24. Cannot update an existing peering to newly import the conflicting static route. | Cannot create a new local subnet route that would exactly match or contain an already imported peering static route. Cannot create a new static route in the peered VPC network that would match or fit within an existing local subnet route. |
The same rules apply to IPv6 when the peering stack type is IPV4_IPV6. A local static 2001:0db8:0a0b:0c0d::/96 blocks peering to a network whose IPv6 subnet is 2001:0db8:0a0b:0c0d::/64, and changing an IPv4-only peering to IPV4_IPV6 is rejected when that conflict would appear. Conversely, a local IPv6 subnet 2001:0db8:0a0b:0c0d::/64 blocks import of a peer static route such as 2001:0db8:0a0b:0c0d::/96 that fits inside it.
Dynamic route propagation across VPC Network Peering is controlled by the dynamic routing mode of the exporting VPC network that owns the Cloud Routers which learned the prefixes. The exporting network determines in which regions the peering dynamic routes can be programmed in peer networks. The importing network does not expand that regional scope by its own mode.
Regional and global modes create different reachability footprints for the same learned prefix. If the exporting VPC network uses regional dynamic routing mode, that network exports dynamic routes only in the same region as the Cloud Routers that learned the prefixes. If the exporting VPC network uses global dynamic routing mode, that network exports dynamic routes in all regions, so peers in distant regions receive the same dynamic destinations.
Organization policy guardrails limit which address families and route types administrators can introduce into peered topologies. The constraints/compute.disableAllIpv6 organization policy constraint can prevent a network administrator from creating subnets with IPv6 address ranges, which in turn prevents those IPv6 subnet routes from becoming candidates for export. This control constrains whether IPv6 routes received from peered VPC networks can be used alongside local IPv6 subnets.
Access to change peering and route state is separately bounded by IAM, with the Compute Network Admin role (roles/compute.networkAdmin) containing the permissions needed to manage networking resources. Restricting who can create peerings, update export and import flags, and create static routes or subnets keeps unauthorized cross-VPC interconnectivity from being established through a permissive peering update.
Cloud Next Generation Firewall (Cloud NGFW) (opens in a new tab) with hierarchical and granular Virtual Private Cloud (VPC) filtering is the practice of enforcing boundary segmentation with layered rules that narrow from the whole VPC to groups to single workloads. Cloud NGFW provides a stateful, horizontally scalable firewall that is enforced in a distributed manner on each virtual machine (VM), while Shared VPC and VPC Network Peering define where that policy is owned and where it stops. Advanced design combines broad-to-narrow rule layering with identity-based targets and tuned logging to achieve micro-segmentation without exhausting per-VM rule capacity.
The distributed enforcement model of Cloud Next Generation Firewall applies stateful firewall rules directly to each VM in a distributed manner. Traffic flows from the source VM or network to the destination VM, and the firewall decision is applied at the destination VM itself rather than through a single gateway chokepoint. Because enforcement scales horizontally with the VMs, the VPC retains full-mesh software-defined reachability while filtering is still applied per workload.
Pushing controls to endpoints is the preferred high-scale pattern for boundary protection. Hardened VMs plus Google Cloud firewall rules preserve the forwarding architecture of the VPC, while host-based endpoint agents add inspection without multi-interface bridging VMs. Multi-interface network virtual appliance (NVA) designs bridge multiple VPC networks in the same project, so aggregate resource needs can hit project-level VPC quotas and per-VM bandwidth limits. Choose native distributed rules when the requirement is scalable segmentation, and choose routed NVAs only when protection from application exploits, URL filtering, or cross-cloud policy uniformity exceeds native capabilities. When higher-layer inspection is required, third-party NVAs can be inserted into the data path with routes, but a single VM-based chokepoint works against cloud scale and requires mitigation with managed instance groups behind an internal passthrough Network Load Balancer.
Hierarchical layering is the ordering of firewall rules from general to specific to stay within the number of rules that can be programmed on any VM. A single complex rule is more efficient than many single-purpose rules, for example defining one ingress rule that allows 10 TCP ports instead of writing 10 separate rules that each allow one port. The policy depends on targets, which select the destination VMs that a rule applies to, so broad coverage and narrow exceptions can coexist without duplication.
The documented layering order moves from the VPC perimeter inward:
Traffic flows from the broadest match to the most specific enforcement, and the narrowest rule provides micro-segmentation only after the baseline is in place.
Identity-based micro-segmentation is the use of service accounts, network tags, and Tags to scope firewall rules to specific VMs rather than relying only on IP addresses and subnet placement. Subnet isolation treats the subnet as the security boundary, which matches on-premises models where VM identity is tied to network location. Target filtering treats the workload identity as the boundary, which aligns with Google Cloud software-defined networking where identity is not based solely on subnet IP address.
A subnet-scoped isolation rule binds both sides explicitly: the rule targets VMs carrying a specific Tag, network tag, or service account, and the source filter selects the subnet by name. For example, to permit all communication within the same subnet, the firewall rule sets Targets to specified target tags with value subnet-1 and sets Source filter to Subnets selecting subnet-1, so traffic flows only from VMs in subnet-1 to VMs tagged subnet-1. The target VMs depend on the tag or service account assignment made at instance creation, and the source depends on the subnet membership of the sender. Prefer service accounts when possible because the rule follows the workload even as addresses change, while subnet-based rules require re-mapping when addresses or placement change. Choose subnet isolation when IP placement is part of identity or compliance, and choose service-account targeting when different subsets in the same subnet need different rules.
Shared VPC (opens in a new tab) is the model for centralized boundary control where a host project owns the VPC network, subnets, routes, and firewall rules and service projects own the instances that use them. Network policy flows from the host project to the service-project VMs: Security Admins in the host project create and manage firewall rules that control traffic among service-project instances and to on-premises networks, while Service Project Admins can only create instances in granted subnets. The instance depends on the shared subnet for its internal IPv4 or IPv6 address, but the firewall ownership boundary remains in the host project, which enforces least privilege by preventing VM administrators from making network-impacting changes. Grant the network user role at the subnet level to limit each team to only its assigned 10.0.1.0/24 or 10.15.2.0/24 style range.
VPC Network Peering connects two VPC networks over Google's software-defined network so VMs communicate with internal IP addresses subject to firewall rules, but each peered network maintains its own distributed firewall. Peering merges control-plane route exchange for subnet routes, alias IP ranges, and optionally custom static and dynamic routes, yet it never exchanges Identity and Access Management (IAM) policies, so Network and Security Admins in one Virtual Private Cloud (VPC) gain no rights in the peer. Peering is not transitive, so traffic from VPC A to VPC C through VPC B is blocked unless A and C are directly peered. This boundary means segmentation policy must be duplicated on both sides of the peering when both directions require filtering.
Exam tip: Each peered VPC keeps its own firewall and peering is not transitive, while source tags and source service accounts of the sending VM are lost across a Cloud VPN tunnel between VPCs.
Firewall and flow telemetry is the record of allowed and denied connections that supports security auditing and intrusion analysis. VPC Flow Logs capture per-VM flow records to Cloud Logging, and firewall rule logging captures the specific rule decision with connection metadata. For VPC networks with mostly long-lived connections, setting the log aggregation interval to 15 minutes greatly reduces log volume while preserving network monitoring tasks such as diagnosis, filtering by VM and application, and forecasting traffic growth.
Use the following volume controls to match cost to the audit question:
Network Intelligence Center provides the analysis plane for this telemetry from a single console. Traffic flows from VPC Flow Logs and firewall logs to Network Topology for visualization, Connectivity Tests for path diagnosis, Firewall Insights for understanding rule interactions and shadowing, Network Analyzer for detecting misconfigurations, and Flow Analyzer for querying traffic flows. The logs depend on subnet-level enablement, and Firewall Insights depends on the logged allow and deny decisions to reveal overly broad or unused rules.
In Shared VPC, a subnet-level grant permits instance creation only in explicitly authorized subnets while a project-level grant permits instance creation in any subnet in any Virtual Private Cloud (VPC) network in the host project. With a subnet-level grant the instance zone must sit in the same region as the selected subnet, and in both cases the instance receives its primary internal IPv4 address from the free range of the selected shared subnet with internal communication subject to host firewall rules.
A single Shared VPC host project is appropriate when workloads require multiple network interfaces that must attach to shared networks and when teams share common firewall, routing and subnet requirements. Multiple host projects are appropriate when resource needs exceed the quota or scaling limits of a single project, when each Virtual Private Cloud (VPC) needs independent Identity and Access Management (IAM) administration, or to isolate Test and Production environments for separate quotas, administration policies and audit needs such as PCI.
No, Virtual Private Cloud (VPC) Network Peering is non-transitive so traffic flows only between the two directly peered Virtual Private Cloud (VPC) networks and never forwards through one peer to reach a third network or on-premises network. This boundary holds even when Export custom routes is enabled on the middle network, and each peered network retains its own firewall rules, Identity and Access Management (IAM) controls and routing table.
An enterprise organization is establishing a centralized Shared VPC architecture to host workloads across multiple departments. The central network security team manages the Shared VPC host project, which contains subnet-frontend (in us-central1), subnet-backend (in us-central1), and subnet-analytics (in us-east1).
The organization must meet the following access and administrative requirements:
service-project-app and must only be able to provision VM instances into subnet-frontend.service-project-data and must only be able to provision VM instances into subnet-analytics.How should IAM roles and resource bindings be configured to meet these requirements following the principle of least privilege?
Last updated