HeoLab
ToolsBlogAboutContact
HeoLab

Free developer tools with AI enhancement. Built for developers who ship.

Tools

  • JSON Formatter
  • JWT Decoder
  • Base64 Encoder
  • Timestamp Converter
  • Regex Tester
  • All Tools →

Resources

  • Blog
  • What is JSON?
  • JWT Deep Dive
  • Base64 Explained

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 HeoLab. All rights reserved.

Tools work in your browser. Zero data retention.

HomeBlogIP Addresses, Subnets, and CIDR: A Developer's Guide
Table of Contents▾
  • IPv4 Address Structure
  • Private vs Public IP Addresses
  • CIDR Notation Explained
  • Prefix Length Quick Reference
  • Planning a Cloud VPC
  • Docker Networking
  • See container IPs
  • Create a custom network
  • docker-compose custom subnet
  • Useful IP Commands
  • Your current IP addresses
  • Default gateway (router IP)
  • Check if IP is reachable
  • Trace the network path
  • DNS lookup
guides#networking#ip#cidr

IP Addresses, Subnets, and CIDR: A Developer's Guide

Understand IPv4 subnetting, CIDR notation, private vs public IPs, and how to plan your cloud network architecture — no networking degree required.

Trong Ngo
February 23, 2026
3 min read

Networking is one of those topics developers avoid until they're setting up a cloud VPC or debugging a mysterious connection issue. This guide gives you the practical knowledge you need without a networking degree.

IPv4 Address Structure

An IPv4 address is 32 bits, written as four 8-bit octets in decimal:

192.168.1.100
 ^    ^  ^ ^
 |    |  | └── last octet: 0-255
 |    |  └──── third octet: 0-255
 |    └──────── second octet: 0-255
 └──────────── first octet: 0-255

In binary: 11000000.10101000.00000001.01100100

Private vs Public IP Addresses

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

RangeCIDRUse case
10.0.0.0 – 10.255.255.25510.0.0.0/8Large enterprise / cloud VPCs
172.16.0.0 – 172.31.255.255172.16.0.0/12Docker default bridge network
192.168.0.0 – 192.168.255.255192.168.0.0/16Home/office networks

Special addresses:

  • 127.0.0.1 — loopback (localhost)
  • 0.0.0.0 — all interfaces (bind to all network interfaces)
  • 255.255.255.255 — broadcast to all devices on local network

CIDR Notation Explained

CIDR (Classless Inter-Domain Routing) notation is IP/prefix. The prefix length tells you how many bits are the network portion:

192.168.1.0/24
            ^^
            24 bits = network portion
            8 bits left = host portion = 2^8 = 256 addresses

Network:   192.168.1.0
Broadcast: 192.168.1.255
Usable:    192.168.1.1 – 192.168.1.254  (254 hosts)

Prefix Length Quick Reference

CIDRSubnet MaskTotal IPsUsable Hosts
/8255.0.0.016,777,21616,777,214
/16255.255.0.065,53665,534
/24255.255.255.0256254
/25255.255.255.128128126
/28255.255.255.2401614
/30255.255.255.25242
/32255.255.255.25511 (single host)

Planning a Cloud VPC

When setting up AWS VPC, GCP VPC, or Azure VNet, start with a large block and subnet it:

VPC: 10.0.0.0/16 (65,534 usable IPs)

├── Public subnets (for load balancers, NAT gateways)
│   ├── 10.0.1.0/24  — us-east-1a (254 hosts)
│   ├── 10.0.2.0/24  — us-east-1b (254 hosts)
│   └── 10.0.3.0/24  — us-east-1c (254 hosts)
│
├── Private subnets (for application servers)
│   ├── 10.0.11.0/24 — us-east-1a
│   ├── 10.0.12.0/24 — us-east-1b
│   └── 10.0.13.0/24 — us-east-1c
│
└── Database subnets (for RDS, ElastiCache)
    ├── 10.0.21.0/24 — us-east-1a
    └── 10.0.22.0/24 — us-east-1b

Docker Networking

Docker creates a bridge network 172.17.0.0/16 by default. Each container gets an IP in this range:

# See container IPs
docker inspect <container> | grep IPAddress

# Create a custom network
docker network create --subnet 10.10.0.0/24 mynet

# docker-compose custom subnet
networks:
  default:
    ipam:
      config:
        - subnet: 172.20.0.0/24

Useful IP Commands

# Your current IP addresses
ip addr show          # Linux
ipconfig /all         # Windows
ifconfig              # macOS

# Default gateway (router IP)
ip route show default

# Check if IP is reachable
ping 8.8.8.8

# Trace the network path
traceroute google.com  # Linux/macOS
tracert google.com     # Windows

# DNS lookup
nslookup heolab.com
dig heolab.com A

Use the CIDR Calculator to compute subnet ranges, broadcast addresses, and host counts for any CIDR block. Use the IP Lookup tool to check the geolocation and ISP of any IP address.

Try These Tools

CIDR / IP Calculator

Enter any IP/CIDR (e.g. 192.168.1.0/24) — get subnet mask, host range, broadcast, and more.

IP Address Lookup

Look up any IP address — get geolocation, ISP, timezone, and network info instantly.

Related Articles

YAML vs JSON: When to Use Each and How to Convert Between Them

3 min read

Docker Commands Cheatsheet for Developers

4 min read

How DNS Works: A Developer's Guide to Domain Resolution

4 min read

Back to Blog

Table of Contents

  • IPv4 Address Structure
  • Private vs Public IP Addresses
  • CIDR Notation Explained
  • Prefix Length Quick Reference
  • Planning a Cloud VPC
  • Docker Networking
  • See container IPs
  • Create a custom network
  • docker-compose custom subnet
  • Useful IP Commands
  • Your current IP addresses
  • Default gateway (router IP)
  • Check if IP is reachable
  • Trace the network path
  • DNS lookup

Related Articles

YAML vs JSON: When to Use Each and How to Convert Between Them

3 min read

Docker Commands Cheatsheet for Developers

4 min read

How DNS Works: A Developer's Guide to Domain Resolution

4 min read