[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ntp-hackers
Subject:    Re: [ntp:hackers] Automatic NTP configuration via DHCP on Windows
From:       Heiko Gerstung <heiko.gerstung () meinberg ! de>
Date:       2007-08-15 12:43:38
Message-ID: 46C2F4FA.4030705 () meinberg ! de
[Download RAW message or body]

Danny Mayer 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?
>>
>>
>> Best Regards,
>> Heiko
>>     
>
> I dislike the idea of trying to use DHCP. Our experience of an O/S
> vendor putting something like this into DHCP was that people were
> getting confused by DHCP overwriting their existing ntp.conf file with
> one shipped by the vendor. The ultimate solution in that case was to not
> use the same name for the configuration file. A more useful suggestion
> has been to use a URL for the config file name and have it served from a
> remote location. Of course *none* of these strategies work if you don't
> have network connectivity which is really bad when you are just booting
> your system.
>
> Danny
>   

Terje's idea of an include statement that can be either simply include a 
text file or include the output of a command (by using a "<" prefix) 
sounds perfect to me. This would protect the ntp configuration file from 
being overwritten and because you see that include statement in your 
ntp.conf there are no surprises. It would be no problem for ntpd to show 
what exactly it has included when run in debug mode.
The general concept of adding an include statement to the configuration 
file parser is very flexible and does not show the problems you 
mentioned. But, adding another include-mode (URL) would surely be even 
better :-)

include 
"http://www.my-intranet-server.local/configurations/ntp/ntp-client.conf"

... however, teaching ntpd to support http, ftp and other protocols is 
overkill. You can achieve the same functionality by simply providing a 
script which uses wget (for example) to read the ntp configuration from 
a specified URL:
include "< get_ntp_conf_from_server http://server/ntp/client.conf"

Where "get_ntp_conf_from_server" is a simple script using wget to 
download the given URL and print it to stdout.


Regards,
Heiko

_______________________________________________
hackers mailing list
hackers@lists.ntp.org
https://lists.ntp.org/mailman/listinfo/hackers
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic