When I started with AWS networking, VPCs weren’t the hard part. IP addressing was. CIDR ranges, subnet sizes, why two networks “overlap”, and why a /24 doesn’t give you 256 usable addresses all looked like a wall of numbers. Once the basics clicked, VPC design became much more logical, so this post walks through those basics the way they come up in AWS.

Why this matters before you build anything

Every VPC, subnet, route table, NAT gateway and load balancer depends on the address ranges you pick at the start. If you pick badly, you find out later and it hurts: networks you can’t peer, subnets that run out of addresses, VPN routes that conflict. Changing a VPC’s main range after workloads are running is close to impossible, so a few minutes of planning up front saves a lot of rework.

IPv4 in one minute

An IPv4 address is 32 bits, written as four numbers from 0 to 255 separated by dots, like 192.168.1.118. Each of those four numbers is called an octet (8 bits).

Address classes, and why they’re mostly history

Older networking split the address space into fixed classes:

  • Class A: 1.0.0.0 to 126.255.255.255, very large networks
  • Class B: 128.0.0.0 to 191.255.255.255, medium networks
  • Class C: 192.0.0.0 to 223.255.255.255, small networks
  • Classes D and E: reserved for multicast and experimental use

Modern networks don’t use classes any more. CIDR replaced them because fixed sizes wasted huge numbers of addresses. Classes are still worth knowing, though, because they explain why ranges like 10.x and 192.168.x feel familiar, and they come up in interviews.

Private and public addresses

Look at your home network. Your laptop, phone and TV probably all have addresses like 192.168.1.x. Those are private addresses, which work inside your network but aren’t reachable from the internet. Your router has one public IP, and every device shares it when talking to the outside world. The router translates between the two, which is called NAT.

AWS works the same way. Instances in a VPC get private addresses. Instances that need to be reachable from the internet get a public IP and sit in a public subnet with a route to an internet gateway. Instances in private subnets reach the internet through a NAT gateway, just like devices behind your home router. The private ranges you’ll use for VPCs are 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16.

CIDR notation

CIDR (Classless Inter-Domain Routing) writes a network as an address plus a slash and a number, like 10.0.0.0/16. The number after the slash says how many of the 32 bits are fixed for the network. The rest are available for hosts, so the size of the network is:

2(32 − prefix)

A /16 gives 216 = 65,536 addresses, a common size for a whole VPC. A /24 gives 28 = 256 addresses, a common size for a subnet. Each step down in the prefix doubles the size: a /23 is 512 addresses, a /22 is 1,024.

AWS keeps five addresses in every subnet

This one confused me at first. In every subnet, AWS reserves the first four addresses and the last one. In 10.0.1.0/24, that’s .0 (network address), .1 (VPC router), .2 (DNS), .3 (reserved for future use) and .255 (broadcast). So a /24 gives you 251 usable addresses, not 256. That matters when you size subnets for things that consume a lot of IPs, like EKS pods.

Overlapping ranges

The classic mistake is creating every VPC with the default-looking 10.0.0.0/16. It works fine until you need two of them to talk. If VPC 1 and VPC 2 both use 10.0.0.0/16, AWS won’t let you peer them, because a route to 10.0.5.20 could mean either network. The same conflict appears with site-to-site VPNs, where your office network may already use the range you picked.

The fix is to plan from the start: give each VPC its own non-overlapping block, for example 10.0.0.0/16 for dev, 10.1.0.0/16 for staging and 10.2.0.0/16 for prod, and write it down.

In the AWS console

In the video I create a VPC, then carve it into subnets with their own CIDR blocks, so you can see how the numbers turn into real resources. Doing this yourself a couple of times is the fastest way to make the maths feel natural.

Mistakes to watch for

The ones almost everyone makes once: overlapping CIDR blocks between VPCs, subnets that are too small and run out of addresses, putting private resources like databases in public subnets, and route tables that send traffic the wrong way. Draw your network on paper before building it. It sounds old-fashioned, but it catches most of these.

Next steps

With addressing clear, the rest of VPC networking follows: route tables, internet and NAT gateways, security groups and NACLs, VPC peering and VPNs. The OpenVPN and VPC peering post puts these into practice, and the AWS Zero to Hero series covers the full path.

Madhukar Reddy

DevOps engineer focused on AWS, Docker, Kubernetes, cloud infrastructure, and cyber security. Shares practical cloud and DevOps content based on hands-on deployments, infrastructure troubleshooting, and real-world projects.

$ This blog is currently running on AWS EC2 using Docker-based deployment.

Leave a response