1. Window server settings
[Server settings]
1) modify the following key values of the registry:
HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ w32time \ timeproviders \ ntpserver \ enabled = 1
HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ w32time \ config \ announceflags = 5
2) restart the NTP service
Net stop w32time & Net start w32time
3) Adjust firewall settings and enable the NTP port
[Client settings]
Method 1) <-this method has not been tested successfully.
Modify the following key values in the registry:
HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ w32time \ timeproviders \ ntpclient \ specialpollinterval = 43200 (decimal)
HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ w32time \ timeproviders \ ntpclient \ specialpolltimeremaining = 192.168.1.1, 0 (replace 192.168.1.1 with the actual IP address of the NTP server)
Method 2) <-this method is tested and effective.
NET Time/setsntp: "192.168.1.1, 0x01"
Net stop w32time & Net start w32time
W32tm/Resync/Nowait/rediscover
Ii. Linux
Install NTP:
Yum install NTP
Configure the time Source
VI/etc/NTP. conf
Server 210.72.145.44
Server NTP. API. bz
Server 2.centos.pool.ntp.org
Configure the NTP service for the client (the network segment machine of 172.16.0.0/24)
# Vi/etc/NTP. conf
Restrict 172.16.0. 0 mask limit 255.0 nomodify notrap
Configure NTP server layers to provide local services
Server 127.127.1.0 # local clock
Fudge 127.127.1.0 stratum 2
Set the automatic running time service at startup
Chkconfig ntpd on
Start or stop the Time Service
# Service ntpd start
# Service ntpd stop
# Service ntpd restart
Verify that the NTP service is running
Pgrep ntpd
Time when the current server is updated
Ntpdate-u 210.72.145.44
Configure iptable rules to allow the client to access the local NTP sever
VI/etc/sysconfig/iptables
Add a line (NTP server uses UDP port 123)
-A input-M state -- state new-m udp-p udp -- dport 123-J accept
Restart iptables
Service iptables restart
NTP time synchronization server settings