Introduction
This page describes how Alexis Huxley installed and configured his DHCP server.
Procedure
- Install the packages required for the DNS server by running:
apt-get install isc-dhcp-server
- Edit /etc/default/isc-dhcp-server and set:
INTERFACESv4="eth0"
(Without this dhcpd will start but the IPv4 server and the IPv6 server.)
- Edit /etc/dhcp/dhcpd.conf to contain something like:
ddns-update-style none; authoritative; log-facility local7; subnet 192.168.1.0 netmask 255.255.255.0 { option domain-name "pasta.net"; option domain-name-servers 192.168.1.21; option ntp-servers time.pasta.net; option routers 192.168.1.1; # I reserve 192.168.1.101-120 for *known* hosts booting from DHCP. which I list below. pool { range 192.168.1.151 192.168.1.160; allow unknown-clients; deny known-clients; } } # Host declarations #host examplehost { hardware ethernet aa:bb:cc:dd:ee:ff; fixed-address examplehost.pasta.net; }
- The dhcp server might have a problem with leaving locks and failing to detect if they are stale or not (this was my experience with version 4.4.1). Therefore run:
pkill dhcpd rm -f /var/run/dhcpd.pid
- Start dhcpd with:
systemctl start isc-dhcp-server
- Test!