[Dnsmasq-discuss] Any way to set the lease-time for hosts derived from /etc/ethers?

Rick Thomas rbthomas at pobox.com
Sat May 9 13:14:42 BST 2015


On May 8, 2015, at 8:55 PM, richardvoigt at gmail.com wrote:

> 
> 
> On Fri, May 8, 2015 at 2:35 PM, Simon Kelley <simon at thekelleys.org.uk> wrote:
> On 04/05/15 12:42, Rick Thomas wrote:
> >
> > Is there any way to set the lease time for a client derived from the
> > /etc/ethers file?
> >
> > I can set a lease time for a lease derived from a “dhcp-range” or
> > “dhcp-host” config statement, but I can’t find any way to set it for
> > the “implied” dhcp-host config when the host comes from /etc/ethers
> > via a “read-ethers” config.
> >
> 
> You can't put a lease time in /etc/ethers. The format of the ethers file
> is defined outside dnsmasq and doesn't have the syntax to represent it.
> 
> You can keep the /etc/ethers file and include lease times separately  in
> dhcp-hosts configs with just a MAC addresses or hostname and lease time.
> 
> You presumably have a “dhcp-range static" option already configured, since it is needed for read-ethers to work, and the lease time can be set there for the entire group, but not individually.

I actually don’t have a “dhcp-range static” option configured, since I want to provide dhcp for “guest” systems as well as for those fixed systems on the LAN that should have static IP addresses.

And this (some dynamic, some static from /etc/ethers) works fine (except for the noted inability to specify a lease time for the fixed-address hosts).  So I’m not sure what you mean when you say that dhcp-range static “is needed for read-ethers to work.”

Can I, for example, have:

dhcp-range=192.168.1.200,192.168.1.220,120m
dhcp-range=192.168.1.1,192.168.1.199,static,infinite
dhcp-range=192.168.1.221,192.168.1.254,static,infinite
read-ethers

Presumably this would have /etc/ethers allocate permanent addresses outside of the 200-220 range,
while dnsmasq would allocate addresses in the 200-220 range with lease time of 2 hours?

Would that work?

Thanks!
Rick




More information about the Dnsmasq-discuss mailing list