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 how to do it.

Iván· Published on · 2 minLeer en español →

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.
  • The 3D printer, and the dashboard that watches it lost its data.

In both cases the culprit was the same: the router hands out IPs via DHCP, and when a device restarts or is disconnected for a while, it can get a different one. For a phone it doesn’t matter. For something your programs connect to, it’s a problem.

The fix: a DHCP reservation

A DHCP reservation (called “static IP” on some routers) 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 it has two risks:

  1. 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.
  2. Your configuration is scattered: each device has its own. If you change routers, you have to go one by one.

With a reservation, everything lives in one place: the router.

How to do it on a FRITZ!Box

  1. Go to http://fritz.box.
  2. Open Home Network → Network → Network Connections tab.
  3. Find the device in the list and click the pencil to edit it.
  4. Tick “Always assign this network device the same IPv4 address”.
  5. 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.

Tips

  • Reserve the IP the device already has. That way nothing else needs changing.
  • If you’re changing it, restart the device (or unplug and replug it) so it requests the address again.
  • Write down which IP each thing has. I keep it on my home dashboard.
  • Even with a fixed IP, calling devices by name (nas.local) where possible is more robust still.

Which devices should get one?

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… Your phone or TV don’t need one.

Five minutes on the router saves you the afternoon of “why has this stopped working if I didn’t touch anything?”.

Mini quiz

Did it stick?

Three quick questions. Each right answer is worth 10 XP.

  1. What is a DHCP reservation?
  2. Why is it better than setting the IP by hand on the device?
  • #networking
  • #dhcp
  • #router
  • #fritzbox
  • #homelab
Esc