<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[🚀 AWS Networking Explained]]></title><description><![CDATA[🚀 AWS Networking Explained]]></description><link>https://aws-networking-explained.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Mon, 07 Sep 2026 12:22:38 GMT</lastBuildDate><atom:link href="https://aws-networking-explained.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[🚀 AWS Networking Explained with Hands-on Project (VPC, Subnets, IGW, NAT, Peering & CIDR)]]></title><description><![CDATA[When learning AWS networking, concepts like VPC, subnets, route tables, IGW, NAT Gateway, CIDR, and VPC peering can feel confusing without hands-on practice.
In this blog, I’ll:

Explain core AWS networking concepts in simple terms

Walk through a re...]]></description><link>https://aws-networking-explained.hashnode.dev/aws-networking-explained-with-hands-on-project-vpc-subnets-igw-nat-peering-and-cidr</link><guid isPermaLink="true">https://aws-networking-explained.hashnode.dev/aws-networking-explained-with-hands-on-project-vpc-subnets-igw-nat-peering-and-cidr</guid><category><![CDATA[AWS]]></category><category><![CDATA[vpc]]></category><category><![CDATA[Cloud Computing]]></category><category><![CDATA[Devops]]></category><category><![CDATA[aws networking]]></category><category><![CDATA[ec2]]></category><category><![CDATA[NAT Gateway]]></category><category><![CDATA[vpc peering]]></category><category><![CDATA[CIDR]]></category><category><![CDATA[#HandsonAWS]]></category><category><![CDATA[subnet]]></category><category><![CDATA[Internet Gateway]]></category><category><![CDATA[ICMP PROTOCAL]]></category><dc:creator><![CDATA[Ankit Raj]]></dc:creator><pubDate>Mon, 29 Dec 2025 21:30:39 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1767043666767/7403532f-3fa8-4ebd-80a9-991e8b72d483.gif" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>When learning AWS networking, concepts like <strong>VPC, subnets, route tables, IGW, NAT Gateway, CIDR, and VPC peering</strong> can feel confusing without hands-on practice.</p>
<p>In this blog, I’ll:</p>
<ul>
<li><p>Explain <strong>core AWS networking concepts in simple terms</strong></p>
</li>
<li><p>Walk through a <strong>real project</strong> I built using <strong>Test &amp; Prod VPCs</strong></p>
</li>
<li><p>Show how <strong>EC2s communicate within a VPC and across VPCs</strong></p>
</li>
</ul>
<hr />
<h2 id="heading-what-is-a-vpc">🌐 What is a VPC?</h2>
<p>A <strong>VPC (Virtual Private Cloud)</strong> is your <strong>own private network in AWS</strong> where you can launch resources like EC2, RDS, ALB, etc.</p>
<p>👉 You control:</p>
<ul>
<li><p>IP address range (CIDR)</p>
</li>
<li><p>Subnets</p>
</li>
<li><p>Routing</p>
</li>
<li><p>Internet access</p>
</li>
</ul>
<p><strong>Example:</strong></p>
<pre><code class="lang-plaintext">VPC CIDR: 10.0.0.0/16
</code></pre>
<hr />
<h2 id="heading-what-is-a-subnet">🧩 What is a Subnet?</h2>
<p>A <strong>subnet</strong> is a <strong>smaller network inside a VPC</strong>.</p>
<h3 id="heading-public-subnet">🔓 Public Subnet</h3>
<ul>
<li><p>Connected to <strong>Internet Gateway</strong></p>
</li>
<li><p>Can have public IPs</p>
</li>
<li><p>Used for: Bastion, Web servers, NAT Gateway</p>
</li>
</ul>
<h3 id="heading-private-subnet">🔒 Private Subnet</h3>
<ul>
<li><p>No direct internet access</p>
</li>
<li><p>Uses <strong>NAT Gateway</strong> for outbound traffic</p>
</li>
<li><p>Used for: App servers, Databases</p>
</li>
</ul>
<hr />
<h2 id="heading-what-is-a-route-table">📘 What is a Route Table?</h2>
<p>A <strong>route table</strong> decides <strong>where network traffic goes</strong>.</p>
<h3 id="heading-common-routes">Common Routes</h3>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Destination</td><td>Target</td></tr>
</thead>
<tbody>
<tr>
<td>VPC CIDR</td><td>local</td></tr>
<tr>
<td>0.0.0.0/0</td><td>IGW (public subnet)</td></tr>
<tr>
<td>0.0.0.0/0</td><td>NAT Gateway (private subnet)</td></tr>
</tbody>
</table>
</div><p>Each subnet must be <strong>associated with a route table</strong>.</p>
<hr />
<h2 id="heading-internet-gateway-igw">🌍 Internet Gateway (IGW)</h2>
<p>An <strong>Internet Gateway</strong> allows <strong>resources in public subnet</strong> to:</p>
<ul>
<li><p>Receive traffic from the internet</p>
</li>
<li><p>Send traffic to the internet</p>
</li>
</ul>
<p>👉 IGW is <strong>attached to the VPC</strong>, not directly to EC2.</p>
<hr />
<h2 id="heading-nat-gateway">🔁 NAT Gateway</h2>
<p>A <strong>NAT Gateway</strong> allows <strong>private subnet resources</strong> to:</p>
<ul>
<li><p>Access the internet (outbound only)</p>
</li>
<li><p>Stay protected from inbound internet traffic</p>
</li>
</ul>
<p>📌 NAT Gateway:</p>
<ul>
<li><p>Lives in <strong>public subnet</strong></p>
</li>
<li><p>Has an <strong>Elastic IP</strong></p>
</li>
</ul>
<hr />
<h2 id="heading-what-is-cidr">🔢 What is CIDR?</h2>
<p><strong>CIDR</strong> defines the <strong>IP address range</strong>.</p>
<h3 id="heading-examples">Examples:</h3>
<div class="hn-table">
<table>
<thead>
<tr>
<td>CIDR</td><td>Meaning</td></tr>
</thead>
<tbody>
<tr>
<td>/16</td><td>Large network (VPC)</td></tr>
<tr>
<td>/24</td><td>Smaller network (Subnet)</td></tr>
</tbody>
</table>
</div><p>Example:</p>
<pre><code class="lang-plaintext">VPC: 10.0.0.0/16
Public Subnet: 10.0.1.0/24
Private Subnet: 10.0.2.0/24
</code></pre>
<hr />
<h2 id="heading-what-is-vpc-peering">🔗 What is VPC Peering?</h2>
<p><strong>VPC Peering</strong> connects <strong>two VPCs privately</strong> so they can communicate using <strong>private IPs</strong>.</p>
<p>✔️ Traffic stays inside AWS<br />✔️ No public internet<br />❌ CIDRs must NOT overlap<br />❌ No transitive routing</p>
<hr />
<h1 id="heading-my-hands-on-aws-networking-project">🛠️ My Hands-on AWS Networking Project</h1>
<h2 id="heading-project-architecture-overview">🧪 Project Architecture Overview</h2>
<p>I created <strong>two separate VPCs</strong>:</p>
<ul>
<li><p><strong>Test VPC</strong></p>
</li>
<li><p><strong>Prod VPC</strong></p>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767041667197/fbc3f33a-7639-40e5-9413-67dffd0dc208.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767041680592/0d36409b-a03d-4be2-9e6d-f7dd51fedceb.png" alt class="image--center mx-auto" /></p>
<p>Each VPC has:</p>
<ul>
<li><p>1 Public Subnet</p>
</li>
<li><p>1 Private Subnet</p>
</li>
<li><p>Internet Gateway</p>
</li>
<li><p>NAT Gateway</p>
</li>
<li><p>EC2 instances  </p>
<p>  <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767041714156/44d7a255-2b17-488d-b2c4-99c763501192.png" alt class="image--center mx-auto" /></p>
<p>  <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767041743089/99136dbb-9e19-4fe3-9011-b3f8a47f8983.png" alt class="image--center mx-auto" /></p>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767041759089/d2a05391-7ebe-4894-b09f-2e3f814a6b42.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767041780667/cf785d59-b075-4220-9928-9395654177f2.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767041822591/e37b1eab-ea1d-46ca-844f-b2b81ede14c0.png" alt class="image--center mx-auto" /></p>
<hr />
<h2 id="heading-step-1-create-vpcs">📌 Step 1: Create VPCs</h2>
<div class="hn-table">
<table>
<thead>
<tr>
<td>VPC</td><td>CIDR</td></tr>
</thead>
<tbody>
<tr>
<td>test-vpc</td><td>10.0.0.0/16</td></tr>
<tr>
<td>prod-vpc</td><td>192.0.0.0/16</td></tr>
</tbody>
</table>
</div><hr />
<h2 id="heading-step-2-create-subnets-4-total">📌 Step 2: Create Subnets (4 Total)</h2>
<h3 id="heading-test-vpc">Test VPC</h3>
<ul>
<li><p>Public Subnet → <code>10.0.1.0/24</code></p>
</li>
<li><p>Private Subnet → <code>10.0.2.0/24</code></p>
</li>
</ul>
<h3 id="heading-prod-vpc">Prod VPC</h3>
<ul>
<li><p>Public Subnet → <code>192.0.1.0/24</code></p>
</li>
<li><p>Private Subnet → <code>192.0.2.0/24</code></p>
</li>
</ul>
<hr />
<h2 id="heading-step-3-create-amp-attach-internet-gateways">📌 Step 3: Create &amp; Attach Internet Gateways</h2>
<ul>
<li><p>1 IGW for <strong>Test VPC</strong></p>
</li>
<li><p>1 IGW for <strong>Prod VPC</strong></p>
</li>
<li><p>Attached each IGW to its respective VPC</p>
</li>
</ul>
<hr />
<h2 id="heading-step-4-create-nat-gateways">📌 Step 4: Create NAT Gateways</h2>
<ul>
<li><p>NAT Gateway in <strong>each public subnet</strong></p>
</li>
<li><p>Elastic IP attached</p>
</li>
<li><p>Used by private subnets for internet access</p>
</li>
</ul>
<hr />
<h2 id="heading-step-5-create-route-tables-4-total">📌 Step 5: Create Route Tables (4 Total)</h2>
<h3 id="heading-public-route-tables">Public Route Tables</h3>
<pre><code class="lang-plaintext">0.0.0.0/0 → Internet Gateway
</code></pre>
<h3 id="heading-private-route-tables">Private Route Tables</h3>
<pre><code class="lang-plaintext">0.0.0.0/0 → NAT Gateway
</code></pre>
<p>Each route table was <strong>explicitly associated</strong> with its subnet.</p>
<hr />
<h2 id="heading-step-6-launch-ec2-instances-4-total">📌 Step 6: Launch EC2 Instances (4 Total)</h2>
<div class="hn-table">
<table>
<thead>
<tr>
<td>VPC</td><td>Subnet</td><td>EC2</td></tr>
</thead>
<tbody>
<tr>
<td>Test</td><td>Public</td><td>EC2</td></tr>
<tr>
<td>Test</td><td>Private</td><td>EC2</td></tr>
<tr>
<td>Prod</td><td>Public</td><td>EC2</td></tr>
<tr>
<td>Prod</td><td>Private</td><td>EC2</td></tr>
</tbody>
</table>
</div><hr />
<h2 id="heading-internet-connectivity-validation">🌍 Internet Connectivity Validation</h2>
<p>✔️ Public EC2 → Internet via IGW<br />✔️ Private EC2 → Internet via NAT Gateway</p>
<p>All EC2s successfully accessed the internet.</p>
<hr />
<h2 id="heading-intra-vpc-communication-icmp-ping">🔁 Intra-VPC Communication (ICMP Ping)</h2>
<ul>
<li><p>Public EC2 ↔ Private EC2 (same VPC)</p>
</li>
<li><p>Ping works using <strong>private IP</strong></p>
</li>
<li><p>Enabled <strong>ICMP</strong> in security groups</p>
</li>
</ul>
<p>📌 Security Groups are <strong>stateful</strong>, so return traffic is allowed automatically.</p>
<hr />
<h2 id="heading-inter-vpc-communication-test-prod">🔗 Inter-VPC Communication (Test ↔ Prod)</h2>
<h3 id="heading-what-i-did">What I Did:</h3>
<ol>
<li><p>Created <strong>VPC Peering</strong> between Test &amp; Prod VPC</p>
</li>
<li><p>Updated route tables:</p>
</li>
</ol>
<pre><code class="lang-plaintext">Test VPC → 192.0.0.0/16 → Peering Connection
Prod VPC → 10.0.0.0/16 → Peering Connection
</code></pre>
<ol start="3">
<li><p>Allowed ICMP in security groups  </p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767041857484/c272a978-5ce2-4db5-9d65-be115b5b5e0c.png" alt class="image--center mx-auto" /></p>
</li>
</ol>
<h3 id="heading-result">Result:</h3>
<p>✔️ EC2 in Test VPC can ping EC2 in Prod VPC<br />✔️ Communication happens using <strong>private IPs</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767041962132/6052386a-7b7e-4fad-987b-3dd4bb7ad87b.png" alt class="image--center mx-auto" /></p>
<hr />
<h2 id="heading-key-learnings">✅ Key Learnings</h2>
<ul>
<li><p>Routing controls traffic flow, not subnets alone</p>
</li>
<li><p>NAT Gateway is only for <strong>outbound internet</strong></p>
</li>
<li><p>Security Groups control ICMP behavior</p>
</li>
<li><p>VPC Peering requires <strong>route updates on both sides</strong></p>
</li>
<li><p>CIDR planning is critical for future scaling</p>
</li>
</ul>
<hr />
<h2 id="heading-final-thoughts">🎯 Final Thoughts</h2>
<p>This project helped me deeply understand <strong>AWS networking fundamentals</strong> by implementing them practically rather than just reading theory.</p>
<p>If you’re learning AWS, I highly recommend building something like this—it clears <strong>90% of networking confusion</strong>.</p>
]]></content:encoded></item></channel></rss>