Plan and install

Give the server a stable address

Reserve an address through the router and verify the server keeps correct gateway and DNS configuration.

10 minute lesson

~~~

Services need a stable destination. If the server’s address changes after a power cut, every bookmark, mount, and SSH config pointing at it breaks.

A DHCP reservation is the clean fix. The router keeps managing addresses centrally, but always hands this one machine the same address. You configure nothing on the server itself.

Record the current state

Record the current lease and route:

ip address
ip route
resolvectl status

Note four things: the interface name (something like enp3s0), the current address, the default gateway from ip route, and the DNS servers from resolvectl status. The MAC address appears in the ip address output as link/ether, and it’s what the router uses to recognize this machine.

Create the reservation

Log into the router’s admin interface and find the DHCP or LAN settings. Create a reservation binding the server’s MAC address to an address, for example 192.168.1.50.

Then make the server pick it up. The simplest reliable way is a reboot in a maintenance window:

sudo reboot

When it comes back, verify the reservation took effect:

ip address
ip route

You want the reserved address on the interface, and the same gateway and DNS as before. Then confirm from another device that ssh [email protected] still works. If nothing changed, the old lease may not have expired yet; renew or reboot again after it does.

Why not just set a static address?

You can configure a static address directly on the server, but there’s a trap. Avoid placing an arbitrary static address inside the DHCP pool. The router doesn’t know you took it, and will eventually hand the same address to another device.

Duplicate addresses create intermittent failures: connections that work, then stall, then work again, depending on which machine answered last. It’s one of the most confusing things to debug on a home network. The reservation avoids the whole category, because the router stays the single owner of the address plan.

Lesson completed

Take this course offline

Get every free book and course as PDF and EPUB files.

Get the download library →