- VPC-A: 10.1.0.0/16
- VPC-B: 10.2.0.0/16

- server-one (in VPC-A): private IP 10.1.1.13
- server-two (in VPC-B): private IP 10.2.1.139
Initial test: ping from server-one to server-two fails because VPCs are isolated by default.
Create the VPC peering connection
Steps (console):- Open VPC → Peering Connections → Create Peering Connection.
- Give the peering a name (e.g., “VPC-A to VPC-B”).
- Choose the requester VPC (VPC-A).
- Choose the accepter VPC (VPC-B). You can select a VPC in the same account or in a different account, and you can choose same-region or cross-region peering.



Update route tables (both VPCs)
Creating/accepting the peering connection alone does not forward traffic. You must update the route tables associated with the subnets that host your instances so that each VPC knows to route traffic destined for the other VPC via the peering connection. Example routes to add:-
In the route table for subnets in VPC-A:
- Destination:
10.2.0.0/16 - Target: the VPC peering connection (e.g.,
pcx-xxxxxxxx)
- Destination:
-
In the route table for subnets in VPC-B:
- Destination:
10.1.0.0/16 - Target: the same peering connection
- Destination:
10.2.0.0/16.

Important reminders:
- CIDR blocks must not overlap for peering to work.
- Update the route tables associated with the subnets on both VPCs to point to the peering connection.
- Ensure security groups and NACLs permit the desired traffic.
- VPC peering is non-transitive: A ↔ B and B ↔ C does not imply A ↔ C.