Skip to content
6 min read·Lesson 2 of 10

IP Addressing and Subnetting

Master IPv4 addressing, CIDR notation, subnet calculations, private address ranges, and IPv6 fundamentals.

IP addressing is the foundation of all network communication. Cloud engineers work with IP addresses daily — designing VPC address spaces, configuring security groups, and troubleshooting connectivity. This is worth learning well.

IPv4 Addresses

An IPv4 address is a 32-bit number, written as four decimal octets separated by dots: 192.168.1.100

Each octet is 0–255 (8 bits). The address has two parts:

  • Network portion: Identifies the network
  • Host portion: Identifies the specific device within that network

CIDR Notation

CIDR (Classless Inter-Domain Routing) notation specifies both the address and the size of the network:

192.168.1.0/24

# /24 means the first 24 bits are the network prefix
# Binary: 11000000.10101000.00000001 | 00000000
#                   (network, 24 bits) | (host, 8 bits)
# Result: 256 addresses (2^8), 254 usable (network and broadcast reserved)

Common Subnet Sizes

CIDRAddressesUsable HostsUse Case
/3211Single host (security group rules)
/3042Point-to-point links
/281614Small subnet
/273230Small team
/24256254Standard subnet
/221,0241,022Medium subnet
/204,0964,094Large subnet
/1665,53665,534VPC (AWS default)
/816,777,216Class A range
/0All (internet)Default route

Private Address Ranges

These ranges are reserved for private use (RFC 1918) — they are not routable on the public internet:

RangeCIDRAddressesTypical Use
10.0.0.0 – 10.255.255.25510.0.0.0/816.7MEnterprise, cloud VPCs
172.16.0.0 – 172.31.255.255172.16.0.0/121MDocker default bridge
192.168.0.0 – 192.168.255.255192.168.0.0/1665KHome networks

Devices on private networks access the internet via NAT (Network Address Translation) — a router translates private IPs to a public IP before forwarding to the internet.

Subnetting a Network

Say you have a VPC with CIDR 10.0.0.0/16 and you want to create subnets for public and private tiers across 3 availability zones:

VPC: 10.0.0.0/16  (65,536 addresses)

Public subnets:
  10.0.1.0/24  — Public AZ-a   (256 addresses)
  10.0.2.0/24  — Public AZ-b
  10.0.3.0/24  — Public AZ-c

Private subnets:
  10.0.10.0/24  — Private AZ-a
  10.0.11.0/24  — Private AZ-b
  10.0.12.0/24  — Private AZ-c

Database subnets:
  10.0.20.0/24  — DB AZ-a
  10.0.21.0/24  — DB AZ-b
  10.0.22.0/24  — DB AZ-c

Using small, organised CIDR blocks per tier makes routing rules, security groups, and VPC peering much easier to reason about.

Special Addresses

  • 127.0.0.1 — Loopback (localhost)
  • 0.0.0.0/0 — All traffic / default route
  • 169.254.0.0/16 — Link-local (APIPA); on AWS EC2, 169.254.169.254 is the Instance Metadata Service
  • 255.255.255.255 — Broadcast

IPv6

IPv6 uses 128-bit addresses written in hexadecimal: 2001:0db8:85a3:0000:0000:8a2e:0370:7334 (shortened: 2001:db8:85a3::8a2e:370:7334)

  • 3.4 × 10³⁸ addresses — enough to give every grain of sand on Earth a billion addresses
  • No NAT needed — every device can have a public address
  • AWS VPCs support dual-stack IPv4/IPv6
  • /64 is the standard subnet size for IPv6

Next: DNS — how domain names are resolved to IP addresses, the record types you need to know, and how Route 53 works.

Key Takeaways

  • An IPv4 address is 32 bits — four octets like 192.168.1.10.
  • CIDR notation (192.168.1.0/24) specifies the network by indicating how many bits are the network prefix.
  • Private ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) are not routable on the public internet.
  • Subnetting divides a network into smaller ranges; /24 = 256 addresses, /16 = 65,536 addresses.
  • IPv6 uses 128-bit addresses in hex (2001:db8::/32) — no NAT needed, enough addresses for every device.

Test your knowledge

Try exam-style practice questions to reinforce what you've learned.

Practice Questions →