📖 L2 of 6 · M1⏱ 6 min▣ Core lesson

IP addresses

Numbers that identify devices. They come in two flavors — public and private — and the difference matters more than the version number you've heard about.

1The shape of an address

Most IP addresses you see look like this:

192.168.1.42
73.42.1.5
8.8.8.8

Four numbers from 0 to 255, separated by dots. This format is called IPv4IPv4 (Internet Protocol version 4) — the original IP address format. Four numbers, ~4 billion possible addresses. We've actually run out, which is part of why NAT exists.. It allows ~4 billion unique addresses, which sounded plenty in 1981 and is woefully inadequate today.

That shortage is why IPv6IPv6 — the newer IP format. Eight groups of four hex digits, separated by colons (e.g. 2001:db8::1). Effectively unlimited addresses, but adoption has been slow. exists — addresses like 2001:db8::1. We won't dwell on it; just know it exists. Tailscale supports both, behind the scenes.

2Public vs. private — the important distinction

Some IP ranges are reserved for "private use" — they're only meaningful inside a single local network. Three ranges are private:

  • 10.0.0.0 – 10.255.255.255 (often used in big offices)
  • 172.16.0.0 – 172.31.255.255 (often used by Docker)
  • 192.168.0.0 – 192.168.255.255 (almost every home network)

Every other IPv4 address is public — globally unique, routable on the internet.

The aha: billions of households use the same private addresses (probably 192.168.1.x) and there's no conflict, because those addresses never leave the LAN. Your router translates between your private addresses and a single public one. (We'll see how that works in L4 — NAT.)

Deep-path detail: there's a fourth range, 100.64.0.0/10, called CGNAT (Carrier-Grade NAT) space. Tailscale uses this range for the IPs it assigns to your devices, because it's guaranteed not to collide with your home network or your work network. Your Tailscale IP will look like 100.x.y.z.

3How your laptop got its address

When your laptop joined your home wifi, it didn't pick its own address. The router did, via a protocol called DHCPDHCP (Dynamic Host Configuration Protocol) — when a device joins a network, the router hands it an available IP address from a pool. The address can change over time, which is why your laptop might be 192.168.1.42 today and 192.168.1.53 tomorrow.. The router has a pool of addresses (usually 192.168.1.2 through 192.168.1.254) and hands one out when a device joins.

This is called a dynamic IP. It can change. If you reboot your wifi or your laptop sleeps too long, you might get a different address tomorrow. This is fine for clients (laptops, phones) but annoying for servers — you can't tell a friend "connect to 192.168.1.42" if that number changes.

For servers we sometimes use a static IP — pinned in router config, doesn't change. We'll do this for a few projects. But Tailscale offers a much nicer fix: every device gets a permanent name (laptop.tail-scale.ts.net) regardless of what its underlying IPs do.

4Your public IP

Your home network has one public IP — the one your router uses to talk to the internet. Every device in your house shares it. To find yours, run:

curl ifconfig.me

That number is what google.com sees when you visit. It's also what Tailscale sees when your devices first connect. Your ISP can change it any time (usually when your modem reboots), which is why "just use my public IP" is a fragile way to host services.

5Find your own addresses

Try these. Each tells you something different:

# Your private IP on the current network:
ifconfig | grep inet      # macOS / Linux
ipconfig                  # Windows

# Your public IP (what the world sees):
curl ifconfig.me

# Your router's IP (the gateway):
ip route                  # Linux / WSL
netstat -nr | grep default # macOS

You should see a private address (probably 192.168.x.x), a public address (something seemingly random), and your router (usually 192.168.1.1). All three coexist.

🧠Knowledge check

Three quick questions

Pick an answer to see why.

Q1.Your laptop has IP 192.168.1.42. Your friend's laptop has IP 192.168.1.42. What's the situation?
Q2.What does DHCP do?
Q3.You want to host a service at home that friends can reach. Why is "just use my public IP" fragile?
3 / 3
Names next.