I did setup hostapd and udhcpd for my wlan0. After startup, the hostapd is running and I see the ssid with another device, but I don't receive a dhcp address. Well, I can't, because the udhcpd is not running, and systemctl status udhcpd.service claims:

● udhcpd.service - LSB: Start busybox udhcpd at boot time
   Loaded: loaded (/etc/init.d/udhcpd)
   Active: active (exited) since Thu 2017-03-16 14:24:06 CET; 7min ago
  Process: 611 ExecStart=/etc/init.d/udhcpd start (code=exited, status=0/SUCCESS)

Mar 16 14:24:06 testo-mx6 systemd[1]: Starting LSB: Start busybox udhcpd at boot time...
Mar 16 14:24:06 testo-mx6 systemd[1]: Started LSB: Start busybox udhcpd at boot time.
Mar 16 14:24:06 testo-mx6 udhcpd[611]: Starting very small Busybox based DHCP server: udhcpd.

Active, but exited? And why did it exit? I tried a bunch of restarts and interface resets and finally found this script to be reliable:

systemctl stop udhcpd.service
systemctl stop hostapd.service
ifdown wlan0
ifup wlan0
sleep 1
systemctl start udhcpd.service

Now everything is running as expected. But using this script is a nasty workaround. I want the services to start up as supposed.

My /etc/udhcpd.conf looks like

start    #default:
end     #default:
interface       wlan0           #default: eth0
max_leases      2               #default: 254
siaddr   #default:
sname           foobar          #default: (none)
option  domain  local
option  lease   864000          # 10 days of seconds

And /etc/network/interfaces

auto wlan0
iface wlan0 inet static
    hostapd /etc/hostapd/hostapd.conf

And in case it is relevant also the /etc/hostapd/hostapd.conf:


I tried to put a sleep in the /etc/init.d/udhcpd startup (seemed to have helped in another posting I found), but to no avail.

2 Answers 2


I had this problem on a system with an Atheros wifi card that didn't come up quickly enough for either systemd or udhcpd. It is extremely frustrating to diagnose, since there are several layers of abstraction involved. Here's what I did to fix it:

Add export _SYSTEMCTL_SKIP_REDIRECT=1 near the top of /etc/init.d/udhcpd, after the LSB header. This disables one layer of systemd abstraction and allows the sysv startup script to function more normally.

Add sleep 30 to the beginning of the start) section of /etc/init.d/udhcpd. This gives some time for the wifi interface to come up before starting the DHCP server. Otherwise, it will just quietly exit.

Once it's working, you can adjust the sleep time downward.


I had the same issue with atheros wifi card associate to a bridge, the udhcpd server run on br0. udhcpd seem to start before br0 came up. My solution was to let in /etc/default/udhcpd DHCPD_ENABLED to "no" and add the following network configuration to /etc/network/interfaces for br0 :

    post-up /usr/sbin/udhcpd -S /etc/udhcpd.conf

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .