<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body>
<div>
<div>
<div dir="ltr">
<div dir="ltr">For your other IP range try this. </div>
<div dir="ltr"><br>
</div>
<div dir="ltr"><span style="color:rgb(33, 33, 33);font-family:"Helvetica Neue", Helvetica, Arial, sans-serif;font-size:13px;display:inline !important">dhcp-range=tag:!mbdevices,192.168.0.2,192.168.0.10,255.255.255.0,12h</span><br>
</div>
<div dir="ltr"><span style="color:rgb(33, 33, 33);font-family:"Helvetica Neue", Helvetica, Arial, sans-serif;font-size:13px;display:inline !important"><br>
</span></div>
</div>
</div>
<div id="ms-outlook-mobile-signature">
<div></div>
</div>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Dnsmasq-discuss <dnsmasq-discuss-bounces@lists.thekelleys.org.uk> on behalf of Craig Wright via Dnsmasq-discuss <dnsmasq-discuss@lists.thekelleys.org.uk><br>
<b>Sent:</b> Monday, January 23, 2023 4:28:50 AM<br>
<b>To:</b> dnsmasq-discuss@lists.thekelleys.org.uk <dnsmasq-discuss@lists.thekelleys.org.uk><br>
<b>Subject:</b> Re: [Dnsmasq-discuss] DHCP range for hostnames containing string</font>
<div> </div>
</div>
<div>
<div class="x_ydp2bca181eyahoo-style-wrap" style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif; font-size:13px">
<div></div>
<div dir="ltr" data-setdir="false">
<div>Update on this issue, but still not fully resolved....<br>
<br>
<div>I received the following advice from Simon:</div>
<div><br>
</div>
"> To set the mbdevices tag, you need to use dhcp-match to look for MB in<br>
> the hostname option (which has number 12).<br>
>> dhcp-match=set:mbdevices,12,MB<br>
>> Almost works, but it will match MB anywhere in the host name.<br>
> To match just the start, you need to get out your ASCII table and<br>
> specify the first two bytes of the hostname<br>
>> dhcp-match=set:mbdevices,12,4d:42<br>
>> (4d = M, 42 = B)<br>
> Not tested this, but it (or something like it) should work.<br>
> Or dhcp-match=set:mbdevices,option:hostname,4d:42"<br>
<br>
<br>
I have currently:<br>
<br>
dhcp-range=192.168.0.2,192.168.0.10,255.255.255.0,12h<br>
dhcp-range=tag:mbdevices,192.168.0.50,192.168.0.60,255.255.255.0,12h<br>
dhcp-range=tag:!known,192.168.0.11,192.168.0.20,255.255.255.0,12h<br>
<br>
and have tried each of the lines:<br>
<br>
dhcp-match=set:mbdevices,option:hostname,MB<br>
dhcp-match=set:mbdevices,option:hostname,4d:42<br>
dhcp-match=set:mbdevices,12,MB<br>
dhcp-match=set:mbdevices,12,4d:42<br>
dhcp-name-match=set:mbdevices,MB*<br>
<br>
and the devices with hostnames starting with MB are all being allocated to the !known range.<br>
The log doesn't appear to show any errors, just that the devices were allocated an IP in the wrong range.<br>
<br>
Log extract:<br>
<br>
<<br>
Jan 20 15:06:01 dnsmasq-dhcp[54742]: 209364703 vendor class: MSFT 5.0<br>
Jan 20 15:06:01 dnsmasq-dhcp[54742]: 209364703 client provides name: MBA-4d5e7qJ<br>
Jan 20 15:06:01 dnsmasq-dhcp[54742]: 209364703 DHCPINFORM(epair0b) 192.168.0.12 3c:21:9c:10:9d:48<br>
Jan 20 15:06:01 dnsmasq-dhcp[54742]: 209364703 tags: mbdevices, epair0b<br>
Jan 20 15:06:01 dnsmasq-dhcp[54742]: 209364703 DHCPACK(epair0b) 192.168.0.12 3c:21:9c:10:9d:48 MBA-4d5e7qJ<br>
Jan 20 15:06:01 dnsmasq-dhcp[54742]: 209364703 requested options: 1:netmask, 3:router, 6:dns-server, 15:domain-name,<br>
Jan 20 15:06:01 dnsmasq-dhcp[54742]: 209364703 requested options: 31:router-discovery, 33:static-route, 43:vendor-encap,<br>
Jan 20 15:06:01 dnsmasq-dhcp[54742]: 209364703 requested options: 44:netbios-ns, 46:netbios-nodetype, 47:netbios-scope,<br>
Jan 20 15:06:01 dnsmasq-dhcp[54742]: 209364703 requested options: 119:domain-search, 121:classless-static-route,<br>
Jan 20 15:06:01 dnsmasq-dhcp[54742]: 209364703 requested options: 249, 252, 234<br>
Jan 20 15:06:01 dnsmasq-dhcp[54742]: 209364703 next server: 192.168.5.252<br>
Jan 20 15:06:01 dnsmasq-dhcp[54742]: 209364703 sent size:  1 option: 53 message-type  5<br>
Jan 20 15:06:01 dnsmasq-dhcp[54742]: 209364703 sent size:  4 option: 54 server-identifier  192.168.5.252<br>
Jan 20 15:06:01 dnsmasq-dhcp[54742]: 209364703 sent size:  4 option:  1 netmask  255.255.255.0<br>
Jan 20 15:06:01 dnsmasq-dhcp[54742]: 209364703 sent size:  4 option: 28 broadcast  192.168.5.255<br>
Jan 20 15:06:01 dnsmasq-dhcp[54742]: 209364703 sent size:  4 option:  6 dns-server  192.168.5.251<br>
Jan 20 15:06:01 dnsmasq-dhcp[54742]: 209364703 sent size:  4 option:  3 router  192.168.5.1<br>
Jan 20 15:11:09 dnsmasq-dhcp[54742]: 2797271231 available DHCP range: 192.168.0.2 -- 192.168.0.10<br>
Jan 20 15:11:09 dnsmasq-dhcp[54742]: 2797271231 available DHCP range: 192.168.0.50 -- 192.168.0.60<br>
Jan 20 15:11:09 dnsmasq-dhcp[54742]: 2797271231 available DHCP range: 192.168.0.11 -- 192.168.0.20<br>
><br>
<br>
dhcp-match=set:mbdevices,12,MB seems to work in that it applies the tag some of the devices but not others, but it puts them in the in the !known range<br>
<br>
dhcp-match=set:mbdevices,12,4d:42 does not appear to work<br>
<br>
dhcp-name-match=set:mbdevices,MB* appears to tag more consistently but still the devices do not get allocated to the mbdevices range.<br>
<br>
Any help would be really appreciated.<br>
Thanks<br>
<br>
<br>
</div>
<div><br>
</div>
</div>
<div><br>
</div>
</div>
<div id="x_ydp6dd347cbyahoo_quoted_5237518785" class="x_ydp6dd347cbyahoo_quoted">
<div style="font-family:'Helvetica Neue',Helvetica,Arial,sans-serif; font-size:13px; color:#26282a">
<div>On Thursday, 19 January 2023 at 14:03:18 GMT, Craig Wright  wrote: </div>
<div><br>
</div>
<div><br>
</div>
<div>
<div id="x_ydp6dd347cbyiv0503634038">
<div>
<div class="x_ydp6dd347cbyiv0503634038yahoo-style-wrap" style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif; font-size:13px">
<div dir="ltr">Hi,</div>
<div dir="ltr">I am trying to allocate all hosts that join my network with a hostname beginning 'MB' to a specific DHCP range.</div>
<div dir="ltr">After much internet research I can't find if there is a solution.</div>
<div dir="ltr">So far I have got:</div>
<div dir="ltr"><br>
</div>
<div dir="ltr">dhcp-range=tag:mbdevices,192.168.0.50,192.168.0.60,255.255.255.0,12h</div>
<div dir="ltr"><br>
</div>
<div dir="ltr">and have tried</div>
<div dir="ltr">dhcp-host=MB*,set:mbdevices</div>
<div dir="ltr">thinking I could try using a wildcard to add them to the tag which would them allocate them an IP in the range above.</div>
<div dir="ltr"><br>
</div>
<div dir="ltr">But this doesn't work.</div>
<div dir="ltr"><br>
</div>
<div dir="ltr">Can you advise if what I am trying to achieve is possible please?</div>
<div dir="ltr">Many thanks<br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>