Skip to content

Professional Cloud Network Engineer · Domain 2: Implementing a VPC network · 20% of the exam

Task 2.1: Configuring VPCs.

Creating networks, subnets, firewall rules and policies, private services access and private pools, VPC Network Peering, Shared VPC and its IAM permissions, Private Google Access, expanding subnet ranges and VPC Service Controls perimeters.

Study it

  • Creating VPC networks, subnets, peering, Shared VPC and private access to Google APIs

    Partly covered by: VPC: Subnets, NAT & Firewalls

  • VPC Service Controls perimeters for networked services

    Lesson coming

Sample questions

Try each one before opening the answer. Every option is explained, with the Google Cloud documentation page that proves it.

Question 1 · choose 1

VPC networks app-net and data-net are connected by VPC Network Peering that was created with default settings. Both networks have dual-stack subnets with internal IPv6 ranges, and firewall rules allow the traffic. VMs reach each other across the peering over IPv4, but not over IPv6. App VMs must reach database VMs over IPv6, and the replies must come back. What should the network engineer change?

  1. AUpdate both peering connections, in app-net and in data-net, to the stack type IPV4_IPV6
  2. BUpdate only app-net's peering connection to the stack type IPV4_IPV6, because the app VMs start the connections
  3. CTurn on import and export of subnet routes with public IP addresses on both peering connections
  4. DTurn on import and export of custom routes on both peering connections
Show the answer and why
  • AUpdate both peering connections, in app-net and in data-net, to the stack type IPV4_IPV6

    Correct

    Internal IPv6 subnet routes are exchanged only with the IPV4_IPV6 stack type, which enables export and import, and each network imports through its own side of the peering.

  • BUpdate only app-net's peering connection to the stack type IPV4_IPV6, because the app VMs start the connections

    Incorrect

    data-net would still not import app-net's IPv6 subnet routes, so replies to the app VMs would have no route.

  • CTurn on import and export of subnet routes with public IP addresses on both peering connections

    Incorrect

    Those flags govern IPv4 subnet ranges that use privately used public addresses, not internal IPv6 ranges.

  • DTurn on import and export of custom routes on both peering connections

    Incorrect

    The custom route settings don't govern subnet routes; IPv6 subnet routes are exchanged only through the peering's stack type.

Across VPC Network Peering, IPv4 subnet routes with private ranges are always exchanged, but internal and external IPv6 subnet ranges are neither exported nor imported by default. Setting the stack type IPV4_IPV6 on a peering connection enables both for that side, so two-way IPv6 traffic needs the setting on both networks' peering connections.

Question 2 · choose 1

A Service Project Admin holds the Network User role on the shared subnet web-subnet in a Shared VPC host project. She can create single VMs in that subnet from her service project. A regional managed instance group created from an instance template that references web-subnet fails to create any instances. What should the Shared VPC Admin do?

  1. AGrant the Network User role on web-subnet to the Compute Engine default service account that the service project's VMs use
  2. BGrant the Service Project Admin the Network User role on the whole host project instead of on web-subnet
  3. CGrant the Network User role on web-subnet to the Google APIs service account (@cloudservices) of the service project
  4. DGrant the Instance Admin role on the service project to the service project's Google APIs service account
Show the answer and why
  • AGrant the Network User role on web-subnet to the Compute Engine default service account that the service project's VMs use

    Incorrect

    That account is the identity the VMs run as; the group's instance creation is carried out by a different service account.

  • BGrant the Service Project Admin the Network User role on the whole host project instead of on web-subnet

    Incorrect

    Her own subnet-level grant is enough for her; the failing instance creation isn't done with her identity.

  • CGrant the Network User role on web-subnet to the Google APIs service account (@cloudservices) of the service project

    Correct

    Managed instance groups with Shared VPC need the Google APIs service account to be a Service Project Admin, because it performs the instance creation.

  • DGrant the Instance Admin role on the service project to the service project's Google APIs service account

    Incorrect

    The missing permission is the use of the shared subnet in the host project, which a role on the service project can't give.

Tasks such as creating instances for a managed instance group, including autoscaling, are performed by the service project's Google APIs service account (PROJECT_NUMBER@cloudservices.gserviceaccount.com). With Shared VPC that account needs the Network User role on the subnets the group uses, just as a human Service Project Admin does.

Question 3 · choose 1

A network engineer holds the Compute Shared VPC Admin role on the folder Infra and nothing more. The Shared VPC host project net-host sits in Infra/Networking, a folder nested under Infra. The engineer must now attach the service project bi-prod, which sits in the separate top-level folder Analytics, to net-host, and the attach fails for lack of permission. What should the organization administrator grant the engineer?

  1. AThe Compute Shared VPC Admin role on the Infra/Networking folder that holds net-host
  2. BThe Compute Shared VPC Admin role on the bi-prod project itself
  3. CThe Compute Network User role on net-host for the bi-prod project's admins
  4. DThe Compute Shared VPC Admin role on the Analytics folder as well
