All ArticlesDevOps2026-11-20T19:11:55+08:00

VPC Peering Connected but Third VPC Can't Route Through It? Non-Transitive Peering Explained

You peered VPC-A to VPC-B and VPC-B to VPC-C, but traffic from A never reaches C and you don't understand why. After reading, you will understand why direct peering is non-transitive by design and which hub-and-spoke alternatives actually forward traffic.

You peered VPC-A to VPC-B. You peered VPC-B to VPC-C. Route tables look fine, security groups allow the traffic, and both peering connections show "Active." Yet an instance in VPC-A cannot reach anything in VPC-C. No timeout, no reject — packets just vanish. This is not a misconfiguration. VPC peering is non-transitive by design, and no amount of route-table tweaking will make VPC-B forward traffic between its two peers.

This article walks through the problem as a postmortem: what the symptoms look like, why the investigation leads to a dead end, what the actual constraint is, and which architectures solve it.

Initial impact: connectivity works in pairs, fails across the chain

The setup typically looks like this. Three VPCs, each in a different account or serving a different environment:

  • VPC-A (10.0.0.0/16) — application tier
  • VPC-B (10.1.0.0/16) — shared services (logging, monitoring)
  • VPC-C (10.2.0.0/16) — database tier

VPC-A peers to VPC-B. VPC-B peers to VPC-C. Both peering connections are accepted and active. Instances in VPC-A reach VPC-B fine. Instances in VPC-B reach VPC-C fine. But when an instance in VPC-A tries to connect to a database in VPC-C, nothing comes back.

The natural assumption: something wrong with security groups, NACLs, or route tables. That is where investigation starts — and where it stalls.

Investigation: ruling out the usual suspects

First check is route tables. VPC-A has a route pointing 10.1.0.0/16 to the peering connection with VPC-B. VPC-B has a route pointing 10.2.0.0/16 to the peering connection with VPC-C. So far, looks correct.

But here is the gap: VPC-A has no route for 10.2.0.0/16. You might try adding one — pointing 10.2.0.0/16 at the peering connection between A and B, hoping VPC-B will forward it onward to VPC-C.

This does not work. The cloud provider rejects the route or silently drops the traffic. VPC-B is not a router. It will not forward packets between two peering connections, even if both are active and even if route tables on all three VPCs seem to form a logical chain.

Security groups and NACLs are red herrings here. You can open every port in every direction and the traffic still will not flow from A to C through B.

Critical discovery: peering is non-transitive by design

VPC peering creates a one-to-one network link between exactly two VPCs. Traffic on that link can only flow between those two VPCs. A peered VPC will never act as a transit point, relay, or middleman for a third VPC.

This is not a limitation that might get patched later. It is a deliberate architectural constraint. The reasons are straightforward:

Blast radius control. If peering were transitive, connecting your VPC to a partner's VPC would implicitly expose you to every other VPC that partner has peered with. You would inherit connectivity you never asked for and cannot audit.

Routing simplicity. Transitive peering would require each VPC to maintain awareness of routes learned through intermediate VPCs, creating complex routing loops and convergence problems similar to what BGP handles at the internet scale — but without the policy controls.

Security boundaries. Each peering connection is a discrete trust decision. Non-transitivity ensures that trust does not propagate. VPC-A trusting VPC-B does not mean VPC-A trusts VPC-C.

This behavior applies across major cloud providers. AWS VPC Peering, GCP VPC Network Peering, and Azure VNet Peering all enforce non-transitivity. The specifics differ (GCP has nuances around custom route export for on-prem connectivity — covered in this article on GCP peered VPC route export), but the core rule is the same: peering does not chain.

Temporary mitigation: full mesh peering

The immediate fix, if you only have three VPCs, is direct peering between every pair that needs to communicate. VPC-A peers to VPC-B, VPC-A peers to VPC-C, and VPC-B peers to VPC-C. Each VPC gets route table entries pointing directly at its own peering connections.

