Windows: Enable NTP Client and Server

Hi,

the Windows Time service includes both an NTP Client and an NTP Server. The NTP Server is disabled by default.

If your Windows Box should act as NTP Server config a valid time source first. Either a DCF77 (Germany) Receiver or an couple of NTP Servers which you trust.

For Germany I recommend to use the NTP Server from the “physikalisch-technische bundesanstalt”.

Lets start. Configure the Windows Time Service as NTP Client.

D:\> w32tm /config /syncfromflags:manual /update /manualpeerlist:ptbtime1.ptb.de,ptbtime2.ptb.de

Configure w32time Service to start automatically

D:\> sc config w32time start= auto
D:\> net start w32time 

Configure w32time as Server

D:\> w32tm /config /reliable:yes
D:\> w32tm /config /update
D:\> reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpServer /v Enabled /t REG_DWORD /d 1 /f
D:\> net stop wuauserv
D:\> net start wuauserv

Open Firewall

D:\> netsh advfirewall firewall add rule name="NTP Server" dir=out protocol=udp localport=123 profile=any enable=yes action=allow
D:\> netsh advfirewall firewall add rule name="NTP Server" dir=in  protocol=udp localport=123 profile=any enable=yes action=allow

Check configuration, a section NtpServer should appear

D:\> w32tm /query /configuration
...
NtpServer (Local)
DllName: C:\Windows\system32\w32time.dll (Local)
Enabled: 1 (Local)
InputProvider: 0 (Local)
AllowNonstandardModeCombinations: 1 (Local)
...

Test it from another computer

C:\> w32tm /stripchart /computer:youtNTPServer /samples:4 /dataonly
Tracking youtNTPServer[192.168.254.1:123].
Collecting 4 samples.
The current time is 22.05.2018 22:53:55.
22:53:55  -00.0636377s
22:53:56  -00.0662772s
22:53:57  -00.0583119s
22:53:58  -00.0671685s

Michael

Advertisment to support michlstechblog.info

Time limit is exhausted. Please reload CAPTCHA.

Original Theme by Schiy · Powered by WordPress