Friday, January 23, 2015

NTP configuration on Windows 2012


source

Configure Windows Server 2012 As An NTP Server

When you’re configuring a Mac to leverage an existing Windows infrastructure, having the clocks in sync is an important task. Luckily, Windows Server has been able to act as an NTP server for a long time. In this article, we’ll look at configuring Windows Server to be an NTP server for Mac and Linux clients.
Note: Before you get started, or any time you’re hacking around in the registry, make sure to do a backup of your registry/SystemState!
To enable NTP on Windows Server, open your favorite registry editor and navigate to HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesW32TimeTimeProvidersNtpServer. From here, enter a key called Enabled as a dword with a value of 00000001.
The NTP Server should look upstream at another NTP host. To configure this, go ahead and navigate to HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesW32TimeTimeProvidersNtpClient and create Enabled as a dword with a value of 0000001 and SpecialPollInterval with a value of 300:
“Enabled”=dword:00000001
“SpecialPollInterval”=”300″
NTP would then need a source, so let’s go ahead and create that in the registry as well. To set that up, navigate to HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesW32TimeParameters and then setup the Type key to contain NTP, the Period key to contain freq and the NtpServer key to obtain the IP address of the server followed by ,0x1, as follows (assuming an IP of 10.0.0.8 for the upstream NTP server:
“NtpServer”=10.0.0.8,0×1″
“Type”=”NTP”
“Period”=”freq”
The w32tm service doesn’t start unless your system is on a domain (and should be restarted if the system is already running as a DC). To starts the service automatically (if needed), use the sc command:
sc triggerinfo w32time start/networkon stop/networkoff
Windows systems can also use an NTP server. To configure the NTP client, navigate to HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesW32TimeTimeProvidersNtpClient and create Enabled as a dword with a value of 0000001 and SpecialPollInterval with a value of 300:
“Enabled”=dword:00000001
“SpecialPollInterval”=”300″
NTP would then need a source, so let’s go ahead and create that in the registry as well. To set that up, navigate to HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesW32TimeParameters and then setup the Type key to contain NTP, the Period key to contain freq and the NtpServer key to obtain the IP address of the server followed by ,0x1, as follows (assuming an IP of 10.0.0.8 for the upstream NTP server:
“NtpServer”=10.0.0.8,0×1″
“Type”=”NTP”
“Period”=”freq”
Finally, you can invoke the w32tm service directly to query peers and verify that no skew has occurred with the clocks:
w32tm /query /peers

No comments:

Post a Comment