dhcpd.conf: three small nuisances

Glenn Satchell Glenn.Satchell at uniq.com.au
Wed Jan 17 13:33:14 UTC 2007


>Date: Wed, 17 Jan 2007 07:18:04 -0500
>To: dhcp-users at isc.org
>Subject: dhcpd.conf: three small nuisances
>
>Hello,
>
>I have a couple of questions about dhcpd. I got the things to work, but 
>I don't really like my workarounds, hence the questions:
>
>
>    class "00:0a:e6:e9:91:72" {
>        match if binary-to-ascii (
>		16,
>		8, 
>		":", 
>		substring (hardware, 1, 6)
>	) 
>	= "0:a:e6:e9:91:72";
>
>* In order to match the hardware value I need to strip leading zeroes 
>from the string I am matching against. Is there any way to deal with 
>this?

Don't convert to a string first - use the binary representation, eg:

    class "00:0a:e6:e9:91:72" {
        match if (substring (hardware, 1, 6)) = 0:0a:e6:e9:91:72;
    }

then it doesn't matter whether you have leading zeroes.

As for dns names. You can put entries in DNS and then refer to them by
name in dhcpd.conf, eg:

in DNS

foobar IN A 192.168.0.1

in dhcpd.conf

host foobar {
  hardware 00:0a:e6:e9:91:72;
  fixed-address foobar.example.com;
}

Then you only have the IP address in one place, which is DNS.

regards,
-glenn


More information about the dhcp-users mailing list