VPC Peering with Public Subnet and Private Subnet

Kaung Htet SanKaung Htet San
1 min read

In this lab, there are two VPCs. VPC 1 and VPC 2. VPC 1 has one EC2 connected to public subnet. VPC 2 had one EC2 connected to private subnet. These two VPCs will be connected via VPC peering.

The end result will be look like this. From EC2 1 public IP address should be able to ping to private IP address of EC2 2.

This is the Project VPC with CIDR range of 10.0.0.0/16

This is the test VPC with CIDR range of 172.16.0.0/16

In VPC peering I have connected two VPCs.

In Project VPC, I have config the route tables to test VPC using VPC peering connection.

In test VPC’s private subnet, I have config the route tables to Project VPC using VPC peering connection.

I have used VPC Reachability Analyzer to have connectivity from Instance to Instance.

Note. You have to include ICMP in security group to be able to ping. Or use telnet.

If there are many VPC that needed to be connected we use Transit Gateway instead of VPC Peering.

0
Subscribe to my newsletter

Read articles from Kaung Htet San directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Kaung Htet San
Kaung Htet San

​Hi, I’m Kaung Htet San — a Cloud Infrastructure Engineer with 6+ years of experience building and managing private cloud environments. I’ve delivered mission-critical solutions with Linux, VMware, OpenStack, and enterprise systems, and I specialize in automating infrastructure using Terraform and managing containerized workloads with Kubernetes. Now, I’m expanding into the public cloud space, applying my deep private cloud expertise to AWS and modern cloud-native architectures. My focus is on blending reliability and security with agility and innovation — crafting elegant, resilient, and scalable infrastructures that help businesses succeed. This portfolio showcases my journey: from enterprise systems to modern cloud solutions — always building for the future.