Dnsmasq not allowing client to connect to Access Point

Running Colibir iMX6ULL WB with Linux Console image 2.8b3.111 and trying to setup an Access Point on internal Wifi. Stated with a fresh image and changed the following:

# opkg update
# opkg install dnsmasq

Only changes made to:

/etc/hostapd.conf	
	interface=uap0
	ssid=watereye
	hw_mode=g		// default	
	channel=1		// default
	own_ip_addr=192.168.8.1
	#wpa=1     		// no wpa

Only changes made to:

/etc/dnsmasq.conf
	interface=uap0
	dhcp-range=192.168.8.50,192.168.8.150,2h
	no-hosts

To stop clash on Port 53 between connman and dnsmasq. add --nodnsporxy to connman ExecStart:

/lib/systemd/system/connman.service,
	ExecStart=/usr/sbin/connmand -n --nodnsproxy

To provide the uap0 with an address and use dns, create the following file:

/etc/systemd/network/hostapd.network
	[Match]
	Name=uap0
	[Network]
	Address=192.168.8.1/24
	DHCPServer=yes

Enable the required serivices

# connmanctl enable wifi
# systemctl enable hostapd
# systemctl enable dnsmasq
# reboot
  • no errors in system load
  • ssid on wifi can be seen but no connection

Run # ifconfig

eth0      Link encap:Ethernet  HWaddr 00:14:2D:2E:E4:79
          inet addr:192.168.1.60  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::214:2dff:fe2e:e479%lo/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

uap0      Link encap:Ethernet  HWaddr 00:19:88:5E:11:4E
          inet6 addr: fe80::219:88ff:fe5e:114e%lo/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

No IP address appearing on uap0

Run # lsof -i -P -n

dnsmasq   300  nobody    4u  IPv4   6054      0t0  UDP *:67
dnsmasq   300  nobody    6u  IPv4   6057      0t0  UDP *:53
dnsmasq   300  nobody    7u  IPv4   6058      0t0  TCP *:53 (LISTEN)
dnsmasq   300  nobody    8u  IPv6   6059      0t0  UDP *:53
dnsmasq   300  nobody    9u  IPv6   6060      0t0  TCP *:53 (LISTEN)

