What Is a VPC?
A Virtual Private Cloud (VPC) is your own private network inside AWS. You decide the IP address range, the sub-networks, and how traffic comes in and out. Other customers cannot see inside your VPC.
- A VPC lives in one Region and spans all AZs of that Region
- Every account gets a default VPC in each Region so beginners can launch servers quickly
- For real projects you create a custom VPC
IP Addresses and CIDR in Simple Words
Every device on a network has an IP address, like 10.0.1.25. A CIDR block describes a range of addresses, written like 10.0.0.0/16.
| CIDR | Number of addresses | Typical use |
|---|---|---|
10.0.0.0/16 | 65,536 | Whole VPC |
10.0.1.0/24 | 256 | One subnet |
10.0.1.0/28 | 16 | Very small subnet |
- The number after
/says how many bits are fixed. Smaller number = bigger network - VPC size can be between
/16and/28 - AWS reserves 5 addresses in every subnet, so a
/24has 251 usable addresses - Use private ranges:
10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 - Pick ranges that do not overlap with other networks you may connect later
Subnets
- A subnet is a slice of the VPC in one Availability Zone
- Public subnet: has a route to an Internet Gateway, so resources can have public internet access
- Private subnet: no direct route to the internet. Good for databases and app servers
- Spread subnets across at least two AZs for high availability
Route Tables
A route table is a set of rules that tells network traffic where to go. Every subnet is linked to one route table.
| Destination | Target | Meaning |
|---|---|---|
10.0.0.0/16 | local | Traffic inside the VPC stays inside (always present) |
0.0.0.0/0 | igw-xxxx | Everything else goes to the Internet Gateway (this makes a subnet public) |
0.0.0.0/0 | nat-xxxx | Everything else goes through a NAT gateway (private subnet outbound only) |
Internet Gateway (IGW)
- A horizontally scaled, highly available gateway between your VPC and the internet. Free to use
- Attach one IGW to the VPC, add a route
0.0.0.0/0 → IGWto the public subnet's route table, and give instances public IPs - All three are needed: IGW attached + route + public IP
A Simple Three-Tier Layout
Build a VPC With the CLI
- The console option Create VPC → VPC and more builds all of this with a wizard
- Delete the demo VPC after practice (delete instances and NAT gateways first)
Default VPC vs Custom VPC
| Default VPC | Custom VPC | |
|---|---|---|
| Created by | AWS automatically | You |
| CIDR | 172.31.0.0/16 | Your choice |
| Subnets | One public subnet per AZ | Your design |
| Best for | Quick tests | Real applications |
Common Mistakes
- Instance in a public subnet but no public IP or no route to IGW
- Overlapping CIDRs that block future connections
- Only one AZ used
- Putting databases in public subnets
Practice
- Look at your default VPC: subnets, route table and internet gateway
- Create a custom VPC with a public and a private subnet using the wizard
- Launch an instance in the public subnet and confirm you can reach it
- Launch one in the private subnet and confirm it has no public IP
- Calculate how many usable addresses a
/26has
Conclusion
A VPC is your private network. Plan a CIDR range, split it into public and private subnets across AZs, use route tables to control traffic and attach an Internet Gateway to make a subnet public.

