NTP server configuration in multiple systems

Source: Internet
Author: User
Tags net time sntp server
◆ 1. what is network time service NetTimeService is similar to network file download service FTP and network browsing service WWW. it is a network service that provides network time server

◆ 1. what is network time service?

The network Time Service, like the network file downloading Service FTP and the network browsing Service WWW, is a network Service. a computer that provides the network Time Service is called a network Time server. Of course, some time servers have a hardware-only structure. GPS satellite information is used to obtain the time. the appearance of the time server is similar to that of a switch, which is not listed in the text. This article mainly introduces how a computer obtains the standard time provided by the upper-level time server through the network, and then serves the local area network of the unit, so that all the computers in the same unit can be synchronized with the standard time, generally, the time error is less than 0.5 seconds.

In TCP/IP, the protocol used for time synchronization is NTP, which is David L. professor Mills proposed in 1985 that in addition to estimating the round-trip latency of packets on the network, it can also independently estimate the computer clock deviation, so as to achieve high precision computer calibration on the network, it is a communication protocol designed to enable different machines to maintain the same time on the Internet. A time server is a type of server that uses NTP. it enables computers on the network to maintain time synchronization.

NTP is a complex synchronization time protocol that spans a wide area network or a LAN. it generally provides millisecond-level precision. SNTP (Simple Network Time Protocol) is a subset of NTP for hosts that do not require NTP for Complex Network Time synchronization. It is usually used by several hosts on the LAN to synchronize clock with other NTP hosts over the Internet, and then to provide time synchronization services to other clients in the LAN. Generally, SNTP uses the UDP 123 terminal number, which is supported by both Linux and Windows systems. it is the mainstream protocol for setting up network time servers.

Time Protocol (RFC-868) Protocol is a relatively simple Protocol. This protocol provides machine-readable date and time information independent from the site. The time service returns the number of seconds from midnight, January 1, January 1, 1900 to the present. This protocol provides services through TCP or UDP port 37. The TIME service in Linux provides this service, which is rarely used in Windows.

Many TIME calibration software on the Internet, some support the SNTP protocol, some support the TIME Protocol, and some support both. we should pay special attention to the selection. In addition, the "net time Machine name/set/yes" command is also used in the peer network of the Windows system for time calibration using the netbios protocol, because this method does not support hybrid networks and cross-network segment networks, this article is not particularly introduced.

◆ II. what is the use of the time server?

Some people may think that the computer clock has little error, but it is very wrong. In the computer system, file storage, file transmission, and the timestamp in the email address are based on the computer clock. If we want to perform file search and log query in the future, if the system clock is not accurate, or the computer time on the same network is not synchronized, it will cause a lot of trouble in subsequent work. Many backup software, compilation software, and FTP tools are compared based on the file storage time. if the time is not uniform, it will make the software difficult to work normally.

◆ 3. how to synchronize the clock of all computers in the Lan

First, you need to find one or more computers on the Internet that provide time services (hereinafter referred to as the time server ). Currently, many organizations provide standard clock service for free. at http: // www.ntp.org, there are many time server addresses. We recommend that you use the pool.ntp.org address at ordinary times, because this domain name will be randomly selected from the IP address of a group of clock servers during DNS resolution, which is very suitable for general users. You can also search by keyword "public time server" in the search engine to find the time server that is closer to you.

Next, select a computer that can access the Internet in the organization and synchronize it with the master time server. this computer can be a Linux host, or a win98, 2000, or XP host. At the same time, this computer is set as a time server inside the LAN (hereinafter referred to as a time server) for all computers inside the LAN to proofread the time.

Set the time service client on all computers within the organization. if the client is a win2000, XP, or Linux system, no software is required. For example, when the client is a win98 system, it must be treated differently based on the time server type: if the time server uses the SNTP protocol for clock synchronization, an sntp client software must be installed on the win98 server, if the time server is provided by a windows computer through the netbios protocol, you do not need to install any software on win98.

◆ 4. set the time server

The following sections describe Linux, Win98, and Win2000XP, and only describe the setup of sntp services. The timeserver and netbios services are not introduced due to the few applications.

1. Linux host as a time server (RedHat9.0 is used as an example)

Step 1: Check whether the ntp software package is installed. Enter "rpm-qa | grep ntp" and the "ntp-4.1.2-0.rc1" should be displayed if it is already installed ".

