I want to have a DHCP server running on Arch Linux, but I'm having problems. I'm having an issue with getting dhcpd to start on boot. It will start ok when I manually run sudo systemctl start [email protected]
when I've logged in.
I'm running the latest version of Arch Linux (4.7.0-1) and I've followed the Arch networking wiki to get this set up.
My setup
- dhcpcd is disabled
I have used systemd-networkd to do the static ip (it is enabled), the config is (
/etc/systemd/network/wired.network
):[Match] Name=eth0 [Network] Address=10.0.0.2/24 Gateway=10.0.0.1
My
/etc/dhcpd.conf
is simple:option domain-name-servers 10.0.0.2; option subnet-mask 255.255.255.0; option routers 10.0.0.0.1; subnet 10.0.0.0 netmask 255.255.255.0 { range 10.0.0.5 10.0.0.50; }
I created my systemd service file (
/etc/systemd/system/[email protected]
) and enabled it withsystemctl enable [email protected]
:[Unit] Description=IPv4 DHCP server on %I Wants=network.target After=network-pre.target Before=network.target [Service] Type=forking PIDFile=/run/dhcpd4.pid ExecStart=/usr/bin/dhcpd -4 -q -pf /run/dhcpd4.pid %I KillSignal=SIGINT [Install] WantedBy=multi-user.target
When I reboot I get an error in the start up that says (when i run journalctl -xe
):
No subnet declaration for eth0 (no IPv4 addresses).
** Ignoring requests on eth0....
Then when I run systemctl start [email protected]
it all runs fine no problems.
I've done a lot of googling but found no solution to this issue. I've tried tweaking the files (dhcpd.conf
, [email protected]
and wired.network
) to hard code interfaces, add extra DHCP declarations, alter Unit wants etc and more; but nothing seems to work.