C.W.K.
Stream
Lesson 01 of 12 · published

IP Addresses

~15 min · ip, ipv4, ipv6, private-network

Level 0Pinger
0 XP0/101 lessons0/12 achievements
0/150 XP to next level150 XP to go0% complete

The mailing address of every device

An IP address is a unique numerical label assigned to every device on a network. It's the mailing address that tells the network where to deliver each packet. Without it, your laptop and Google's servers have no way to find each other.

IPv4 is the format you'll see most often: four numbers separated by dots, like 192.168.1.42. Each number is an octet (8 bits) and ranges from 0–255, giving us about 4.3 billion possible addresses. We ran out of those years ago — that's why IPv6 exists, but IPv4 still rules day-to-day operations.

Private vs. public — the split that runs your house

Three IPv4 ranges are reserved for private networks — your home, your office, your homelab:

RangeCIDRWhere you'll see it
10.0.0.0 – 10.255.255.25510.0.0.0/8Large corporate networks, Tailscale
172.16.0.0 – 172.31.255.255172.16.0.0/12Mid-size networks, Docker default bridge
192.168.0.0 – 192.168.255.255192.168.0.0/16Most home routers

Private IPs are not routable on the internet. Your home router has one public IP from your ISP that all your devices share via NAT (we'll cover that in lesson 7). Inside the LAN, every device gets a private IP — usually from DHCP.

IPv6 in one breath

IPv6 addresses look like 2001:0db8:85a3::8a2e:0370:7334. They're 128 bits (vs IPv4's 32), giving us 340 undecillion addresses — effectively unlimited. macOS, Linux, and modern routers dual-stack both. The tools you'll learn (ping, ssh, curl) all speak both. You just type the right format.

Code

Find your IP from the terminal·bash
# All interfaces and their IPs
ifconfig | grep inet

# Modern Linux equivalent
ip addr show

# Just your primary local IP (macOS, en0 = Wi-Fi)
ipconfig getifaddr en0

# Your public IP (whatever the internet sees)
curl -s ifconfig.me
echo   # newline

External links

Exercise

On your own machine, run all four commands in the code block. Note your en0 IP, your public IP, and which private range your LAN uses (10/8, 172.16/12, or 192.168/16). On a second device on the same Wi-Fi, run the same commands and confirm both private IPs share the same first three octets — that's your subnet. Take 2 minutes and write down the addresses; you'll reference them again in the Subnets lesson.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.