Ports and firewalls
An IP gets you to a computer. A port gets you to a specific service running on that computer. A firewall decides which combinations are allowed.
1An IP isn't enough
Your laptop probably runs many networked things at once: a web browser fetching pages, a music app streaming audio, maybe a Slack client, maybe a local dev server. They all share the same IP. How does an incoming packet know which one to land on?
The answer is a
portPort — a number from 0 to 65535 that identifies a specific service on a device. An IP gets you to the device; the port gets you to the right service running on it. You'll see addresses written as 192.168.1.42:80 — the colon separates IP from port.
— a small number tacked onto the IP. Addresses are written as IP:port:
192.168.1.42:80 # a web server
192.168.1.42:22 # SSH
192.168.1.42:11434 # Ollama (local AI)
Same machine, three different services. Like apartment numbers in one building.
2Common ports worth recognizing
22— SSH (remote shell)53— DNS80— HTTP443— HTTPS3000,5173,8000,8080— common dev server ports8096— Jellyfin11434— Ollama32400— Plex
You don't need to memorize these. You'll learn them by exposure. The key insight is just that every networked service "listens on" a port, and clients connect to that IP:port combination.
3Firewalls: filtering by IP and port
A firewallFirewall — software (or hardware) that decides which network packets are allowed in or out, based on rules. Rules typically match on source/destination IP, port, and protocol (TCP/UDP). is a filter. It looks at every packet and decides "allow" or "drop" based on rules. Almost every device has one — your laptop, your router, every cloud server. A typical rule says:
allow incoming on port 22 from anywhere # let SSH in
allow incoming on port 80, 443 from anywhere # let web traffic in
drop everything else # default-deny
This is what makes "exposing a service" non-trivial. Even if NAT weren't in the way, your laptop's firewall might still drop the connection. With Tailscale, your tailnet traffic comes in via the Tailscale interface, which Tailscale's installer automatically allows — so you don't have to fight your firewall too.
4Two common firewall locations
You'll encounter firewalls in two places that matter:
- Your router's firewall — what L4 was about. Drops incoming connections by default. Tailscale solves this by tunneling.
- Your OS firewall — macOS firewall, Windows Defender Firewall,
ufwon Ubuntu. Same idea, just at the OS level. When a service "doesn't seem to work," 50% of the time it's because the OS firewall is blocking the port.
Tailscale's installers configure the OS firewall to allow tailnet traffic. So you generally don't fight this. But if you're bringing up a new service (Ollama, Jellyfin) and it doesn't seem reachable, the OS firewall is the second thing to check.
5Try it
See what's listening on your local machine:
lsof -i -P -n | grep LISTEN # macOS / Linux
netstat -ano | findstr LISTEN # Windows
You'll see processes listed with the ports they're listening on. Now try connecting to one — if you have port 22 listening (SSH server enabled), you can ssh localhost and watch yourself connect to your own machine.
The aha: "open a port" really means "have a service listening AND a firewall that allows it AND a route that reaches it." All three. Tailscale handles the route. The firewall is usually pre-configured. Your job is just to run the service.