1. Addresses — Where Things Live
“An address tells you where a thing is. It tells you nothing about whether you are welcome.”
The story: the phone that could not find the laptop
Section titled “The story: the phone that could not find the laptop”It is half past eleven on a Tuesday night in Pune. Your laptop is running npm run dev, the Next.js app you have been building since dinner. The new booking form for the dance academy is half done, and you want a friend to try it on her phone. She is on the same Wi-Fi, two rooms away on the sofa. You type the address you would type into your own browser, the one with a port number on the end, and wait.
Nothing. Then a spinner. Then the browser says the site cannot be reached.
You check the terminal. The server says it is ready on port 3000. You check the laptop’s browser, and it works, of course. It always works on the laptop. Somewhere in your head a small voice says the thing every developer has said at least once: it works on localhost.
The next evening she tries the same link over mobile data instead of Wi-Fi, and it fails differently. It fails the way a courier fails when he rings the bell of the flat next to the lift, and nobody in the building has heard of you. The laptop is right there. The address is right there. Nothing connects.
Both failures come from the same place, and the answer is not in your code. It is in addresses. An address is the one thing every machine on a network must have, and the one thing most people get wrong about their own machines. This chapter covers what an address is, why there are so few of the old kind, why your laptop has an address that is not really its own, and why the same trick that stopped the internet running out of numbers can make hosting from home quietly impossible.
Nothing here needs a lab to be understood. The lab at the end just turns the ideas into things you can check on your own network.
What an address is, and why there are so few of the old kind
Section titled “What an address is, and why there are so few of the old kind”An IP address is the street address of a machine on a network. Like a street address, it is a label that lets someone else find you. It is not your name, which is what DNS does and what Chapter 10 is about. It is not a door either. Doors are ports, and they get their own chapter in Chapter 3. The address picks the building. The port picks the door once you are inside.
The old kind is IPv4, the one you have seen a hundred times in logs and error messages. An IPv4 address is 32 bits, written as four numbers from 0 to 255 with dots between them. Each of those numbers is called an octet, because it is eight bits.
Thirty-two bits sounds small, and in one sense it is. The number of possible addresses is two to the power of 32, a little over four billion. The version we still use was specified in 1981, when the whole network had a few hundred machines on it. Four billion looked like a number nobody would ever come near. Nobody had a phone that could browse anything yet.
How we ran out
Section titled “How we ran out”Addresses were handed out in large blocks, and many early holders kept far more than they needed. Then came the web, then the mobile phone, then a laptop in every bag and a router in every flat. The central pool of unassigned IPv4 addresses ran out around 2011, and the regional registries that hand addresses to ISPs and companies ran dry over the following few years. Treat the exact years as roughly right. The shape is not in doubt. There are not enough IPv4 addresses for every device that wants one.
Two things stopped the internet from grinding to a halt. The first was NAT, which lets a whole house share a single address. You will meet it properly in a few pages. The second was IPv6, the proper fix, specified in the late 1990s.
IPv6, and why it looks so strange
Section titled “IPv6, and why it looks so strange”An IPv6 address is 128 bits. That is not four times as many addresses as IPv4. It is two to the power of 96 times as many. The usual comparison is that you could give every grain of sand on Earth its own address and still have room to spare. It is a cheap comparison, and it is accurate enough.
An IPv6 address is written as eight groups of four hexadecimal digits, separated by colons:
2001:0db8:0000:0000:0000:ff00:0042:8329Two rules shorten it, and you will see the short form everywhere. Leading zeros in each group can be dropped, and one run of all-zero groups can be replaced by a double colon, once only. The address above becomes:
2001:db8::ff00:42:8329The 2001:db8::/32 block is the documentation range, reserved for examples like this one, so it will appear in this book as a stand-in for real addresses. In your own life, your ISP hands your home a prefix, often a /56 or a /64 (the next section explains what those numbers mean), and your devices pick their own addresses inside it.
Why has IPv6 not taken over? Because every link in the path has to support it: your router, your ISP, your cloud provider, your operating system, and the software you wrote. NAT made the pressure bearable, and “good enough” is a powerful brake. Adoption has crept up for years. By the mid-2020s a large share of traffic to the big content networks arrives over IPv6, and some Indian mobile networks are among the heaviest users anywhere, if memory serves. Treat that as a rough picture, not a number to quote in a meeting.
This shows up in your DNS. A domain can point to an IPv4 address with an A record and to an IPv6 address with an AAAA record. If the AAAA record points at a machine that is not listening, some visitors on some networks will see a site that hangs before it loads. The failure looks random because it depends on which network the visitor is on. It is not random. It is a second address that nobody answers.
Public and private addresses: who can reach whom
Section titled “Public and private addresses: who can reach whom”Your laptop almost certainly has a private address right now, something like 192.168.1.7. Ask the wider internet to deliver a packet to that number and nothing useful happens. The routers that carry traffic between networks look at the destination, find no route for it, and throw the packet away.
Addresses come in two kinds. A public address is one the wider internet knows how to reach. A private address is one set aside for use inside a single network, and the routers that link networks are built to ignore it. Anybody can use a private address and nobody owns one, which is exactly why millions of flats in Pune can each have a device at 192.168.1.7 without a clash.
There are three private ranges, reserved by the standards:
10.0.0.0to10.255.255.255, written10.0.0.0/8. Large private networks and many cloud networks use it.172.16.0.0to172.31.255.255, written172.16.0.0/12. Less common at home. Docker’s default networks often sit here.192.168.0.0to192.168.255.255, written192.168.0.0/16. The one your home router almost certainly uses.
You do not need to memorise the table. You need to recognise the shape. A 10., a 192.168., or a 172. followed by a number from 16 to 31 is private. Almost everything else you will meet in a log is public, with a few special cases you will meet shortly.
Your laptop is not on the internet
Section titled “Your laptop is not on the internet”Your laptop has an address. It is not reachable from the internet. Those are different claims, and most of the confusion in this chapter comes from treating them as one.
The thing that holds the public face of your home is the router. In the lab’s home network that address is 198.51.100.23. Everything outside sees that one address, the way a gated society has one entry on the street. Inside, the router hands out private addresses, and the laptop’s 192.168.1.7 is valid only in there.
Now the story makes sense. If the link you sent your friend pointed at localhost, it pointed at her phone, where nothing listens on port 3000. If it pointed at your home’s public address, it reached the router, and the router had no rule telling it to pass port 3000 through to your laptop. On mobile data her phone was on a different network altogether. The address 192.168.1.7 meant nothing to it, and the public address had no door open. The laptop was fine. The laptop was never reachable from there.
On the same Wi-Fi, though, a private address does work. Her phone sat inside the same private network, so 192.168.1.7 was a real address to it. Two causes, one symptom: either the address was wrong, or the server was not listening where the address pointed.
That second cause is the bridge to Chapter 3. A server reaches only the addresses it is told to listen on. Bound to 127.0.0.1, it hears only the laptop talking to itself. Bound to 0.0.0.0, it listens on every address the laptop has, including 192.168.1.7, and the phone on the sofa can knock. The laptop was right the whole time, which is why “it works on localhost” is such a cursed sentence.
CIDR and subnets: how big is that block?
Section titled “CIDR and subnets: how big is that block?”Somewhere in your hosting provider’s firewall form there is a box labelled “source”. It wants 203.0.113.0/24, and you type it in the way you would follow a recipe that says “a pinch of salt”. The slash is the part nobody explains. What does the number after it do, and why would anyone name a block of addresses instead of one?
Every firewall rule and every routing table eventually asks you to name a set of addresses rather than a single one. The set might be one laptop, one office, one cloud network, or the whole internet. The notation for all of them is CIDR, and it is the one piece of arithmetic in this chapter you will use most weeks.
CIDR stands for Classless Inter-Domain Routing, which is a mouthful for an idea that fits on the back of a chai-stall receipt. An address followed by a slash and a number names a block. The number counts how many bits, starting from the left, stay fixed. Those are the network bits. The rest are host bits, and they are free to take any value across the block. So 203.0.113.10/24 says the first 24 bits are fixed and the last 8 are free.
Why blocks, and not just addresses
Section titled “Why blocks, and not just addresses”The reason is routing. A router deciding where to send a packet does not care about individual addresses. It cares about prefixes. A router that knows the way to 203.0.113.0/24 knows the way to all 256 addresses inside it, and it holds one line in its table to do so. Without blocks, the global routing table would need one entry per address ever assigned, and nobody could carry that. Blocks are why the table is merely enormous rather than impossible.
CIDR arrived in the early 1990s, if memory serves, to replace an older scheme of fixed classes that wasted addresses and bloated the tables. The classes are history now, but the word “classless” in the name is the scar. Any prefix length is allowed, not one of three fixed sizes.
The sizing rule
Section titled “The sizing rule”A block with prefix length P contains 2 to the power of (32 minus P) addresses. That one formula is the whole table. The common sizes look like this:
/32is exactly one address. Firewall people call it a single host, and you will see it on rules that name one machine./24is 256 addresses. This is the size of a typical small subnet, and of the block your home router usually hands out inside your flat./16is 65,536 addresses. A medium company network, or the default range many cloud accounts start with./8is about 16.7 million addresses. The entire10.0.0.0/8private range is a single /8 block./0is every IPv4 address there is, all 4.3 billion of them.
Each step down in the slash doubles the block, and each step up halves it. If you remember nothing else about the notation, remember that. A /23 is twice the size of a /24 and half the size of a /22.
Reading a block
Section titled “Reading a block”Within any block, the first address and the last address have special jobs. The first address, with every host bit set to zero, is the network address. It names the block itself, and no machine should be given it. The last address, with every host bit set to one, is the broadcast address. Classic subnets reserve both.
For 203.0.113.10/24, the network address is 203.0.113.0, the broadcast is 203.0.113.255, and the addresses a host can take run from 203.0.113.1 to 203.0.113.254. That is 254 usable addresses in a block of 256. Clouds reserve a few more in every subnet they create, so when you carve a network in a cloud console, read that provider’s documentation rather than trusting the arithmetic on this page.
You will also meet subnet masks. The mask for a /24 is 255.255.255.0. It is the same information written differently: 24 ones followed by 8 zeros, dotted into four groups. The slash form is shorter and is what most modern tools print, so this book uses it.
What the slash means in a firewall
Section titled “What the slash means in a firewall”A rule that says “allow SSH from 203.0.113.0/24” lets 256 addresses through and blocks the rest. That is what you want when the source is your office. Narrow it to 203.0.113.10/32 and only that one machine gets in. Widen it and the rule becomes a statement about strangers.
The widest rule is 0.0.0.0/0. Its prefix length is zero, so none of the 32 bits are fixed, and the block is every IPv4 address there is. Firewalls often describe it as “anywhere”. A rule that allows SSH from 0.0.0.0/0 is allowing SSH from the whole internet, including every machine currently scanning for open SSH servers. Those scanners are weather, not people, and you will meet them properly in Chapter 15. For now, read every /0 the way you would read a door that opens onto the street.
The IPv6 equivalent is ::/0. The same idea, with a much bigger space.
Try it: the subnet visualiser
Section titled “Try it: the subnet visualiser”The block you just read is easier to see than to describe. Type in an address, slide the prefix from /0 to /32, and watch the bit strip change. The presets cover the blocks you will meet most often.
Try it: how big is that block?
Static fallback: the slash counts the fixed bits. For a /24 the first 24 bits name the network and the last 8 bits, 256 addresses, belong to hosts. A firewall rule with a /24 source allows 256 addresses. A /32 allows one, and 0.0.0.0/0 allows all of them.
Check the sentence under the output. A firewall source of 0.0.0.0/0 should report roughly 4.3 billion addresses. A /32 should report exactly one.
NAT: how fifteen devices share one address
Section titled “NAT: how fifteen devices share one address”Count what is online in your flat right now. Laptop, phone, the spare phone in the drawer, the TV, the printer, the doorbell, the tablet a nephew borrows, and probably a few things you have forgotten. Fifteen is an ordinary number. Your home has one public address. Nothing in that arithmetic should work, and yet every one of those devices reaches the internet without complaint.
The trick is NAT, network address translation. Your router holds the one public address and rewrites traffic on its way out. Each outgoing packet has its source changed from your laptop’s private address to the router’s public one. The router also changes the source port, a second number that works a little like a ticket number. Chapter 3 explains ports properly. For now, the point is that each device gets a different ticket, so the router can tell the replies apart.
The router keeps a ledger. Every time a device starts a conversation, the router writes a line: this private address and port went out as that public port. When a reply comes back to the public address, the router finds the port in the ledger and forwards the packet to the device that asked.
NAT was a stopgap. It spread in the late 1990s, roughly, as home routers became cheap and IPv4 addresses ran short. It stuck because it worked, and because it meant nobody had to ask their internet provider for fifteen public addresses. The city version is the gate guard in a gated society. He does not read anyone’s post. He keeps a register of who went out, so that replies from the shops find the right flat.
Read the figure left to right. The laptop’s conversation leaves as 198.51.100.23:50412, not as 192.168.1.7. The server replies to that public address and port, and nothing in its view says anything about your flat. The ledger does the rest.
What NAT does as a side effect
Section titled “What NAT does as a side effect”The ledger only has lines for conversations a device started. A packet from the internet that matches no line has nowhere to go, so the router drops it. That is why your laptop stays quiet from outside even though it runs a dev server. Nothing asked for the incoming packet, so there is no line for it.
The same ledger means your laptop is unreachable unless you write a line for it by hand. That hand-written line is called port forwarding. It is a door cut into the gate, and it stays cut until someone removes it.
On a cloud VPS the picture is simpler and stranger. The provider maps your public address one-to-one onto the machine’s private address, and you never see the translation. You open doors with firewall rules rather than ledger lines. Chapter 16 shows how a tailnet lets two machines behind NAT reach each other without a port forward at all.
CGNAT: a gated society inside a township
Section titled “CGNAT: a gated society inside a township”Sometimes the gate you think is the outer one is not. Carrier-grade NAT, or CGNAT, runs the same trick one layer up. Your internet provider takes thousands of customers, puts them behind a small set of shared public addresses, and does the translation at its own gate. Your router then sits behind the provider’s gate, and its own WAN address comes from a block set aside for exactly this job: 100.64.0.0/10.
That block runs from 100.64.0.0 to 100.127.255.255. It is about four million addresses. It is not private in the 10.x sense, and it is not routable on the public internet. It is a middle space, reserved so that a provider can hand addresses to its customers’ routers without colliding with anything real.
Why would a provider do this? IPv4 ran out, and a carrier cannot give every subscriber a public address of their own. As of the mid-2020s, many mobile connections in India, and some home broadband plans including some from Jio and Airtel, sit behind CGNAT. It varies by plan and by city, so check your own line rather than trusting a rule of thumb.
Read it as two ledgers. Your router keeps a ledger for your flat, and it is correct about your flat. The ISP keeps a ledger for the whole township, and your router’s line is a single entry among thousands. When a reply comes back to the shared address, the ISP looks up the port, finds the right router, and passes it on. Outbound browsing works perfectly. That is why people with CGNAT rarely notice anything until they try to host something.
The trouble is the other direction. A port forward on your router writes a line in your router’s ledger. An inbound packet never reaches your router in the first place, because the ISP’s gate has no line that points to your home. You cannot write into the ISP’s ledger. This is why “host it from home” dies on some plans and works on others, and why the fix is a tunnel or a small VPS, not a better router. Chapter 17 shows one way to dig a corridor outward through that gate.
Special addresses: the ones with jobs
Section titled “Special addresses: the ones with jobs”Most addresses name one machine. A few have jobs, and they show up in every config file you will ever open.
127.0.0.0/8, and the name localhost. This is the machine talking to itself. A packet sent to 127.0.0.1 never leaves the network card. When your browser opens localhost:3000, nothing crosses the flat and nothing reaches the router. The name localhost normally resolves to 127.0.0.1. Chapter 10 covers how names become addresses.
::1 is the IPv6 version of the same idea: one address, loopback, the machine talking to itself.
0.0.0.0 has two jobs, and mixing them up causes most of the early pain.
- As a bind address, it means “listen on every address this machine has”. A server bound to
0.0.0.0:3000answers on loopback, on the Wi-Fi address, and on anything else the machine owns. Chapter 3 makes this precise. - As a route,
0.0.0.0/0means “everything that no more specific rule matched”. It is the default route in a routing table. In a firewall rule, as a source, it means “anywhere”. The same four zeros mean opposite things. One says “accept on all my doors”. The other says “all of the world”.
:: is the IPv6 twin of 0.0.0.0 for binding: listen on every address.
One more you will see in logs is 169.254.0.0/16, with fe80::/10 in IPv6. A device gets one of these when nobody handed it a real address. If you see one on your laptop, something upstream failed to hand out an address, and the rest of this chapter will not help until you fix that first.
Static, dynamic, and reserved addresses
Section titled “Static, dynamic, and reserved addresses”Addresses come in three kinds of permanence, and mixing them up is a classic way to get a 2 a.m. call.
Your laptop’s private address is usually dynamic. Your router hands it out by DHCP as a lease that renews on its own. The address normally stays put, but it can change after a long sleep or a router reboot. Nobody outside your house cares, so nobody notices.
Your home’s public address is also usually dynamic, handed out by your ISP. It can change when the modem reconnects. A domain pointing at your home IP will break on some ordinary day, and the story you tell yourself afterwards will be about DNS.
A cloud VPS is different. On most clouds the public address you get with an instance is ephemeral: it lasts while the instance stays in its current state. Stop the machine, start it again, and you may get a new one. The fix is a reserved address, which you hold on your account and attach to an instance. AWS calls it an Elastic IP. Other clouds say reserved or static IP, and the names and screens change, so check your provider’s console.
The rule to pin on the wall: point DNS at a reserved address, never at an ephemeral one. In this book, the lab VPS at 203.0.113.10 is treated as reserved, and pipeslab.in points at it.
Some addresses are never handed to a host as an ordinary address at all. 127.0.0.0/8 is loopback, 169.254.0.0/16 is the link-local range your laptop falls into when DHCP fails, and 100.64.0.0/10 is the shared CGNAT space. Seeing one of these on your own machine is a diagnosis, not an address to keep.
The lab: find your three addresses and catch a CGNAT
Section titled “The lab: find your three addresses and catch a CGNAT”Goal: know the three addresses that matter for your home network, and decide whether your home connection can accept inbound traffic at all.
Conceptual steps:
- Find your laptop’s private address on Wi-Fi. Write it down, and note which network interface carries it.
- Find the public address the internet sees for your laptop. The
hello-pipesapp on the lab VPS prints the client IP it receives, which is a good stand-in for your home’s public address. - Log in to your router’s admin page and find its WAN address, the one facing the internet.
- Compare the two. If the WAN address is a private range such as
192.168or10.x, you have a second router in front of the first. If it sits in100.64.0.0/10, you are behind CGNAT. If it is public but differs from step 2, something else, such as a VPN or a carrier layer, sits between you and the internet. - Repeat on your phone with Wi-Fi off, on mobile data. Note the public address the lab VPS sees. On a carrier like Jio or Airtel, that address may be shared with many other customers.
- Run a small dev server bound to all interfaces, then bound to loopback only. Try each from the phone on the same Wi-Fi.
How you’ll know it worked: you can name your laptop’s private address and say why it is not a route into your house. You can say whether you’re behind CGNAT from the WAN address alone. Before testing step 6, you can predict that the phone reaches the dev server on Wi-Fi only when the bind address is 0.0.0.0, and never over mobile data. If the phone cannot reach your laptop over mobile data even with 0.0.0.0, that is the correct answer, not a bug. Chapter 3 takes up binding and ports properly, and Chapter 17 is what you do when CGNAT is the answer.
What you now know
Section titled “What you now know”You can now answer the question that opened this chapter. The phone cannot reach the laptop because the laptop’s address only means something inside your flat, and the phone on mobile data is standing on a different street entirely.
- An IP address is a street address. IPv4 has 32 bits, which ran out. IPv6 has 128 bits, and adoption is slow because NAT kept the old world working.
- Three private ranges, 10/8, 172.16/12 and 192.168/16, are for use inside a building. Packets from them do not route across the public internet.
- A CIDR prefix says how many leading bits name the network. A /24 holds 256 addresses, a /32 holds one, and a /16 holds 65,536.
0.0.0.0/0means every IPv4 address. In a firewall rule it is the whole street.- NAT is a ledger keyed by port that lets many devices share one public address. CGNAT moves that ledger up into the carrier, so you may not own a public address at all.
- Loopback,
0.0.0.0as a bind,::1and::each have a job. Binding to 127.0.0.1 hides a server from the Wi-Fi. Binding to 0.0.0.0 listens on every interface.
That was a lot of arithmetic and a lot of routers. Well done. Packets, the next chapter, is where these addresses start to move.
Self-quiz
Section titled “Self-quiz”1. How many addresses are in a /24, and what is the last usable address in 203.0.113.0/24?
256 addresses. The network address 203.0.113.0 and the broadcast address 203.0.113.255 are reserved, so the last usable address is 203.0.113.254.
2. Which private range does 172.20.4.9 belong to, and is 172.32.0.1 private?
172.20.4.9 is inside 172.16/12, which runs from 172.16.0.0 to 172.31.255.255. 172.32.0.1 is just outside that range, so it is public.
3. What does a firewall rule with source 0.0.0.0/0 allow?
Every IPv4 address. The rule is only as narrow as the port and protocol written beside it.
4. Your phone is on mobile data and tries to open 192.168.1.7. Why does it fail?
192.168.1.7 is a private address on your home Wi-Fi. The mobile carrier has no route to it, and the address means nothing outside the flat. To reach the laptop you need a reachable public address or a private tunnel such as Tailscale (Ch 16).
5. A server binds to 127.0.0.1:3000 and another binds to 0.0.0.0:3000. Which one can a phone on the same Wi-Fi reach?
Only the second. 127.0.0.1 is loopback, so it accepts connections only from the same machine. 0.0.0.0 listens on every interface.
6. What is CGNAT, and why does it block hosting from home?
Carrier-grade NAT puts you behind a public address that your ISP controls and shares with other customers. Inbound connections from the internet never reach your router, so port forwarding on your router does nothing. The fix is an outbound tunnel (Ch 17).
Exercises
Section titled “Exercises”Warm-up 1. The range of a /23. What are the network address, broadcast address, first and last usable addresses, and total count for 10.20.30.0/23?
Answer
Network 10.20.30.0, broadcast 10.20.31.255, first usable 10.20.30.1, last usable 10.20.31.254, and 512 addresses in total.
Warm-up 2. Classify 100.100.50.2. Is it private, CGNAT, or public?
Answer
CGNAT. 100.64.0.0/10 runs from 100.64.0.0 to 100.127.255.255, and 100.100.50.2 falls inside it. It is not in the RFC 1918 private ranges, and it is not reachable from the internet.
Warm-up 3. One address. Which prefix length names a single address, and what would a firewall rule with 203.0.113.10/32 allow?
Answer
/32. The rule allows only 203.0.113.10, for example SSH from one office machine.
Lab 4. Find your three addresses. Find your laptop’s private address, the public address the internet sees for your laptop, and the WAN address on your home router.
Hint and model solution
Hint: on macOS, ipconfig getifaddr en0 shows the private address. On Linux, try ip -4 addr show. For the public address, run hello-pipes on the lab VPS and read the client IP it prints.
Model solution: the private address starts with 192.168, 10, or 172.16 to 172.31. The public address comes from the lab’s client IP. The router WAN address is on the router’s status page.
Lab 5. Detect CGNAT. Compare the router’s WAN address with the public address from exercise 4.
Hint and model solution
Hint: the router’s admin page is usually at 192.168.1.1. Look for a status or internet page.
Model solution: if the two match and the WAN address is public, you are probably not behind CGNAT. If the WAN address is 100.64.x.x, or private, or differs from the public address, a second NAT sits between you and the internet. Plans and cities vary, so check your own line.
Lab 6. Repeat on mobile data. Turn off Wi-Fi on the phone and check its public address the same way.
Hint and model solution
Hint: open hello-pipes from the phone on mobile data and read the client IP it prints.
Model solution: the phone’s public address differs from the laptop’s. Two different networks, two different streets. That is why a laptop address reached from home does not reach the laptop from outside.
Lab 7. The bind test. Start a small server on the laptop bound to 127.0.0.1, then bound to 0.0.0.0. Try each from the phone on the same Wi-Fi.
Hint and model solution
Hint: python3 -m http.server 8000 --bind 127.0.0.1 and then --bind 0.0.0.0. Use the laptop’s 192.168 address and port 8000 from the phone.
Model solution: the loopback bind is refused and the 0.0.0.0 bind answers. Over mobile data both fail, because the phone is on another network. That gap is what Ch 3 (binding and ports) and Ch 16 (tunnels) close.
Staff 8. A team tool behind CGNAT. Your eight-person status tool runs on a laptop in Pune. Two teammates are on CGNAT connections and cannot reach it. What do you propose?
Model answer
Do not port-forward, because the carrier’s NAT drops inbound traffic before your router sees it. Move the tool to the VPS (Ch 4), which has a public address you control. Or run an outbound tunnel from the laptop, such as Cloudflare Tunnel (Ch 17), or a private mesh such as Tailscale (Ch 16). Both work because the laptop starts the connection outward, and NAT ledgers always allow replies to outbound traffic.
Staff 9. Critique a rule. A colleague writes allow from 0.0.0.0/0 to port 22. What is wrong, and what would you write?
Model answer
The rule opens SSH to every IPv4 address. Scanners will find it quickly, and they rattle every doorknob, which is weather, not a personal attack. A better rule limits the source to your office or tailnet range, such as a /32 or a tailnet prefix, and keeps SSH on key-only logins (Ch 6), with the guard rules explained in Ch 14.
Book 2 of a series. Book 1: The Glue.