Bitzu

Associate Cloud Engineer ยท Connectivity, load balancing and network tiers

VPC Network Peering

Peering setup in both directions, no transitive peering, overlapping ranges not allowed, exchange of custom routes, vs Shared VPC and VPN.

Key points

  • Connects two VPC networks over Google's internal network.
  • Each side must create its own peering.
  • Subnet ranges must not overlap, and peering is not transitive.
  • Private IPv4 subnet routes are exchanged automatically; custom (static and dynamic) routes only when one side exports them and the other imports them.

Source: https://docs.cloud.google.com/vpc/docs/vpc-peering

Practice questions

Single choice

VPC A is peered with VPC B, and VPC B is peered with VPC C. Can VMs in A reach VMs in C through B?

  1. Yes, peering is transitive by default
  2. Yes, if B has a Cloud Router
  3. No, peering is not transitive
  4. Yes, but only for internal DNS names
Show answer

Answer: C. No, peering is not transitive

Peering is not transitive. A and C would need their own direct peering (or another connection such as VPN).

Select all that apply

Which statements about route exchange in VPC Network Peering are true?

  1. Exporting custom routes uses the --export-custom-routes setting.
  2. The other network must import them with --import-custom-routes.
  3. Private IPv4 subnet routes are exchanged automatically.
  4. Custom routes are exchanged by default in both directions.
  5. Peering makes routes learned from one peer visible to another peer.
Show answer

Answer: A. Exporting custom routes uses the --export-custom-routes setting., B. The other network must import them with --import-custom-routes., C. Private IPv4 subnet routes are exchanged automatically.

Custom routes need the exporting side to export and the importing side to import. Private IPv4 subnet routes flow automatically. Custom routes are not exchanged by default, and peering is never transitive.

True or false

True or false: if the admin of VPC A creates a peering to VPC B, traffic flows immediately even if nobody configures anything in VPC B.

Show answer

Answer: False

False. Each network must create its own peering to the other; the connection works only when both sides are configured.

Practice 8 questions on this topic in Bitzu

Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.

Download on the App StoreGet it on Google Play

More Associate Cloud Engineer topics in this module