Fixed IP with a DHCP reservation: why I needed it (twice)
My NAS and my 3D printer changed IP and broke the backups and a dashboard. What a DHCP reservation is, why it beats setting the IP by hand, and its traps.
In one month, two devices in my home changed IP without warning:
- The NAS, and the Raspberry Pi’s backups failed three nights in a row because they were looking for it at the old address. Nobody noticed until I set up Uptime Kuma alerts.
- The 3D printer, and the dashboard that watches it lost its data.
Both times the culprit was the same: the router hands out IPs via DHCP, and when a device reboots or stays offline for a while, it may get a different one. For a phone, who cares. For something your programs connect to, it’s a problem.
The fix: a DHCP reservation
A DHCP reservation (some routers call it a “static IP”) is a rule on the router: “always give this device this IP”. The router recognises it by its MAC address, a unique identifier of its network card.
Why not just set the IP by hand on the device?
You can, but there are two risks:
- If you pick an IP inside the range the router hands out, one day it may give it to another device, and the two will clash.
- Your configuration ends up scattered: each device with its own. If you change routers, you have to go one by one.
With a reservation, everything lives in one place: the router.
Confession: with the NAS I did exactly what I’m telling you not to do. I set the IP by hand in its own admin panel, and one that fell inside the DHCP range. It worked, but only because I got lucky. I fixed it by reserving that same IP on the router, so it can’t be handed to anyone else.
1. Check which range your router hands out
Before touching anything, open the DHCP settings and write down the range. Mine hands out .20 to .200, with 10-day leases. That leaves me two zones:
- Inside the range: devices with a reservation. The router knows those IPs are taken.
- Outside the range (.2 to .19 in my case): things I configure by hand, like the Raspberry Pi. The router never hands those out, so there’s no possible clash.
Both approaches are fine. What isn’t fine is a manual IP inside the range with no reservation.
2. Identify the device
Sounds easy, but my FRITZ!Box list is full of names like PC-A4-5E-60-…: lots of devices don’t say what they are. Two tricks that have worked for me:
-
Unplug it and see which line disappears from the list. That’s how I found my weather station.
-
Look for a port only that device opens. My 3D printer speaks MQTT on 1883, so from the Pi I sweep the network for that port:
nmap -p 1883 --open 192.168.1.0/24Whatever shows up with 1883 open is almost certainly the printer. If you want to see what a machine is listening on from the inside, I cover it in what’s listening on each port.
Once you have it, give it a decent name on the router. In a month you won’t remember what PC-3C-71-BF… was.
3. Make the reservation (on a FRITZ!Box)
- Go to
http://fritz.box. - Open Home Network → Network and find the device in the list.
- Click the pencil to edit it and open the Home Network tab.
- Tick “Always assign this network device the same IPv4 address” (the wording varies a little between FRITZ!OS versions and languages).
- Apply.
On other routers it’s called “address reservation”, “static DHCP” or “fixed IP by MAC”. It’s usually in the LAN or DHCP section.
Reserve the IP the device already has. That way nothing else needs changing. If you do change it, reboot the device (or unplug and replug it) so it asks again.
The trap: the reservation follows the MAC, not the device
This one caught me with the printer. Its reservation was in place, all good, and one day it vanished again. Turns out I’d moved it from Wi-Fi to a cable, plugged into one of the mesh nodes. Each network card has its own MAC, so to the router it was a brand new device: it got a random IP from the range, and my reservation was left pointing at a MAC that no longer connected.
Lesson: if you change how a device connects (Wi-Fi ↔ cable, a different adapter), redo the reservation with the new MAC. And delete the old one once you’re sure, so junk doesn’t pile up.
What about calling them by name?
The first version of this article said that using the name (home-nas.local) was even more robust than the IP. Experience corrected me: right after changing the NAS’s IP, home-nas.local stopped resolving from the Pi. .local names work over mDNS, meaning the device announces itself on the network, and that fails more often than you’d think (network changes, Wi-Fi meshes that don’t pass those announcements well…).
Now my backup scripts, the dashboard and Uptime Kuma all use the reserved IP. If I ever run a local DNS at home, I’ll go back to names, but served by a real DNS, not by mDNS.
Which devices would I reserve?
Anything other programs look up by IP: the server (Raspberry Pi), the NAS, printers (paper and 3D), cameras, the laptop if you SSH into it, a Proxmox server… Your phone or TV don’t need one.
What not to do
- Set an IP by hand inside the DHCP range without reserving it on the router.
- Make the reservation and forget it follows the MAC: if the device changes card or goes from Wi-Fi to cable, the reservation no longer applies.
- Trust
.localnames in scripts that run unattended at 3 a.m. - Not write down which IP each thing has. I keep mine in my command center.
Summary
- Check your router’s DHCP range.
- Identify the device (by unplugging it or by a port only it opens) and name it.
- Reserve the IP it already has.
- If it moves from Wi-Fi to cable, redo the reservation with the new MAC.
- In scripts, prefer the reserved IP over a
.localname.
Five minutes on the router saves you the afternoon of “why did this stop working when I didn’t touch anything?”.
Did it stick?
Three quick questions. Each right answer is worth 10 XP.