NTP time synchronization server settings

Source: Internet
Author: User
Tags net time

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.