[Dnsmasq-discuss] Cannot setup DHCP

Simon Kelley simon@thekelleys.org.uk
Wed, 01 Dec 2004 16:39:44 +0000


Илья Евсеев wrote:
>    Hi, folks!
> I have dnsmasq-2.18 on my linux box with 2 network intefaces:
> eth0 = 192.168.0.10/24 and eth1 = public IP.
> /etc/dnsmasq.conf is like following
> (I skip comments, blank lines and default values):
>     bind-interfaces
>     interface lo
>     interface eth0
>     expand-hosts
>     dhcp-range=192.168.0.50,192.168.0.150,12h
>     read-ethers  # really exists and accepted by dnsmasq
>     dhcp-option=42,0.0.0.0  # NTP server = dnsmasq host
> 
> Dnsmasq starts and acts as DNS-service successfully,
> also listens on UDP port 67, _but_! does nothing
> as DHCP-service: "dhcpcd -T eth0" sleeps until timeout.
> Periodically dnsmasq puts to syslog following message:
> "dnsmasq: no address range available for DHCP request via eth0".
> 
> I don't understand this error, because 192.168.0.50-150
> is completely owned by 192.168.0.10/24.
> Well, can somebody explain me: what's wrong here?
> 
> WBR, Ilya
> 

Carefully check the configuration of eth0, both the netmask and 
broadcast address. Dnsmasq uses that information when looking for a 
valid DHCP range, and if (for instance) you had set the netmask to 
255.255.255.128, then you would see the behaviour you are describing.

It's possible to override the netmask and broadcast addresses by 
including them in the dhcp-range, like so:

dhcp-range=192.168.0.50,192.168.0.150,255.255.255.0,192.168.0.255,12h

Are you using a DHCP relay? If so then including the netmask in the 
dhcp-range is mandatory for networks connected via the DHCP relay.

Cheers,

Simon.