[ntp:hackers] Automatic NTP configuration via DHCP on Windows

Heiko Gerstung heiko.gerstung at meinberg.de
Wed Aug 15 10:29:12 UTC 2007


Terje Mathisen schrieb:
> Heiko Gerstung wrote:
>> Hi Guys,
>>
>> from a post in the newsgoup I learned that there is a possibility to 
>> tell the Windows DHCP client to store the value of a specific option 
>> number from the DHCP server in a registry key. This would enable us 
>> to ask for the NTP server option and use it to create a temporary 
>> ntp.conf on a Windows client.
>>
>> The benefit would be that you would only have to provide your DHCP 
>> daemon with a list of NTP servers and all your clients would 
>> automagically use that list. If you have to change the list of 
>> servers, you just have to do it in the DHCP server and it is 
>> automatically propagated to all your clients. Sounds sexy to me and 
>> is surely desirable, since a lot of Unix DHCP clients already support 
>> NTP. However, the way we implement something like this on Windows 
>> would be a matter of discussion.
>>
>> My current proposal would be:
>>
>> 1. Tell NTPD with a command line switch to use the server list 
>> provided by DHCP
>> 2. When NTPD is started with this switch, it tries to read a list of 
>> servers from a fixed registry location
>> 3. If it finds something, it mobilizes an association for each of the 
>> specified servers
>> 4. Then it proceeds with parsing a configuration file, if one has 
>> been specified by -c on the command line (if the -c switch has not 
>> been used, NTP will just use the DHCP provided configuration  and 
>> continues to run)
>>
>>
>> If someone selects "Accept DHCP provided list of servers" in my 
>> Windows Installer, I could setup the registry key which tells the 
>> DHCP client to store the DHCP provided list of NTP servers in that 
>> specific registry location and add that DHCP switch to the 
>> commandline of the NTP service entry.
>>
>> Any comments or other suggestions?
>
> We could try to make it more generic, making the facility usable by 
> unix clients, without any configuration file incompatibilities. The 
> easiest would be to have a configuration line which is similar to 
> include, but which says to execute a given command, and parsing the 
> results as if it came from an include file.
>
> I.e. on unix this would work by specifying the pipe symbol together 
> with the included file name:
>
> include "commandfile |"
>
> or something similar, I don't remember offhand what the standard uni 
> syntax would be.

Sounds like a good idea to me. I would propose to use something like
include "< command"
instead, but the general idea is nice. This could work on all OSes and 
opens up a number of other possibilities for the end users. It would be 
not a big problem to write a small Windows commandline tools that reads 
the DHCP provided list from the registry and print out "server" lines 
for each entry it finds on stdout.

Regards,
Heiko

>
> Terje
>



More information about the hackers mailing list