Run # systemctl status hostapd

  hostapd.service - Hostapd IEEE 802.11 AP, IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator
   Loaded: loaded (/lib/systemd/system/hostapd.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2018-08-07 18:32:54 UTC; 1min 51s ago
  Process: 291 ExecStart=/usr/sbin/hostapd /etc/hostapd.conf -P /run/hostapd.pid -B (code=exited, status=0/SUCCESS)
 Main PID: 301 (hostapd)
   CGroup: /system.slice/hostapd.service
           +-301 /usr/sbin/hostapd /etc/hostapd.conf -P /run/hostapd.pid -B

Aug 07 18:32:54 colibri-imx6ull hostapd[291]: uap0: interface state UNINITIALIZED->ENABLED
Aug 07 18:32:54 colibri-imx6ull hostapd[291]: uap0: AP-ENABLED
Aug 07 18:32:54 colibri-imx6ull systemd[1]: hostapd.service: PID file /run/hostapd.pid not readable (yet?) after start: No such file or directo
Aug 07 18:32:54 colibri-imx6ull systemd[1]: Started Hostapd IEEE 802.11 AP, IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator.
Aug 07 18:33:24 colibri-imx6ull hostapd[301]: uap0: STA fc:42:03:ea:1c:3f IEEE 802.11: associated
Aug 07 18:33:24 colibri-imx6ull hostapd[301]: uap0: STA fc:42:03:ea:1c:3f RADIUS: starting accounting session 62BFCC3A963EAE7A
Aug 07 18:33:56 colibri-imx6ull hostapd[301]: uap0: STA fc:42:03:ea:1c:3f IEEE 802.11: disassociated
Aug 07 18:33:58 colibri-imx6ull hostapd[301]: uap0: STA fc:42:03:ea:1c:3f IEEE 802.11: associated
Aug 07 18:33:58 colibri-imx6ull hostapd[301]: uap0: STA fc:42:03:ea:1c:3f RADIUS: starting accounting session 4152A684EA598958
Aug 07 18:34:31 colibri-imx6ull hostapd[301]: uap0: STA fc:42:03:ea:1c:3f IEEE 802.11: disassociated

Run # systemctl status dnsmasq

  dnsmasq.service - DNS forwarder and DHCP server
   Loaded: loaded (/lib/systemd/system/dnsmasq.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2018-08-07 18:32:54 UTC; 2min 18s ago
  Process: 297 ExecStart=/usr/bin/dnsmasq -x /run/dnsmasq.pid -7 /etc/dnsmasq.d --local-service (code=exited, status=0/SUCCESS)
  Process: 292 ExecStartPre=/usr/bin/dnsmasq --test (code=exited, status=0/SUCCESS)
 Main PID: 300 (dnsmasq)
   CGroup: /system.slice/dnsmasq.service
           +-300 /usr/bin/dnsmasq -x /run/dnsmasq.pid -7 /etc/dnsmasq.d --local-service

Aug 07 18:32:55 colibri-imx6ull dnsmasq[300]: reading /etc/resolv.conf
Aug 07 18:32:55 colibri-imx6ull dnsmasq[300]: using nameserver 192.168.1.1#53
Aug 07 18:33:25 colibri-imx6ull dnsmasq-dhcp[300]: DHCP packet received on uap0 which has no address
Aug 07 18:33:29 colibri-imx6ull dnsmasq-dhcp[300]: DHCP packet received on uap0 which has no address
Aug 07 18:33:37 colibri-imx6ull dnsmasq-dhcp[300]: DHCP packet received on uap0 which has no address
Aug 07 18:33:53 colibri-imx6ull dnsmasq-dhcp[300]: DHCP packet received on uap0 which has no address
Aug 07 18:33:59 colibri-imx6ull dnsmasq-dhcp[300]: DHCP packet received on uap0 which has no address
Aug 07 18:34:02 colibri-imx6ull dnsmasq-dhcp[300]: DHCP packet received on uap0 which has no address
Aug 07 18:34:10 colibri-imx6ull dnsmasq-dhcp[300]: DHCP packet received on uap0 which has no address
Aug 07 18:34:27 colibri-imx6ull dnsmasq-dhcp[300]: DHCP packet received on uap0 which has no address

If i now stop dnsmasq and restart it mannul with logging, I get the following:
Run # dnsmasq --no-daemon --log-queries

dnsmasq: started, version 2.78 cachesize 150
dnsmasq: compile time options: IPv6 GNU-getopt no-DBus no-i18n no-IDN DHCP DHCPv6 no-Lua TFTP no-conntrack ipset auth no-DNSSEC loop-detect inotify
dnsmasq-dhcp: DHCP, IP range 192.168.8.50 -- 192.168.8.150, lease time 2h
dnsmasq: reading /etc/resolv.conf
dnsmasq: using nameserver 192.168.1.1#53
dnsmasq: cleared cache

// when a client tries to connect, get following

dnsmasq-dhcp: DHCP packet received on uap0 which has no address
dnsmasq-dhcp: DHCP packet received on uap0 which has no address
dnsmasq-dhcp: DHCP packet received on uap0 which has no address

Now if i disable dsnmasq then reboot, the uap0 IP address appears:
Run # systemctl status dnsmasq

 dnsmasq.service - DNS forwarder and DHCP server
   Loaded: loaded (/lib/systemd/system/dnsmasq.service; disabled; vendor preset: enabled)
   Active: inactive (dead)

Run #ifconfig

uap0      Link encap:Ethernet  HWaddr 00:19:88:5E:11:4E
          inet addr:192.168.8.1  Bcast:192.168.8.255  Mask:255.255.255.0

When DNSMASQ is running, i am not getting an IP address for the wifi AP (uap0) and the AP is not allowing connection.
Any advise on where the problem may be or what to try would be greatly appreciated.

There are probably too many networking tools which interfere with each other. Especially, I would either use systemd-networkd or connman, but not both (at least not on the same interface).

Try disabling connman using:

systemctl disable connman.service

Also you seem to have two DHCP server enabled, dnsmasq as well as systemd-networkd… I would recommend use systemd-networkd only to configure the IP address. Remove the DHCPServer=yes configuration.

Thanks. I removed dnsmasq and enabled systemd-networkd and all is working well.

Thanks, all is working well.
I simply removed dnsmasq and enabled systemd-networkd with teh same configurations as above and all is working fine.

You are welcome. Perfect that it is working.