Linux/centos NTP time synchronization, networking situation and no network configuration

Source: Internet
Author: User
Tags local time

Machine Networking:

If the server can be networked: Perform ntpdate 1.cn.pool.ntp.org the server will automatically synchronize time write a scheduled task to perform a time synchronization every two minutes;

Crontab-e

/2 */usr/sbin/ntpdate 1.cn.pool.ntp.org//So that time synchronization can be achieved

The following is a domestic NTP Server
1.cn.pool.ntp.org
2.cn.pool.ntp.org
3.cn.pool.ntp.org
0.cn.pool.ntp.org
cn.pool.ntp.org
tw.pool.ntp.org
0.tw.pool.ntp.org
1.tw.pool.ntp.org
2.tw.pool.ntp.org
3.tw.pool.ntp.org

If you cannot connect, you need to configure NtpServer NTP's package system default installation service called NTPD

Configuration file/etc/ntp.conf
Add the following lines
Restrict default Kod nomodify notrap nopeer noquery
restrict-6 default Kod nomodify notrap nopeer noquery
Restrict 127.0.0.1
Restrict-6:: 1
Restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap//means that the server from 192.168.1.1-192.168.1.254 can use our NTP server to synchronize time.
Server 192.168.1.12//indicates that the IP on the LAN as an NTP server cannot be networked.
Server 127.127.1.0 # Local clock
Fudge 127.127.1.0 stratum 10//The last two lines of the configuration file serve to provide time services to clients in local time when the server loses contact with a public time server

NTP Client configuration: Manually perform "Ntpdate 192.168.1.12" on the client to synchronize time

Then write the scheduled task timing synchronization time as above

If you are interested in this, please scan the QR code below for free for more details

Linux/centos NTP time synchronization, networking situation and no network configuration

Related Article

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.