Show the answer and why
  • AThe Compute Shared VPC Admin role on the Infra/Networking folder that holds net-host

    Incorrect

    The role on Infra already applies to the folders nested under it; the missing right is on the folder of the service project.

  • BThe Compute Shared VPC Admin role on the bi-prod project itself

    Incorrect

    The Shared VPC Admin role is granted at the organization or folder level, not on a single service project.

  • CThe Compute Network User role on net-host for the bi-prod project's admins

    Incorrect

    Network User lets service project principals use shared subnets; it doesn't let anyone link a service project to the host project.

  • DThe Compute Shared VPC Admin role on the Analytics folder as well

    Correct

    A Shared VPC Admin can link projects in two different folders only with the role for both folders, and Infra covers only net-host's side.

A Shared VPC Admin role granted on a folder applies to that folder and every folder nested under it, so the engineer's role on Infra already covers net-host in Infra/Networking. Host and service projects may sit in different folders, but then the admin needs Shared VPC Admin rights on both folders; the role is granted at the organization or folder level. Granting it on Analytics, or on the organization, lets the engineer attach bi-prod.

Question 4 · choose 1

A team converted an auto mode VPC network to custom mode so that it could plan its own subnets. A month later it asks to switch the network back to auto mode. What should the network engineer tell the team?

  1. AThe switch back is possible only while no new subnets have been added
  2. BThe switch back is possible after deleting the subnets that auto mode would create
  3. CThe switch back happens automatically if the network's subnets match the auto mode ranges
  4. DThe conversion was one-way: a custom mode network can't be converted to auto mode
Show the answer and why
  • AThe switch back is possible only while no new subnets have been added

    Incorrect

    Adding subnets isn't the condition; a custom mode network can't be converted to auto mode at all.

  • BThe switch back is possible after deleting the subnets that auto mode would create

    Incorrect

    No preparation makes the conversion possible; it works in one direction only.

  • CThe switch back happens automatically if the network's subnets match the auto mode ranges

    Incorrect

    There is no automatic conversion; the network stays in custom mode.

  • DThe conversion was one-way: a custom mode network can't be converted to auto mode

    Correct

    Converting an auto mode network to custom mode is a one-way process.

Auto mode VPC networks create a subnet in each region automatically, while custom mode networks leave subnet creation to you. An auto mode network can be converted to custom mode, but that conversion is one-way.

Question 5 · choose 1

A subnet has Private Google Access enabled. Some VMs in it have only internal IP addresses, and others also have external IP addresses. For which VMs does the Private Google Access setting change how they reach Google APIs?

  1. AOnly the VMs that have internal IP addresses and no external IP address
  2. BAll VMs in the subnet, whatever addresses they have
  3. COnly the VMs that also have external IP addresses
  4. DAll VMs in the VPC network, because the setting applies to the whole network
Show the answer and why
  • AOnly the VMs that have internal IP addresses and no external IP address

    Correct

    Private Google Access has no effect on instances that have external IP addresses; it serves VMs with internal addresses only.

  • BAll VMs in the subnet, whatever addresses they have

    Incorrect

    VMs with external IP addresses are unaffected by the setting.

  • COnly the VMs that also have external IP addresses

    Incorrect

    It is the other way round: the setting is for VMs without external IP addresses.

  • DAll VMs in the VPC network, because the setting applies to the whole network

    Incorrect

    Private Google Access is enabled per subnet, not per network.

Private Google Access is a subnet setting that lets VMs with only internal IP addresses reach the external IP addresses of Google APIs and services. It has no effect on VMs with external IP addresses, which can reach those APIs anyway.

Question 6 · choose 1

A subnet's primary range is 10.10.0.0/24 and is nearly full. Which change can the network engineer make to the existing subnet?

  1. AChange the primary range to 10.10.0.0/25 to free addresses for a new subnet elsewhere
  2. BMove the primary range to 10.20.0.0/24 while keeping the VMs' addresses
  3. CExpand the primary range to a range that overlaps a subnet in a peered network
  4. DExpand the primary range to 10.10.0.0/23, if that block doesn't overlap another subnet
Show the answer and why
  • AChange the primary range to 10.10.0.0/25 to free addresses for a new subnet elsewhere

    Incorrect

    A subnet's primary range can't be shrunk.

  • BMove the primary range to 10.20.0.0/24 while keeping the VMs' addresses

    Incorrect

    Expansion widens the existing range; it doesn't move the subnet to a different block.

  • CExpand the primary range to a range that overlaps a subnet in a peered network

    Incorrect

    An expanded range can't overlap other subnets, including those of peered networks.

  • DExpand the primary range to 10.10.0.0/23, if that block doesn't overlap another subnet

    Correct

    Subnet primary IPv4 ranges can be expanded, but not shrunk, as long as the new range doesn't overlap other ranges.

A subnet's primary IPv4 range can be expanded after creation to a broader prefix that contains it, provided the new range doesn't overlap other subnets in the network or in peered networks. A range can't be shrunk.

Practice domain 2 →Practice all domains →