For three VPCs, that is three peering connections. Manageable. But the math gets ugly fast. The number of peering connections for a full mesh is n × (n - 1) / 2. Five VPCs need 10 connections. Ten VPCs need 45. Twenty VPCs need 190. Each connection needs route table entries on both sides, and each VPC has a limit on how many peering connections it can have (check your provider's current quotas).

Full mesh works as a stopgap for small environments. It does not scale.

Architectural fix: a transit layer

The real solution is introducing a component designed to forward traffic between multiple VPCs. The most common options:

Transit Gateway (AWS) or equivalent hub. A Transit Gateway acts as a regional network hub. Each VPC attaches to it, and the Transit Gateway handles routing between all attached VPCs. You go from n × (n - 1) / 2 peering connections to n attachments. Route tables on the Transit Gateway control which VPCs can talk to each other, giving you segmentation without the combinatorial explosion.

A typical setup:

  1. Create a Transit Gateway in your region.
  2. Create a Transit Gateway attachment for each VPC (this creates an ENI in a subnet you specify).
  3. Update each VPC's route table to send cross-VPC traffic to the Transit Gateway attachment.
  4. Configure Transit Gateway route tables to allow or deny traffic between specific attachments.

You can verify that routes are propagating correctly by checking the Transit Gateway route table:

aws ec2 describe-transit-gateway-route-tables \\
  --transit-gateway-route-table-id tgw-rtb-0abc123def456 \\
  --query 'TransitGatewayRouteTables[*].{ID:TransitGatewayRouteTableId,State:State}'

And to see which routes exist in that table:

aws ec2 search-transit-gateway-routes \\
  --transit-gateway-route-table-id tgw-rtb-0abc123def456 \\
  --filters 'Name=state,Values=active'

These commands are read-only and safe to run. The output shows which CIDR blocks are routed to which attachments, making it straightforward to confirm that VPC-A's CIDR appears in the route table and points to VPC-A's attachment.

Hub VPC with virtual appliances. Before Transit Gateway existed (and in scenarios where you need deep packet inspection or custom routing logic), some teams ran a "hub" VPC with EC2 instances acting as routers or firewalls. All spoke VPCs peer to the hub, and the hub instances forward traffic. This works but adds operational overhead: you manage the routing software, handle failover, and pay for the compute. Transit Gateway replaced this pattern for most use cases.

PrivateLink for service-specific access. If VPC-A only needs to reach a specific service in VPC-C (not full network connectivity), PrivateLink exposes a single endpoint without any peering at all. This is narrower than a transit solution but avoids the routing question entirely.

How to decide between full mesh and a transit hub

The decision typically comes down to how many VPCs need cross-connectivity and how often that number changes.

Full mesh peering makes sense when you have a small, stable number of VPCs (roughly three to four) and each VPC genuinely needs direct connectivity to every other. Peering has no per-hour cost on most providers — you pay only for data transfer across the peering link.

A Transit Gateway (or equivalent) makes sense when you have more than four or five VPCs, when new VPCs get added regularly, or when you need centralized route management and segmentation. Transit Gateways typically have per-attachment and per-GB charges, so the cost model differs. Check your provider's current pricing before committing.

For more on the migration path from peering to a transit architecture and the routing pitfalls that come with it, there is a related article on Transit Gateway blackhole debugging.

What to take away

VPC peering is a point-to-point link. It connects exactly two VPCs and will never forward traffic to a third, regardless of how you configure route tables. This is not a bug — it is a security and simplicity boundary baked into the design.

When you find yourself adding a fourth or fifth peering connection and managing route entries across a growing mesh, that is the signal to move to a transit architecture. The upfront setup is more involved, but the operational complexity stays flat as you add VPCs instead of growing quadratically.

Before you build anything, sketch out which VPCs actually need to talk to each other. Not every VPC needs full connectivity to every other. Sometimes the answer is two direct peering connections and one PrivateLink endpoint, not a Transit Gateway. Start from the communication requirement, not from the architecture pattern.