Skip to main content

AWS VPC: What I Learned Building My First Network from Scratch

Day 1 my DevOps journey: subnets, route tables, gateways, and the things I broke along the way.

Updated 2 min readMarkdown

aws devops cloud networking 100daysofdevops

Why have I learned vpc?

Networking is the main component for communication between servers. In aws vpc is the service for learning networking skills. vpc contain several components like Subnets, Routing Table, Internet Gateway, Nat Gateway etc...

What is vpc?

vpc is an own isolated network inside aws. It is used to choose ip range and split into subnets.

What I built?

Created the VPC with 10.0.0.0/16.

  1. Created one public and one private subnet.
  2. Attached an Internet Gateway and added a route in the public route table.
  3. Launched an EC2 instance in the public subnet and connected through SSH.
  4. Launched an instance in the private subnet and reached it from the public one (bastion pattern).
  5. Added a NAT Gateway so the private instance could download updates.

vpc, public subnet and private subnet has been created. Next step connect vpc attached to igw for connecting instance to internet.

Deploy one ec2 instance in public subnet and deploy another ec2 instance in private subnet. Connect with public ec2 instance check internet is working in public subnet.

Internet is working fine in public instance.

What I broke and fixed?

SSH timed out: I forgot to add the route to the IGW. Public subnet in name only. Fixed by editing the route table.

Bastion host: connect ec2 public instance with public ipv4 address but private instance has no public Ip. so, I have connected private instance using private ipv4 address.

Private instance no internet: No internet in the private instance. Fixed by connecting Nat gateway.

private instance has no internet. for accessing internet for private instance. configure Nat gateway.

After connecting Nat-gateway private instance can be accessing internet.

5 views

About the author

  • "Every expert in DevOps once broke their first pipeline. I'm breaking mine right now."

No comments yet. Be the first to comment.