Non Transitive Nature of VPC Peering | Challenges with Solutions in Google Cloud

Omkar Nadkarni
Niveus Solutions
2 min readMay 3, 2024

--

Introduction

When working on GCP network design, it is essential to consider several key constructs, one of the most important being the non-transitive nature of VPC peering. This means that if VPC A is peered with VPC B, and VPC B is peered with VPC C, VPC A and VPC C cannot communicate unless a direct VPC peering is established between VPC A and VPC C. This non-transitive property of VPC peering is consistent across all three prominent cloud providers.

Understanding and addressing the implications of this can be challenging, especially when integrating managed services and designing complex network architectures like hub-and-spoke models. In this blog, we will explore these challenges in detail and discuss strategies to effectively manage network connectivity in Google Cloud.

Challenges with GCP Solutions

While this may seem intuitive, it leads to several challenges in Google Cloud:

  1. Connecting to Google-managed services: When trying to connect to Google-managed services like GKE and Cloud SQL from a VPC in another project, the non-transitive nature of VPC peering can create obstacles.
  2. Hub-and-spoke model limitations: In a hub-and-spoke model, where all connectivity is centrally managed and inspected, only spokes explicitly peered with the hub can communicate with each other. This means that spokes not directly peered cannot interact, limiting the effectiveness of this network design.
  3. Interconnect termination on the hub: If a VPN or Partner Interconnect terminates on the hub, communication from on-premises networks, AWS, or Azure to GCP-managed services in a spoke is not possible. This restriction complicates the integration and management of hybrid or multi-cloud environments within a hub-and-spoke architecture.

Ways to Resolve the Above Challenges

Here’s how we can resolve the mentioned challenges.

  1. Replace VPC Peering with VPN Tunnels: Using VPN tunnels instead of VPC peering can help overcome the limitations of non-transitive connectivity, enabling communication across different VPCs.
  2. Implement a Next-Generation Firewall (NGFW) or Network Virtual Appliance (NVA) on the Hub: By placing an NGFW or NVA on the hub, all inter-spoke communication can be routed through the hub. This approach effectively overrides the non-transitive nature of VPC peering, allowing for more seamless connectivity between spokes.

Reference to Google Cloud article. Hope this helps!

--

--

Omkar Nadkarni
Niveus Solutions

Omkar Nadkarni is a principal cloud architect passionate about technology and its impact on business. Has skillset around GCP, azure, AWS, devops and infra.