Map a MAC to a predictable IP with concrete isc-dhcp-server and dnsmasq examples to follow. 20.12.2025 | reading time: 3 min Want a predictable IP for a server or printer? This short guide shows how to create a static DHCP reservation on Linux so a given MAC always gets the same IP, and how to verify the result using isc-dhcp-server and dnsmasq examples. Hands-on: isc-dhcp-server example Create a host reservation by editing the server config and restarting the service; example commands and expected output follow: ```sudo tee /etc/dhcp/dhcpd.conf > /dev/null <<'EOF' subnet 192.168.1.0 netmask 255.255.255.0 { range 192.168.1.100 192.168.1.200; option routers 192.168.1.1; option domain-name-servers 8.8.8.8; } host printer1 { hardware ethernet aa:bb:cc:dd:ee:ff; fixed-address 192.168.1.150; } EOF sudo systemctl restart isc-dhcp-server sudo systemctl status isc-dhcp-server --no-pager ``` Expected status output will include an "active (running)" state for the service; if errors appear, check `/var/log/syslog` or `journalctl -u isc-dhcp-server` for parsing problems in the config. Quick dnsmasq alternative If using dnsmasq add a single dhcp-host line and restart; example: ```echo "dhcp-host=aa:bb:cc:dd:ee:ff,192.168.1.150,printer1,24h" | sudo tee /etc/dnsmasq.d/static-hosts.conf >/dev/null sudo systemctl restart dnsmasq sudo systemctl status dnsmasq --no-pager ``` dnsmasq will hand out the specified IP to the MAC and the config line is small and easy to manage for small networks. Verify the lease and check the device Confirm the reservation by inspecting the lease file or the server logs; example commands and sample output: ```sudo grep -i aa:bb:cc:dd:ee:ff /var/lib/dhcp/dhcpd.leases || true # sample matching line from dhcpd.leases: "lease 192.168.1.150 {\n starts 3 2025/12/21 12:00:00;\n ends 3 2025/12/21 18:00:00;\n hardware ethernet aa:bb:cc:dd:ee:ff;\n client-hostname \"printer1\";\n}" sudo ip neigh show | grep 192.168.1.150 || true ``` The grep output shows the assigned IP and the lease record; if the device holds a different address, release/renew the client DHCP lease on the device. Practical notes and common pitfalls Always ensure the reserved IP is inside the same subnet and preferable outside the dynamic range, or adjust the range so the server will not hand that address to another client; use consistent MAC formatting (lowercase, colon-separated) and remember DHCPv6 uses different syntax; also consider client identifiers and security risks such as MAC spoofing, and reload or restart the daemon after changes to apply them. Finish line A static DHCP reservation avoids client-side configuration and keeps network management centralised; try both isc-dhcp-server and dnsmasq to see which fits the environment, then practice verification and edge cases on a lab host; consider studying for CompTIA Linux+ or LPIC-1 and use bitsandbytes.academy for intensive exam preparation to deepen Linux skills. Join Bits & Bytes Academy First class LINUX exam preparation. network infrastructure troubleshooting