Step 2: install ntp software, download the rpm package from the [url] ftp://ftp.redhat.com [/url], and enter "rpm-ivh ntp-xxx.rpm" for installation.

Step 3: configure the ntp service. After backing up the original/etc/ntp. conf file, enter the following content:

Server pool.ntp.org

Server pool.ntp.org

Server pool.ntp.org

Driftfile/etc/ntp/drift

Pool.ntp.org is set for all three lines of servers to provide connection redundancy. when the first address fails to be connected, the later address provides the time service. Note that pool.ntp.org corresponds to a group of IP addresses, which are randomly allocated by DNS.

Step 4: Start the ntp service. Enter "service ntp restart ".

To ensure that the ntp service can be automatically started after the Linux server is started, enter "chkconfig ntpd on ". The ntp software in Linux not only automatically synchronizes with the clock on the Internet, but also is an SNTP server, which can be used by computers in the Lan for time verification. We recommend that you use the date command to manually correct the time after starting the NTP service. later, the system will automatically synchronize with the master time server on the Internet. The ntp service also has a benefit. if the current system time is different from the standard time, it does not immediately correct the time, but gradually reduces the error with the standard time to avoid sudden changes in the system time.

2. use Windows and XP as time servers

Step 1: specify the master time server. Enter "net time/setsntp: pool.ntp.org" in DOS Mode. here we specify pool.ntp.org as the master time server or another address.

Step 2: Start synchronization with the master time server. Disable the windows time service and then enable it. It can be completed on the "service" interface of "administrative tools", or "net stop w32time" and "net start w32time" in DOS mode ".

Step 3: Set the Windows time service startup mode to automatic. Completed in the "service" interface of "management tools.

Note:This windows host cannot be added to any domain; otherwise, the windows time service cannot be started. At this time, the windows computer is already connected to the master time server, and the time will be automatically verified with the master time server each time the computer starts. If the network is disconnected, the computer will automatically proofread the time in 45 minutes. It should be noted that the computer clock and standard time error cannot exceed 12 hours, otherwise it cannot be automatically proofread, but it must be manually corrected.

Step 4: make the computer a time server for the computer inside the LAN to proofread the time. Use "regedit" to open the registry and change LocalNTP in "HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesW32TimeParameters" to 1.

3. Windows98 as a time server

Windows 98 is generally not recommended as a time server, and win98 itself does not include the time server function. third-party software must be installed. The nettime software ([url] http://nettime.sourceforge.net/#/url]) introduced later in this article is a very good time client software that can work in windows98, 2000, and XP systems, when "Allow other computers to sync to this computer" is selected, this computer can be used as a time server.

◆ V. set the time server client

The main task of the client is to connect to the time server in the Lan to keep the computer clock synchronized with the server. Introduction to Linux, Windows 98, 2000, and XP

1. LINUX host

In fact, when we introduced the ntp service in Linux, we already mentioned that the ntp time service is also a time service client, as long as/etc/ntp. change "server pool.ntp.org" in the conf file to "server internal time server IP address. If you do not want to use the ntp service, you can also use the ntpdate command in the ntp package. you only need to manually execute "ntpdate time server IP address. If you want to perform automatic synchronization on a daily basis, you can place this command in cron. Note that the ntp service and ntpdate commands on the same computer cannot be used at the same time.

2. Windows2000 host

Perform the first three steps when setting the time server.

3. Windows XP host

You can set it by using the Windows2000 host method, or double-click the clock icon in the lower right corner of the taskbar to open the "date and time properties" dialog box, on the "Internet time" card, select "automatically synchronize with the Internet time server" and enter the IP address of the internal time server on the server.

4. Windows 98 host

Third-party software needs to be installed. free software nettime is a good software. it supports SNTP (UDP123), TIME (TCP37), TIME-UDP (UDP37) three methods for TIME synchronization. The software is easy to operate. you only need to enter the IP Address of the time server in the Lan in "Hostname or IP Address", and select SNTP in "Protocol.

Of course, running "net time Machine name or IP address/set/yes" on windows 98 may also synchronize the clock with other windows computers, provided that these computers are in the same network segment, the netbios protocol is installed. Put this command in autoexec. bat to enable automatic synchronization at startup.

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.