ASCII hardware address
Robin Breathe
robin-dhcp at isometry.net
Thu Jun 1 10:07:54 UTC 2006
Martin Jackson wrote:
> This should be a FAQ...I remember asking it a while ago. :) Here is
> what's running on my dhcpd server pair:
>
> set macaddr = concat (
> suffix (concat ("0", binary-to-ascii (16, 8, "",
> substring(hardware, 1, 1))),2),
> suffix (concat ("0", binary-to-ascii (16, 8, "",
> substring(hardware, 2, 1))),2),
> suffix (concat ("0", binary-to-ascii (16, 8, "",
> substring(hardware, 3, 1))),2),
> suffix (concat ("0", binary-to-ascii (16, 8, "",
> substring(hardware, 4, 1))),2),
> suffix (concat ("0", binary-to-ascii (16, 8, "",
> substring(hardware, 5, 1))),2),
> suffix (concat ("0", binary-to-ascii (16, 8, "",
> substring(hardware, 6, 1))),2)
> );
>
> The result is guaranteed to be 12 digits. You can then do things with
> macaddr - I use it to construct ddns-hostnames for clients that don't
> supply them.
That's useful, but I want to use the macaddr in an "on release" clause.
If I put the above inside my "on release", then it will be duplicated
for every client into dhcpd.leases, which doesn't seem particularly
sane. If you set macaddr in the global configuration, is it still
available within the context of an "on release" clause?
Regards,
Robin
More information about the dhcp-hackers
mailing list