[Dnsmasq-discuss] Static IP and hostname

Simon Kelley simon@thekelleys.org.uk
Fri, 1 Apr 2005 10:32:27 +0100 (BST)


> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> I'm having trouble setting static IP addresses and hostnames based on
> the hardware address.
>
> Relevant dnsmasq.conf settings (dhcp-host is nearly the same as in
> dnsmasq.conf.example):
>
> dhcp-range=192.168.0.50,static,12h
> dhcp-host=<hw address>,node01,192.168.1.1,1h
>
> Log shows:
>
> dnsmasq[5775]: DHCPDISCOVER(eth0) <hw address> no address available
>
> I'm not sure what's going on here, and I can't figure out a way to get
> more verbose error reporting to figure it out. Google wasn't helpful
> either.
>
> If I set dhcp-range's end range to a number, it hands out an IP in the
> dynamic range to <hw address>.
>
> I'm using dnsmasq 2.22, but this was also a problem on the first
> version I tried, 2.15.
>
> Any help would be appreciated. I'm probably misconfiguring it, but I
> can't figure out the problem.

What is the address and netmask of the interface on the dnsmasq-running
machine which connects to the 192.168.... network? My guess is that the
netmask is 255.255.255.0, which would be conventional.
If so, then your dhcp-range is saying "hand out statically configured
addresses on the network 192.168.0.0-192.168.0.255". But your static
addresses are on the 192.168.1.1 network, so dnsmasq can't hand out those.
You don't have any dynamic address range configured for that network
either, so dnsmasq is out of possible addresses, hence the message.
The solution is to change the addresses in the dhcp-host lines to be on
the 192.168.0.x network, or widen the netmask so that 192.168.1.x network
comes in the same network as 192.168.0.x
HTH

Simon.