[Dnsmasq-discuss] One lease or another

richardvoigt at gmail.com richardvoigt at gmail.com
Thu Dec 31 03:43:09 GMT 2009


On Wed, Dec 30, 2009 at 4:08 PM, Didster <didster at gmail.com> wrote:
> Hi
>
> Probably an odd request this, but is there anyway of getting dnsmasq
> to give a lease to either one machine or another but not both?
>
> So I have a small network of about 7 PCs on a static range.  Each PC
> is listed with its MAC address in a dhcp-host directive.  For 2 of the
> PCs, I only want one of the 2 machines to be able to get a lease at
> any one time.  So if PC1 has a lease, PC2s request will fail and vise
> versa.
>
> Is there anyway that can be done?

Use the dhcp-host lines to assign a tag to these two computers.  Don't
associate an IP address from dhcp-host.
Make a dhcp-range which has a pool of only one address and matches that tag.
Make sure that other dhcp-ranges do not match the tag (as in, #tag or
use the static keyword to not create a pool at all).
Done.

If either PC has a valid lease, the pool is exhausted and the other PC
will be refused.  When the first lease is released or expires, the
pool will have a free address again and the next request will be
accepted.  But please note most clients won't release their lease
during shutdown without special configuration.

>
> Thanks
> Simon
>
> _______________________________________________
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss at lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
>



More information about the Dnsmasq-discuss mailing list