[Dnsmasq-discuss] Assign IP range by hostname with wildcard

Christian Zenker christian.zenker at 599media.de
Wed Sep 5 17:39:49 BST 2012


> Where are the workstation names set? If they are locally to the
> workstations, (rather than being set by DHCP) then the machines will be
> sending their hostnames in DHCP requests.

Yes. We are configuring all our company's desktops by hand. I guess that's how the hostname is set.

> If so you should be able to
>use dhcp-match to look at the hostname options.
>dhcp-match=set:baz, option:domain-name, foobar-

Using option:host-name works as expected. 

>It's not an ideal solution, but it might work for you.

Yes it does. Thanks a lot for the help and the code.

Christian.

-----Ursprüngliche Nachricht-----
Von: dnsmasq-discuss-bounces at lists.thekelleys.org.uk [mailto:dnsmasq-discuss-bounces at lists.thekelleys.org.uk] Im Auftrag von Simon Kelley
Gesendet: Mittwoch, 5. September 2012 16:45
An: Dnsmasq-discuss at lists.thekelleys.org.uk
Betreff: Re: [Dnsmasq-discuss] Assign IP range by hostname with wildcard

On 04/09/12 09:51, Christian Zenker wrote:
> Hi.
> 
> First of all: I have less than one day of experience with DHCP, so please forgive me if my terminology is a bit off or I do some terrible beginners mistake.
> I'm trying to set up DHCP for our small company. This far everything worked really smoothly (thanks to dnsmasq), but I'm struggling with some minor issue:
> 
> I want to separate the dhcp ranges from the workstations from any other machines. As the workstations have a hostname naming scheme like "foobar-1", "foobar-2", etc. I thought it would be nice to work with wildcards, like:
> 
> dhcp-host=set:baz,foobar-*
> dhcp-range=tag:baz,192.168.1.1,192.168.1.42,infinite
> dhcp-range=tag:!baz,192.168.1.43,192.168.1.254,12h
> 
> But this is not a valid syntax. The extensive way
> 
> dhcp-host=set:baz,foobar-1
> dhcp-host=set:baz,foobar-2
> # [...]
> 
> works, but is not really nice and hard to maintain. Is there any way to use some kind of wildcard to keep the configuration short?
> 
> Christian Zenker.
> 

Where are the workstation names set? If they are locally to the
workstations, (rather than being set by DHCP) then the machines will be
sending their hostnames in DHCP requests. If so you should be able to
use dhcp-match to look at the hostname options.

dhcp-match=set:baz, option:domain-name, foobar-

It's not an ideal solution, but it might work for you.


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