On Sun, Dec 27, 2009 at 6:09 PM, Rance Hall <ran...@gmail.com> wrote: > On Sun, Dec 27, 2009 at 5:47 PM, richardvo...@gmail.com > <richardvo...@gmail.com> wrote: >> On Sun, Dec 27, 2009 at 11:31 AM, <dnsmasq.to.pee...@spamgourmet.com> wrote: >>> dnsmasq.conf has a line: >>> >>> dhcp-range=192.168.0.50,192.168.0.150,255.255.255.0,12h >>> >>> (hostmin,hostmax,netmask,leasetime) >>> >>> If I enable that line, must the dnsmasq server itself be outside that range? >>> >>> Ie, for the dnsmasq server: >>> 192.168.0.55 on the LAN interface would be wrong >>> but >>> 192.168.0.45 would be ok. >> >> In my experience, dnsmasq is smart enough to not give out its own >> address, or any addresses mentioned in dhcp-host lines (except to the >> computer to which it is reserved). >> >> It may be confusing, because your address pool is smaller than the >> dhcp-range suggests, and you'll have fewer leases than expected when >> dhcp starts failing, but dnsmasq won't do anything so broken as giving >> away its own address. >> > > Richard: > > This is good to know, Ive never even asked dnsmasq to do this, so I > wouldnt have had a clue that it would work correctly. > > I always design a static ip pool, a device pool, and a dhcp pool that > way I know whats going on on the network. and I can easily ignore > devices in searches when Im looking for a problem with an as yet > unidentified pc somewhere.
Well, there's always the case where a customer decides they want a static address after receiving one from the pool, and they don't want to change the one they've already got once. You can do this using dhcp-host config lines or /etc/ethers -- if that computer requests an address via dhcp it will always receive the same one, and that address will not be given to any other computer regardless of whether the matching host claimed its address via dhcp or had it manually entered. >From reading the man page, I think dnsmasq also tries to avoid giving out addresses from the pool which are already in use even when they aren't listed in /etc/ethers, by checking for a response to ping. This isn't 100% effective since many systems don't respond to ping (especially while turned off). So if any addresses inside the dhcp-range are used, help dnsmasq out with a dhcp-host or /etc/ethers entry so it doesn't have to rely on ping.