[Dnsmasq-discuss] Give ip for client only if mac and hostname are specific one

Simon Kelley simon at thekelleys.org.uk
Fri Oct 18 14:38:04 BST 2013


On 18/10/13 14:27, Beat Meier wrote:
> Hi Simon
>
> Exactly!
> I need and mac&&  hostname to give this ip.
> How is this possible?

OK, this is ugly, and I've not tested it, but it should work.

First, set a tag if the hostname is correct

dhcp-match=set:hostname-ok,12,<hostname-to-select>

then, set a tag if the MAC is correct

dhcp-mac=set:mac-ok,00:11:22:33:44:55:66


finally, set a tag if _both_ match

tag-if=set:all-ok,tag:hostname-ok,tag:mac-ok

Finally, make a dhcp range with one address that's only used when all-ok 
is set

dhcp-range=tag:all-ok,192.168.1.99,192.168.1.99


I'd be very interested to know if that works!


Cheers,

Simon.




>
> Thanks!!
>
> On 10/18/2013 10:22 AM, Simon Kelley wrote:
>> On 18/10/13 14:18, Beat Meier wrote:
>>> Hello
>>>
>>> I wanto to give a client a specifi ip only if the mac and the "hostid or
>>> hostname" which is logged
>>> in dhcp.leases is a speficic one, else give and other ip.
>>> Is this possible with dnsmasq and someting like remoteid?
>>> Any help
>>>
>>> Thanks
>>>
>>> Beat
>>>
>>
>>
>> Assigning a specific IP address if a host has a specific hostname or
>> MAC address is trivial. Doing only if BOTH the mac address and
>> hostname match is more difficult, but should be possible. Is that what
>> you need?
>>
>>
>> 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