Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method and Analysis of Building NTP Server in windows 2008 R2

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article shows you the method and analysis of windows 2008 R2 to build NTP server. The content is concise and easy to understand, which will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

NTP server configuration method

Windows runs to open "regedit" to edit the registry

Find "HKEY_LOCAL_MACHINE\ SYSTEM\ CurrentControlSet\ Services\ W32Time\ Parameters", and change the [Type] setting to "NTP"

Find "HKEY_LOCAL_MACHINE\ SYSTEM\ CurrentControlSet\ Services\ W32Time\ Config"

[AnnounceFlags] change the setting to 5 or a

When the value of AnnounceFlags is 5, the forced clock source is the local CMOS clock

When the value of AnnounceFlags is a, the clock source is the set NTP server address

4. "HKEY_LOCAL_MACHINE\ SYSTEM\ CurrentControlSet\ Services\ W32Time\ TimeProviders\ NtpServer"

The value of [Enabled] is modified to 1

This function enables the NTP server function (the NTP Server service is not enabled by default, unless the computer is upgraded to a domain control station)

5. Restart the Windows Time service attention (service is set to start automatically). Choose one of the two methods

A) Open the start menu and enter "CMD" in command line mode:

Net stop w32time & & net start w32time restart the win32time service

B) through the management tool-Service, shut down the windows time service first, and then turn it on, or you can set the service to start itself

(it is measured that it starts automatically, but it still does not start after restart. It needs to be started manually.)

The 6.NTP service is port UDP 123. Please note that the firewall releases the port, and the windows firewall release method:

Under the CMD command: netsh firewall add portopening protocol = UDP port = 123name = NTPSERVER

NTP client configuration method

1. Just modify the following registry

HKEY_LOCAL_MACHINE\ SYSTEM\ CurrentControlSet\ Services\ W32Time\ TimeProviders\ NtpClient

The SpecialPollInterval value is modified to decimal 43200 (in seconds, 43200 for 12 hours)

The SpecialPollTimeRemaining value is modified to [time synchronization server], 0 for example: 192.168.1.1

two。 Manually fill in the server in the system Internet time settings, as shown in the following figure, update immediately.

Note:

The time difference is too big, need to manually synchronize in the time configuration (the time in the lower right corner of the desktop) or there is a problem with synchronization, manually enter the server IP address in the following box and update immediately.

In the test, after the registry modification, exit and refresh, the value of SpecialPollTimeRemaining changes back to the original value, and manually enter the server Ip in the synchronization of the Internet time setting (below). Immediately after the update, windows saves the server IP record, and subsequent updates are normal.

The test passed:

Windows 2008 R2 can also be used as a NTP client synchronization superior clock source and as a NTP server for other NTP clients.

Simulator test results and analysis: when win2008 as a server does not have a superior clock source

Step 3 [AnnounceFlags] change the setting value to 5 before the switch is synchronized as a ntp client

When the setting value is a, the switch debug error:

* May 2715, Access restrict 22, 09, Access restrict, 740, 2017 ntp-client NTP/7/ACL: 0x00000008.

* May 2715 Received a packet at 22 09 Received a packet at 2017 ntp-client NTP/7/AUTH: Received a packet at 73, from88.1.1.20, mode 4, key ID 00000000, length 48, authentication result 0

* May 2715 The packet from 22 failed thevalidity tests 0x0000d420. 09 The packet from 740 2017 failed thevalidity tests 0x0000d420.

The server grabs the package to show that the versions of the two parties are different, and the number of clock layers is unknown or illegal (0).

3. When the value is set to 5, the number of instant clock layers returned by the server is 1, which is normal, but the version is still different.

4. In two cases, the client sends the packet, the client sends the same packet, and the number of local clock layers on the client is 0.

After synchronization, you will find that the time difference between the switch and the NTP windows 2008 server is 8 hours.

This is because windows 2008 is Zone 8, Beijing time, while network equipment generally defaults to Zone 0.

So the switch can use the following command clock timezone utc+0800 add 8

When win2008 has a superior clock source as a server

In the third step of Win2088NTP server configuration, [AnnounceFlags] modify the setting value to a. For more information, please see Section 1.

For Win2008NTP client configuration, refer to ntp client configuration. You need to manually enter the server in the Internet time configuration, and click Update now.

Enable the windows time service

The interaction process is as follows:

1. Win2008 synchronizes atomic clock time as a ntp client

Client sends packets

Server return packet

Other time synchronization interactions are similar

two。 The switch synchronizes the win2008 time as a ntp client

Exchange sends packets as a client

Win2008 as a server return packet

Other interactive messages are similar

Ntp status on the switch:

Dis ntp sessions

Source reference stra reach poll now offset delay disper

*

[12345] 88.1.1.20 88.1.1.254 2 255 64 178 2758.7 1.4038 15.197

Notes: 1source (master), 2 source (peer), 3 selected, 4 candidate, 5 configured.

Total sessions: 1

Display clock source is 88.1.1.20, clock source 88.1.1.20 clock layers is 2, clock source reference clock atomic clock 88.1.1.254, (88.1.1.20 is the address of win2008 server)

Disntp status

Clock status: synchronized

Clock stratum: 3

System peer: 88.1.1.20

Local mode: client

Reference clock ID: 88.1.1.20

Leap indicator: 00

Clock jitter: 0.019089 s

Stability: 0.000 pps

Clock precision: 2 ^-15

Root delay: 32.65381 ms

Root dispersion: 2952.42310 ms

Reference time: dcd4d362.1cf1fe84 Sun, May 28 2017 12:41:06.113

Shows that the local ntp clock layer of the switch is 3, and the clock server ip and reference clock are both win2008.

The above content is the method and analysis of building NTP server in windows 2008 R2. Have you learned the knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report