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
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?
- Yes, peering is transitive by default
- Yes, if B has a Cloud Router
- No, peering is not transitive
- 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).
Which statements about route exchange in VPC Network Peering are true?
- Exporting custom routes uses the --export-custom-routes setting.
- The other network must import them with --import-custom-routes.
- Private IPv4 subnet routes are exchanged automatically.
- Custom routes are exchanged by default in both directions.
- 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: 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.
