Server-side:
1. Packaging
Slightly....
2. Modify the NTP service configuration file
Configuration file location:/etc/ntp.conf
What to modify:
# Set the IP network segment to synchronize with the server time , the following is the 192.168.x.x machine can synchronize with the server
Restrict 192.168.0.0 mask 255.255.0.0
# Set the server IPthatthe NTP server itself synchronizes ,127.127.1.0 to synchronize with the server itself
# If you add prefer at the end, it means that this host is a priority sync
Server 127.127.1.0
# This line is the level of the time server. Set to 0 is the top level, if you want to update the time to another NTP Server, please do not # set it to 0
Fudge 127.127.1.0 Stratum 10
3. Restart the service
Client:
1. Packaging
2. Modify The NTP service configuration file
Configuration file location:/etc/ntp.conf
What to modify:
# Add a server field that indicates to which server to synchronize
Server 192.168.146.100
3. Synchronizing NTP
Ntpdate-u 192.168.146.100
Related error:
1.20 Jul 13:25:08 ntpdate[2299]: No server suitable for synchronization found
Use ntpdate-d 192.168.146.100 to view if the output
192.168.146.100:server Dropped:strata too high
Indicates that the fudge 127.127.1.0 stratum set error, first under normal circumstances stratum This is worth limiting is "0~15", if reported, and stratum set Normal, check whether IP is available
Related references:
http://wangyou871228.blog.163.com/blog/static/27695152201379101059990/
Http://www.cnblogs.com/kerrycode/archive/2015/08/20/4744804.html
Installing NTP server and client synchronization under Linux