[Dnsmasq-discuss] Question to dhcp-lease-format in conjunction
with dhcp-script
Simon Kelley
simon at thekelleys.org.uk
Fri Sep 19 17:45:29 BST 2008
Michael Rack wrote:
> Hi,
>
> i have a question to the dnsmasq dhcp-lease-format in conjunction with
> dhcp-script. I have some devices with no hostname. When dnsmasq is
> calling my dhcp-script with the init parameter, in what format have this
> hosts to be exported?
Exactly the same format as the hosts file
<expiry time> <MAC address> <IP address> <hostname>|* <client-id>|*
>
> Currently i create a output to stdout look like as follow:
> > 1221753155 00:1f:3f:53:a2:38 81.95.xxx.117 01:00:1f:3f:53:a2:38
> > 1221753001 00:17:31:83:0a:a2 81.95.xxx.119 01:00:17:31:83:0a:a2
> > 1221753063 00:1d:73:18:18:ca 81.95.xxx.124 01:00:1d:73:18:18:ca
> > 1221753205 00:04:0e:df:0f:dd 81.95.xxx.125 datapipe 01:00:04:0e:df:0f:dd
> > 1221753257 00:1d:73:05:81:7c 81.95.xxx.22 AP001D7305817C
> 01:00:1d:73:05:81:7c
> > 1221753006 00:13:49:63:55:fd 81.95.xxx.25 01:00:13:49:63:55:fd
> > 1221753059 00:16:01:f4:e8:59 81.95.xxx.41 buffalo-router
> 01:00:16:01:f4:e8:59
> > 1221753166 00:1f:3a:b5:bf:c3 81.95.xxx.87 01:00:1f:3a:b5:bf:c3
> Is this correct, or how to export this rows?
No, you need to have a * instead of the hostname when it's not present.
>
> And other question:
> * What is the fifth part of the dhcp-lease-format?
Client-identifier.
> * Why is the MAC-Address prefixed with 01: ?
Because that's what many DHCP clients use as the client identifier (the
01 means "ethernet") Not all do that though, so don't rely on it.
If you look in contrib/wrt/lease_update.sh in the dnsmasq tarball, it
has exactly the right shell code to turn the arguments to the
lease-change script into the correct format.
>Why does dnsmasq forget to send the leading 00: ?
I've not seen that before, are you sure it's not a problem with your
script, maybe you are mangling the lease database somehow: "old" events
are generated for existing leases that will have been through your code
and fed back to dnsmasq with an "init" call.
Cheers,
Simon.
>
> Thanks,
> Michael.
>
> _______________________________________________
> 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