This guide will go over installing ISC dhcpd
and using a custom systemd
service for both v4 and v6 services (instead of the included one).
Install with APT
apt install isc-dhcp-server
Disable and Mask the included systemd
service file
systemctl stop isc-dhcp-server.service && \
systemctl disable isc-dhcp-server.service && \
systemctl mask isc-dhcp-server.service
Create a new systemd
service for dhcpd v4
bash -c "cat > /etc/systemd/system/dhcpd-v4.service"<<'EOF'
[Unit]
Description=ISC DHCPv4 Server Daemon
Documentation=man:dhcpd(8) man:dhcpd.conf(5)
Wants=network-online.target
After=network-online.target
After=time-sync.target
[Service]
Type=exec
Restart=on-failure
RestartSec=60
User=root
Group=root
ExecStart=/usr/sbin/dhcpd -4 -f -cf /etc/dhcp/dhcpd.conf --no-pid $DHCPARGS
StandardError=null
[Install]
WantedBy=multi-user.target
EOF
Reload and start the v4 dhcpd
service
systemctl daemon-reload && \
systemctl enable --now dhcpd-v4.service