Simple ntp server configuration

Source: Internet
Author: User
Simple ntp server configuration-Linux Enterprise Application-Linux server application information. For details, refer to the following section. About Time Service
Network Time Protocol (NTP, Network Time Protocol) is used to synchronize all of its client clock services. The NTP server synchronizes the clock of the local system with a public NTP server and then serves as a time host so that all clients on the local network can synchronize the clock.

The biggest benefit of clock synchronization is the data in the log files on the relevant system. If you use the central log host to centrally manage logs in the network, the log results will better reflect the real situation. In a network that synchronizes the clock, the centralized performance monitoring and service monitoring systems can reflect system information in real time, and the system administrator can quickly detect and solve system errors.

Install and configure the NTP service
The following describes the simple configuration of the NTP server:

Generally, the Linux release will contain the ntp software package. If your system is not installed, run the rpm command to install the package. The following uses the fedora core 6 system as an example to configure a time server:

[Root@supersun.biz root] # rpm-ivh ntp-4.2.2p1-3.i386.rpm
Warning: ntp-4.2.2p1-3.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
Preparing... ######################################## ### [100%]
1: ntp ####################################### #### [100%]

Edit the configuration file/etc/ntp. conf
Restrict default nomodify notrap noquery
Restrict 127.0.0.1
Restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
Restrict 192.168.0.0 mask 255.255.255.0 nomodify notrap
Server 0.asia.pool.ntp.org
Server 1.asia.pool.ntp.org
Server 2.asia.pool.ntp.org
Server 3.asia.pool.ntp.org
Server 127.127.1.0
Fudge 127.127.1.0 stratum 10

The ITALIC part is the part I added. It sets the Intranet address of the two network segments of the time server and the external time server. Now we will give a brief explanation of the Configuration:

The first line of restrict and default defines the default access rules. nomodify prohibits remote hosts from modifying local server configurations, and notrap rejects special ntpdq To Capture messages, noquery rejects btodq/ntpdc queries (the query here is the server's own status query ).
The last two lines of the configuration file are used to provide the time service for the client at the local time when the server is out of contact with the public time server.

Port
Ntp uses udp. Remember to open port 123.

Start NTPD

Start the ntpd daemon:
Service ntpd start

Client Configuration

Run periodic tasks as root:
[Root @ supersun root] # crontab-e
Add the following content and update the time every 15 minutes:
*/15 * ntpdate ntp. supersun. biz
The ntpdate command is included in the ntp package. Check whether the system is installed.
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.