← Lessons

quiz vs the machine

Gold1400

Networking

The VPC Peering

Wiring two private networks together without the internet.

5 min read · core · beat Gold to climb

Joining Two VPCs

A VPC peering connection links two VPCs so their instances can talk using private addresses, as if they were on one network. Traffic stays on the provider backbone and never touches the public internet.

How It Behaves

Peering is simple but has firm rules.

  • Address ranges of the two VPCs must not overlap, or routing becomes ambiguous.
  • Each side must add route table entries pointing at the peer.
  • Peering is not transitive, so if A peers with B and B peers with C, A still cannot reach C.

When To Use It

Peering suits a small number of VPCs that need direct private links, such as a shared services VPC and a few application VPCs. As the count grows, the mesh of one to one links becomes hard to manage, which is the problem a transit gateway later solves.

Key idea

VPC peering privately connects two non overlapping VPCs through the provider backbone, but it is not transitive, so a full mesh of peerings grows awkward as the number of VPCs rises.

Check yourself

Answer to earn rating on the learn ladder.

1. What must be true of the two VPCs you peer?

2. If A peers with B and B peers with C, can A reach C?