Alexandre34
Posts: 21
Joined: Sun Jan 31, 2016 6:18 am

dnsmasq: wlan0 not found

Thu Nov 23, 2017 8:01 am

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 ?

User avatar
DougieLawson
Posts: 38882
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: dnsmasq: wlan0 not found

Thu Nov 23, 2017 8:03 am

Use a systemd service file with a suitable After=xxx.service clause.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Alexandre34
Posts: 21
Joined: Sun Jan 31, 2016 6:18 am

Re: dnsmasq: wlan0 not found

Thu Nov 23, 2017 11:04 am

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...

Return to “Troubleshooting”