Skip to content
Snippets Groups Projects
Verified Commit 136aeec3 authored by Moritz Lammerich's avatar Moritz Lammerich
Browse files

fix dhcp on USB Ethernet being unreliable

This seems to have been caused by 2 issues:
- The service file was installed in network.target, but WantedBy was set to
  multi-user.target
- The usb0 interface (probably) was not initialized fully, since SystemD could not ping/arp the gateway
parent 77a28a44
No related branches found
No related tags found
No related merge requests found
[Unit]
Description=DHCPv4 Server Daemon
Documentation=man:dhcpd(8) man:dhcpd.conf(5)
After=network.target
After=time-sync.target
[Service]
PIDFile=@localstatedir@/run/dhcpd.pid
EnvironmentFile=@SYSCONFDIR@/default/dhcp-server
EnvironmentFile=-@SYSCONFDIR@/sysconfig/dhcp-server
ExecStartPre=@base_bindir@/touch @localstatedir@/lib/dhcp/dhcpd.leases
ExecStart=@SBINDIR@/dhcpd -f -cf @SYSCONFDIR@/dhcp/dhcpd.conf -pf @localstatedir@/run/dhcpd.pid $DHCPDARGS -q $INTERFACES
[Install]
WantedBy=multi-user.target
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
# for some reason appending to FILES does not work
# INSANE_SKIP_${PN} += "installed-vs-shipped"
FILES_${PN}-server_append = " \
/lib/systemd/system/network.target.wants/dhcpd.service \
/etc/systemd/system/network.target.wants \
/etc/systemd/system/network.target.wants/dhcpd.service \
/lib/systemd/system/dhcpd.service \
"
do_install_append() {
install -d ${D}/etc/systemd/system/network.target.wants
install -m 644 ${D}/lib/systemd/system/dhcpd.service ${D}/etc/systemd/system/
cd ${D}
ln -s etc/systemd/system/dhcpd.service etc/systemd/system/network.target.wants/dhcpd.service
}
\ No newline at end of file
SYSTEMD_AUTO_ENABLE_${PN}-server = "enable"
\ No newline at end of file
......@@ -2,6 +2,12 @@
Name=usb0
[Network]
Address=192.168.7.2/24
Gateway=192.168.7.3
DNS=8.8.8.8
DNS=0.0.0.0
[Address]
Address=192.168.7.2
[Route]
Destination=192.168.7.0/24
Gateway=192.168.7.2
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment