π Network Fusion: Enabling Communication Between Isolated VPCs
Hey Cloud Architects π
Welcome to Day 29 of the #100DaysOfCloud Challenge!
Today, we are solving a classic architectural puzzle for the Nautilus team: how to let a public-facing server talk to a private, isolated database server. We are setting up VPC Peering to create a secure bridge between our Default VPC and a custom Private VPC.
This task is part of my hands-on practice on the KodeKloud Engineer platform, which I highly recommend for anyone looking to master real-world DevOps scenarios.
π― Objective
- Establish a VPC Peering connection named
datacenter-vpc-peering. - Connect the Default VPC (Requester) with the datacenter-private-vpc (Accepter).
- Update Route Tables in both VPCs to allow cross-network traffic.
- Configure Security Groups to allow ICMP (Ping) requests.
- Verify connectivity by pinging the private instance from the public instance.
π‘ Why VPC Peering Matters
In production, you often keep sensitive data in a private VPC. VPC Peering allows your frontend apps to access that data securely without exposing the private resources to the public internet.
πΉ Key Concepts
VPC Peering Connection: A networking connection between two VPCs that enables you to route traffic between them using private IP addresses.
Non-Overlapping CIDRs: For peering to work, the two VPCs must have different IP ranges (e.g.,
172.31.0.0/16vs10.1.0.0/16). If they overlap, they cannot peer! [Image showing non-overlapping CIDR blocks for VPC peering]Route Table Propagation: Creating the connection is only half the battle. You must manually tell each VPC's Route Table how to find the other VPC's IP range.
π οΈ Step-by-Step: The Peering Workflow
Weβll move logically from Connection β Routing β Verification.
πΉ Phase A: Create and Accept the Peering Connection
- Initiate Request: In the VPC Dashboard, go to Peering Connections and click "Create peering connection."
-
Configure:
-
Name:
datacenter-vpc-peering - Requester: Select the Default VPC.
- Accepter: Select datacenter-private-vpc.
-
Name:
- Acceptance: Once created, select the connection, click Actions, and choose Accept Request.
πΉ Phase B: Configure Route Tables (The Traffic Map)
Both VPCs need to know that traffic for the "other side" should go through the Peering ID.
-
Public Route Table: Add a route to
10.1.0.0/16(Private VPC) via the Peering Connection. -
Private Route Table: Add a route to the Default VPC CIDR (usually
172.31.0.0/16) via the Peering Connection.
πΉ Phase C: Security Groups & Access
-
Private Instance SG: Update the security group of
datacenter-private-ec2to allow All ICMP - IPv4 from the Default VPC CIDR range. -
Public Instance Access: Ensure your public key is added to
authorized_keyson the public instance so you can SSH in from your client host.
β Verify Success
-
SSH into Public:
ssh ec2-user@<Public_IP>
-
Ping the Private: From the public terminal, run
ping <Private_IP_of_datacenter-private-ec2>.
* Confirm: π If you see active "Reply from..." messages, your VPCs are successfully talking to each other!
π Key Takeaways
- π Private Backbone: Traffic between peered VPCs stays on the AWS network and never traverses the public internet.
- π Bi-directional Routing: You must update the route tables on BOTH sides, or traffic will be able to go out but never find its way back.
- π‘οΈ Security Rules: Routing gets the packet to the server, but Security Groups decide if the server lets the packet in.
π« Common Mistakes
-
Overlapping CIDRs: Trying to peer two VPCs that both use
172.31.0.0/16. - Missing Acceptance: Forgetting that the "Accepter" VPC must manually approve the request.
- One-Way Routing: Only updating the public route table and wondering why the private instance can't "talk back."
π Final Thoughts
Youβve just built a secure, interconnected cloud network! VPC Peering is a building block for complex architectures, including centralized logging, shared services, and distributed microservices.
π Practice Like a Pro
If you want to try these tasks yourself in a real AWS environment, check out:
π KodeKloud Engineer - Practice Labs
Itβs where Iβve been sharpening my skills daily!
π Letβs Connect
- π¬ LinkedIn: Hritik Raj
- β Support my journey on GitHub: 100 Days of Cloud








Top comments (0)