1

I am trying to setup dnsmasq to act as DHCP server for a hostapd-based WiFi hotspot.

When client connects WAP2 negotiation succeeds, but dnsmasq consistently outputs the following errors.

[ 2081.576809] DHCP[wlan0] - DISCOVER [TX][ 2081.580476]                        
[ 2081.582008] DHCP[wlan0] - DISCOVER [RX]                                      
dnsmasq-dhcp: no address range available for DHCP request via wlan0             
[ 2085.297432] DHCP[wlan0] - DISCOVER [TX][ 2085.301107]                        
[ 2085.302630] DHCP[wlan0] - DISCOVER [RX]                                      
dnsmasq-dhcp: no address range available for DHCP request via wlan0             

These usually mean the configured range is incompatible with device settings.

If this is the case I fail to understand why.

My test dnsmaq.conf is very basic:

root@imx8qxpa0tcuap:~# cat /etc/dnsmasq.conf                                    
domain-needed                                                                   
bogus-priv                                                                      
interface=wlan0                                                                 
dhcp-range=192.168.207.20,192.168.207.50,12h                                    

... and current net settings should be compatible:

root@imx8qxpa0tcuap:~# ip addr show wlan0
5: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP 0
    link/ether a0:cc:2b:a5:e0:05 brd ff:ff:ff:ff:ff:ff
    inet 192.168.207.1/32 scope global wlan0
       valid_lft forever preferred_lft forever
    inet6 fe80::a2cc:2bff:fea5:e005/64 scope link
       valid_lft forever preferred_lft forever
root@imx8qxpa0tcuap:~# ip route
192.168.207.0/24 dev wlan0 scope link

Initial dnsmasq printouts show no problem:

root@imx8qxpa0tcuap:~# dnsmasq -d
dnsmasq: started, version 2.78 cachesize 150
dnsmasq: compile time options: IPv6 GNU-getopt no-DBus no-i18n no-IDN DHCP DHCPy
dnsmasq-dhcp: DHCP, IP range 192.168.207.20 -- 192.168.207.50, lease time 12h
dnsmasq: reading /etc/resolv.conf
dnsmasq: using nameserver 8.8.8.8#53
dnsmasq: using nameserver 8.8.4.4#53
dnsmasq: using nameserver 2001:4860:4860::8888#53
dnsmasq: using nameserver 2001:4860:4860::8844#53
dnsmasq: read /etc/hosts - 6 addresses

What am I doing wrong?

Note1: in this test setup the WiFi Hotspot goes nowhere (yet) only communication between client and Hotspot itself are supposed to work.

Note2: the machine is a custom board (i.MX8) running a Yocto based distribution.

1

Your wlan0 interface network mask is wrong.

-->>> 192.168.207.1/32

A /32 network mask has 32 bits, 255.255.255.255 which is the whole IP address.

You probably meant 192.168.207.0/24 e.g. 255.255.255.0 aka a C class network address. A /24 mask allows you to serve up to 254 IP addresses, from 192.168.207.1 to 192.168.207.254.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.