Page 1 of 1

dnsmasq: wlan0 not found

Posted: Thu Nov 23, 2017 8:01 am
by Alexandre34
Hello.
I try to create an access point with my Raspberry 3 with the new Raspian strech lite (2017-09-07-raspbian-stretch-lite.img)
In this version, we don't use the /etc/network/interfaces file. So most of the documentation on internet is obsolete.

My problem:
dnsmasq seems to start BEFORE the wlan0 interface is ready. So it fail:

Code: Select all

nov. 23 08:22:12 jlACE systemd[1]: Starting dnsmasq - A lightweight DHCP and cac
nov. 23 08:22:13 jlACE dnsmasq[514]: dnsmasq: vérification de syntaxe OK.
nov. 23 08:22:13 jlACE dnsmasq[535]: dnsmasq: interface wlan0 inconnue
nov. 23 08:22:13 jlACE systemd[1]: dnsmasq.service: Control process exited, code
nov. 23 08:22:13 jlACE systemd[1]: Failed to start dnsmasq - A lightweight DHCP
nov. 23 08:22:13 jlACE systemd[1]: dnsmasq.service: Unit entered failed state.
nov. 23 08:22:13 jlACE systemd[1]: dnsmasq.service: Failed with result 'exit-cod
If I restart later the service, everything is fine, and I can use my wlan0 access point to connect to the raspberry with ssh:

Code: Select all

  sudo systemctl restart dnsmasq.service
  dnsmasq.service - dnsmasq - A lightweight DHCP and caching DNS server
   Loaded: loaded (/lib/systemd/system/dnsmasq.service; enabled; vendor preset:
   Active: active (running) since Thu 2017-11-23 08:53:21 CET; 30s ago
I think (not sure) that this as something to do with the fact that raspian don't use any more the /etc/network/interfaces and the allow-hotplug wlan0 option.

Is there a way to say to dnsmasq to start AFTER wlan0 become ready to use ?

Re: dnsmasq: wlan0 not found

Posted: Thu Nov 23, 2017 8:03 am
by DougieLawson
Use a systemd service file with a suitable After=xxx.service clause.

Re: dnsmasq: wlan0 not found

Posted: Thu Nov 23, 2017 11:04 am
by Alexandre34
Finally, I found my mistake: I must use bind-dynamic in /etc/dnsmasq.conf

Code: Select all

interface=wlan0      # Use interface wlan0
bind-dynamic         #
server=8.8.8.8       # Forward DNS requests to Google DNS
domain-needed        # Don't forward short names
bogus-priv           # Never forward addresses in the non-routed address spaces$
dhcp-range=192.168.2.10,192.168.2.50,12h # Assign IP addresses with a 12 hour l$
With bind-dynamic, it works fine...