How NAT works
(and why it stops your computers from talking)
Before we touch Tailscale, we need to understand the one thing it quietly fixes for you. It's called NAT, and it's the reason "just connect to my home computer" isn't a one-liner.
1The setup: two computers, one problem
You're at a coffee shop. Your friend is at home. Both of you have laptops, both connected to the internet. You want to share a file directly — laptop to laptop. This should be easy. It is not.
The reason has nothing to do with Tailscale. It has to do with how home and office networks are wired up — a design choice from the 1990s that we all live inside.
2Inside vs. outside: private addresses
Your laptop has an IP addressIP address — a number that identifies a device on a network. Like a postal address but for packets of data. — probably something like 192.168.1.42. So does your phone. And your printer. And every other device in your home.
These are private IPsPrivate IP — an address that's only meaningful inside one local network. Three ranges are reserved: 10.x.x.x, 172.16–31.x.x, and 192.168.x.x. Billions of people use the same numbers; it's fine because they never leave the local network.. Every home network on Earth uses the same 192.168.x.x numbers — and that's fine, because those numbers never leave your house. Your friend's 192.168.1.42 and your 192.168.1.42 never collide, because they live in different houses.
The aha: the address you see on your laptop is not the address the internet sees. There's a translator in between.
3The router as gatekeeper
That translator is your router — the box from your ISP that has all the blinking lights. It does a job called NATNAT (Network Address Translation) — when a device inside your network sends a packet to the internet, the router rewrites the "from" address to its own public IP, then remembers the swap so it can route the reply back to the right device. Like a hotel front desk taking outgoing mail and putting the hotel address on it..
When your laptop sends a packet out to, say, google.com, the router rewrites the "from" address — replacing your private 192.168.1.42 with the router's public address, the one the rest of the internet sees. It writes down the swap in a little table, so when Google's reply comes back, it knows which device to forward it to.
Mental model: the router is a hotel front desk. Your laptop is a guest in room 42. When you send mail out, the desk crosses out "Room 42" and writes "123 Main Street, c/o the hotel" — because that's an address the postal service actually understands.
Deep-path detail: NAT also remaps source ports, not just addresses. So multiple devices behind the same router can each talk to Google simultaneously without their replies getting confused — the router uses the (public IP, port) pair as the unique key for each conversation. This is technically called PAT or NAPT, but everyone just says "NAT."
4The asymmetry: incoming connections die
So far so good. Outbound traffic works. But now imagine your friend tries to reach you the other direction — they want to connect to your laptop.
Their packet arrives at your router. Your router looks up the destination. It's just the router's public IP — there's no room number on the envelope. The router has no idea which of the dozen devices in your house was being addressed. It hasn't seen this conversation before. There's no entry in its little table.
So it does the only safe thing. It drops the packet.
This is the whole problem. Your router happily lets traffic out, but it refuses traffic in unless it's a reply to something you started. This is great for security — random strangers can't poke at your laptop. It's awful if you're trying to be reached.
5The classic workarounds (and why they're awful)
Historically, people fix this in three ways, all of which are terrible:
1. Port forwarding — log into your router and tell it "any traffic to public-IP:8080, send it to laptop:8080." Works, but you've now poked a permanent hole through your firewall. The whole internet can hit that port. And your "public" IP keeps changing whenever your ISP feels like it.
2. Cloud relays — pay a company to host a server with a stable public IP, and have your laptop and your friend's laptop both connect to it. Works, but now there's a middleman seeing all your traffic and you're paying rent.
3. VPN to your home router — set up an OpenVPN or WireGuard server, port-forward to it, distribute keys to every device. Works, but congratulations — you're now a part-time sysadmin.
6What Tailscale actually does
Tailscale's trick is called NAT traversalNAT traversal — a coordinated dance where two devices behind separate NATs each open an outbound connection at the same time. Because outbound is allowed, both routers create table entries — and now there's a path each way. Tailscale uses a coordination server (just for the handshake) to pull this off.. Both your laptop and your friend's laptop are talking outbound — which their routers happily allow. A small Tailscale coordination server tells each side "hey, the other person is also poking; both of you, send a packet right now."
The simultaneous outbound packets cause both routers to create table entries — and suddenly there's a direct path in both directions. Your laptops talk to each other directly, peer-to-peer, encrypted end-to-end with WireGuard. The Tailscale server only saw the handshake; it never sees your data.
The aha: Tailscale doesn't bypass NAT. It tricks NAT into helping. Your router thinks your laptop is just having a normal outbound conversation — which, technically, it is.
Deep-path detail: About 5–10% of network configurations are "symmetric NAT" — a hostile variant that randomizes the public port for each destination, making the simultaneous-open trick fail. For these cases, Tailscale falls back to a relay called DERPDERP (Detoured Encrypted Routing Protocol) — Tailscale's encrypted relay servers. Used as a fallback when direct peer-to-peer fails. Your traffic still stays end-to-end encrypted; the relay can't read it.. DERP is slower than direct, but it's encrypted end-to-end, so even Tailscale can't read your traffic.
7What this means for the rest of this course
Every time you'll hear "Tailscale just makes it work" — this is what's happening underneath. There is no port forwarding. There are no public certs to manage. There's no "is my IP up to date" panic. The translator that used to be in your way is now working for you.
Next lesson, we cover ports and firewalls — the last piece of the foundations puzzle.