Sorry. Misread and thought they were being assigned to the first range. ________________________________ From: Craig Wright <member852...@yahoo.com> Sent: Monday, January 23, 2023 9:15:39 AM To: Donald Muller <donmulle...@outlook.com> Subject: Re: [Dnsmasq-discuss] DHCP range for hostnames containing string
Can you explain how this would help? The mbdevices are being assigned to the !known range, not the top range - dhcp-range=tag:!known,192.168.0.11,192.168.0.20,255.255.255.0,12h Thanks On Monday, 23 January 2023 at 14:11:06 GMT, Donald Muller <donmulle...@outlook.com> wrote: For your other IP range try this. dhcp-range=tag:!mbdevices,192.168.0.2,192.168.0.10,255.255.255.0,12h ________________________________ From: Dnsmasq-discuss <dnsmasq-discuss-boun...@lists.thekelleys.org.uk> on behalf of Craig Wright via Dnsmasq-discuss <dnsmasq-discuss@lists.thekelleys.org.uk> Sent: Monday, January 23, 2023 4:28:50 AM To: dnsmasq-discuss@lists.thekelleys.org.uk <dnsmasq-discuss@lists.thekelleys.org.uk> Subject: Re: [Dnsmasq-discuss] DHCP range for hostnames containing string Update on this issue, but still not fully resolved.... I received the following advice from Simon: "> To set the mbdevices tag, you need to use dhcp-match to look for MB in > the hostname option (which has number 12). >> dhcp-match=set:mbdevices,12,MB >> Almost works, but it will match MB anywhere in the host name. > To match just the start, you need to get out your ASCII table and > specify the first two bytes of the hostname >> dhcp-match=set:mbdevices,12,4d:42 >> (4d = M, 42 = B) > Not tested this, but it (or something like it) should work. > Or dhcp-match=set:mbdevices,option:hostname,4d:42" I have currently: dhcp-range=192.168.0.2,192.168.0.10,255.255.255.0,12h dhcp-range=tag:mbdevices,192.168.0.50,192.168.0.60,255.255.255.0,12h dhcp-range=tag:!known,192.168.0.11,192.168.0.20,255.255.255.0,12h and have tried each of the lines: dhcp-match=set:mbdevices,option:hostname,MB dhcp-match=set:mbdevices,option:hostname,4d:42 dhcp-match=set:mbdevices,12,MB dhcp-match=set:mbdevices,12,4d:42 dhcp-name-match=set:mbdevices,MB* and the devices with hostnames starting with MB are all being allocated to the !known range. The log doesn't appear to show any errors, just that the devices were allocated an IP in the wrong range. Log extract: < Jan 20 15:06:01 dnsmasq-dhcp[54742]: 209364703 vendor class: MSFT 5.0 Jan 20 15:06:01 dnsmasq-dhcp[54742]: 209364703 client provides name: MBA-4d5e7qJ Jan 20 15:06:01 dnsmasq-dhcp[54742]: 209364703 DHCPINFORM(epair0b) 192.168.0.12 3c:21:9c:10:9d:48 Jan 20 15:06:01 dnsmasq-dhcp[54742]: 209364703 tags: mbdevices, epair0b Jan 20 15:06:01 dnsmasq-dhcp[54742]: 209364703 DHCPACK(epair0b) 192.168.0.12 3c:21:9c:10:9d:48 MBA-4d5e7qJ Jan 20 15:06:01 dnsmasq-dhcp[54742]: 209364703 requested options: 1:netmask, 3:router, 6:dns-server, 15:domain-name, Jan 20 15:06:01 dnsmasq-dhcp[54742]: 209364703 requested options: 31:router-discovery, 33:static-route, 43:vendor-encap, Jan 20 15:06:01 dnsmasq-dhcp[54742]: 209364703 requested options: 44:netbios-ns, 46:netbios-nodetype, 47:netbios-scope, Jan 20 15:06:01 dnsmasq-dhcp[54742]: 209364703 requested options: 119:domain-search, 121:classless-static-route, Jan 20 15:06:01 dnsmasq-dhcp[54742]: 209364703 requested options: 249, 252, 234 Jan 20 15:06:01 dnsmasq-dhcp[54742]: 209364703 next server: 192.168.5.252 Jan 20 15:06:01 dnsmasq-dhcp[54742]: 209364703 sent size: 1 option: 53 message-type 5 Jan 20 15:06:01 dnsmasq-dhcp[54742]: 209364703 sent size: 4 option: 54 server-identifier 192.168.5.252 Jan 20 15:06:01 dnsmasq-dhcp[54742]: 209364703 sent size: 4 option: 1 netmask 255.255.255.0 Jan 20 15:06:01 dnsmasq-dhcp[54742]: 209364703 sent size: 4 option: 28 broadcast 192.168.5.255 Jan 20 15:06:01 dnsmasq-dhcp[54742]: 209364703 sent size: 4 option: 6 dns-server 192.168.5.251 Jan 20 15:06:01 dnsmasq-dhcp[54742]: 209364703 sent size: 4 option: 3 router 192.168.5.1 Jan 20 15:11:09 dnsmasq-dhcp[54742]: 2797271231 available DHCP range: 192.168.0.2 -- 192.168.0.10 Jan 20 15:11:09 dnsmasq-dhcp[54742]: 2797271231 available DHCP range: 192.168.0.50 -- 192.168.0.60 Jan 20 15:11:09 dnsmasq-dhcp[54742]: 2797271231 available DHCP range: 192.168.0.11 -- 192.168.0.20 > 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 dhcp-match=set:mbdevices,12,4d:42 does not appear to work dhcp-name-match=set:mbdevices,MB* appears to tag more consistently but still the devices do not get allocated to the mbdevices range. Any help would be really appreciated. Thanks On Thursday, 19 January 2023 at 14:03:18 GMT, Craig Wright wrote: Hi, I am trying to allocate all hosts that join my network with a hostname beginning 'MB' to a specific DHCP range. After much internet research I can't find if there is a solution. So far I have got: dhcp-range=tag:mbdevices,192.168.0.50,192.168.0.60,255.255.255.0,12h and have tried dhcp-host=MB*,set:mbdevices thinking I could try using a wildcard to add them to the tag which would them allocate them an IP in the range above. But this doesn't work. Can you advise if what I am trying to achieve is possible please? Many thanks
_______________________________________________ Dnsmasq-discuss mailing list Dnsmasq-discuss@lists.thekelleys.org.uk https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss