Synchronize Time With Ntp Server

The NTS-6002-GPS is a complete time solution for medium to large organizations. The GPS NTP time server receives time from up to 12 satellites and supplies it to thousands of devices on two separate networks. For instance, provide synchronized time to an external public network and an internal staff network at the same time.

  • Network Time Protocol (NTP) Network Time Protocol (NTP) is the default time synchronization protocol used by the Windows Time Service (WTS) in Windows servers and workstations. NTP is implemented via UDP over port 123 and can operate in broadcast and multicast modes, or by direct queries.
  • Time Synchronization. NTP is a TCP/IP protocol for synchronizing time over a network. Basically a client requests the current time from a server, and uses it to set its own clock.

Network Time Protocol (NTP) Network Time Protocol (NTP) is the default time synchronization protocol used by the Windows Time Service (WTS) in Windows servers and workstations. NTP is implemented via UDP over port 123 and can operate in broadcast and multicast modes, or by direct queries.

Instead, you need to rely on another Windows Time Services tool provided by Microsoft to change the force change the NTP time server and sync with external time source. To use w32tim to set an external authoritative NTP server on a domain controller (primary or secondary), Windows Server or Windows Workstation, follow these steps. I am working on windows 7. I can sync time of win7 from a ntp linux server manually. How can I do that in command prompt. So I can run it on windows startup. And windows task plan not work for me. The time should be like this: Linux server - windows 7. Any one knows that? I can read msdn.

To cope with the demand of two networks, the NTS-6002-GPS is faster than the NTS-4000 series and can handle up to 500,000 time requests every minute.

By providing dual network functionality in a single unit, the GPS NTP server is a cost-effective method of time synchronization for larger organizations.

The server mounts in a 19-inch rack, making it easy to install alongside your existing IT hardware. The server maintains network security by sitting behind your firewall. Also available with a radio antenna to receive an WWVB, MSF or DCF time signal.

Galleon Systems has over 20 years’ experience manufacturing NTP servers, clocks and software for customers such as Vodafone, Ford and HSBC. With a six-year warranty and outstanding customer support, you can have complete assurance about the reliability and accuracy of your GPS time server.

Use NTP to Sync Time

Authored by: Jered Heeschen

Synchronize Time With Ntp Server

You can easily keep your system’s date and time accurate by using networktime protocol (NTP).

Having an accurate clock on your server ensures that timestamps inemails sent from your machine are correct. An accurate clock isespecially helpful when you need to look at the logs from a particulartime of day.

If you don’t occasionally set the system clock yourself, the time willslowly drift away from a perfectly accurate setting. That’s whenNTP is useful.

What is NTP?

NTP lets you automatically sync your system time with a remote server.The NTP can be used to update the clock on a machine with a remoteserver. This keeps your machine’s time accurate by syncing with serversthat are known to have accurate times. NTP also keeps the clocks onseveral machines in sync, thus making it easier to match log entries foran event across multiple servers.

It’s easy to set up an NTP server to adjust your machine’s clockregularly. It’s also possible to make it a bit more complicated if you needyour clock accurate down to the millisecond instead of just to thesecond.

Install

The first thing to do is to install the NTP server. Grab the package byrunning:

Ubuntu operating systems / Debian:

CentOS:

Ater you install NTP, you can ensure the service runs at boot time byrunning the following command:

Fedora / RHEL:

Ater you install NTP, you can ensure the service runs at boot time byrunning the following command:

Start the service

To make sure the NTP service starts after installing it, run the following command:

Ubuntu operating systems / Debian / CentOS / RHEL:

Fedora:

As is usual for Linux® services, you can stop or restart the NTP serviceby running the preceding command with stop or restart as the argumentinstead of start.

Quickstart

Most people just want to get NTP running and don’t need to sync theirclock to pinpoint, millisecond-level accuracy. In this case, you don’tneed to do anything else. When you installed NTP, it set you up withdefault servers with which to sync, so NTP syncs your clockautomatically. Congratulations on a job well done!

The .ntpconf file

Synchronize Time With Ntp Server Ip

If you want to use NTP to sync several of your own machines, or if youwant to choose NTP servers other than the defaults, you can find the NTPconfiguration file at /etc/ntp.conf.

A few settings can be changed, but the only settings ofinterest to most users include server entries. Use the defaultsettings for your specific Linux distribution.

With more than one server entry, your NTP server queries all serversand select a time on which most of the polled servers agree. Because NTPuses three or more servers, your clock is more accurate than if ituses only one.

Adding the iBurst option after the server address speeds up the NTPtime sync slightly. While this is helpful, it isn’t essential.

The dynamic option tells NTP that it can try a configured server againlater if it’s unavailable at some point. The dynamic option is usefulwhen NTP runs on a machine that doesn’t always have access to theInternet. It is not necessary on a machine with a dedicated connection.

NTP security

Protect yourself against NTP server attacks by adding disable monitor toyour /etc/ntp.conf file. Disabling monitoring prevents unwanted remotequeries that use commands from older versions of NTP, such as monlist.

Syncing multiple servers

If you have more than one machine to sync, it is best to designate oneas the master NTP server. Set up the master server to connect to anoutside NTP server, then have the other machines sync to the master.This setup reduces the number of outgoing connections and guaranteesthat all of your machines have their time set to the same value. Thisconfiguration requires changes to the server settings in the ntp.conffiles on each machine.

Set up any external servers you want to use on the master machine. Forexample, if you want to use the NTP pool servers, you can set the server valuesin the master ntp.conf file to:

Point the ntp.conf to your master server on every other machine that needsto sync the time. For example, if your master server ismain.example.com, you would alter the ntp.conf files on the secondarymachines so that the server entries are as follows:

After setting the server parameters and ensuring that the iptables entries don’tblock connections to your main NTP server, restart the NTP services oneach machine to get them syncing.

Adjusting iptables

NTP uses UDP port 123 to conduct its business, either connecting toanother NTP server or accepting incoming connections. If you haveiptables filtering incoming traffic on the main NTP server in yourcluster, you need to open port 123 to UDP traffic to allow theother servers to connect to it. You can open port 123 for UDP trafficwith the following iptables arguments:

Choosing an NTP server

When syncing one or more machines via NTP, you want at least one ofthem to set their time from a reliable external server. Manypublic servers out there are either synced directly from an atomicclock (guaranteeing an absolutely accurate time) or synced fromanother server that syncs to an atomic clock.

Synchronize Time With Ntp Server

Public NTP server lists

How To Synchronize Time With Ntp Server

The best source for lists of public NTP servers is the NTP ServersWebHome at the mainNTP site. The site has a description of the servers available, andthe sidebar has links to three levels of NTP servers: Primary,secondary, and pool.

Deciding what type of server to sync from depends on how accurateyou need your servers to be.

NTP pool servers

For most users, the pool servers are the best choice. Pool servers aremachines that have volunteered to make their NTP server available to thepublic. They typically sync from a secondary NTP server, so their time isaccurate, but not necessarily accurate to the nearest millisecond.

Most users don’t need their machine time accurate to the nearestmillisecond; they just want to know what time it is. Use the poolservers unless you need pinpoint accuracy.

Using the NTP pool servers is as easy as setting the server entries inyour ntp.conf file to:

To ensure that you only connect to pool servers in your own country orregion, visit the pool serverspage for morespecific addresses. For most people, the above entries are more thansufficient. Those addresses rotate among a huge list of volunteer NTPservers worldwide, so the load on any one machine never gets too great.

If you want to contribute to the NTP pool after you’ve set up your NTPserver, get details on how to do so from the poolwebsite.

Primary and secondary servers

The other two tiers of NTP servers are primary and secondary servers. Aprimary server gets its time directly from an atomic clock(or from GPS satellites, which use atomic clocks). Atomic clocks areexpensive, so there aren’t many primary servers. You don’t have to use aprimary server unless you’re looking for extreme scientific accuracy.

A secondary server usually gets its time from a primary server. If youwant accuracy down to the millisecond level, having three secondaryservers in your ntp.conf works well.

You can see what public servers are available in either tier byselecting either list from the NTP ServersWebHome. Beforeselecting and using a server, check the details for that server asfollows:

  • ISO: The ISO column lists the country of origin of thatparticular server.
  • AccessPolicy: The AccessPolicy field tells you what the accesspolicy is for that server. Open Access means the server can beused by the public, subject to any notification requirements theserver has.
  • Notify: The Notify field for secondary servers lists thethat server administrator’s preferences regarding whether theyshould be notified before you sync with their NTP server. Admins whowant to be notified are usually trying to manage the traffic totheir server, so be sure and respect their wishesregarding notification. Note that primary servers are alwaysconsidered as requesting notification before use.
  • Service Area: If you’ve selected a primary or secondary serveryou want to use, click its hostname in the list to view furtherdetails for that server. Among the details listed is theServiceArea field that describes the geographic or demographicgroup they intend to serve. If that field is Public, you donot have to be in a particular region to use the server. If theylist a more specific service area, be sure to respect the serveradministrator’s wishes in that regard.

Testing with ntpdate

Before using an external NTP server to sync your time, you should makesure you can actually connect to the server from your machine.Fortunately, there’s a tool for that included with the NTP server calledntpdate.

The ntpdate command syncs your clock with an NTP server. It’ssimilar to what the NTP server does on a regular basis. The ntpd programis a separate package on Ubuntu® operating systems and Debian®. The otherdistributions install ntpdate at the time of ntpd installation. Touse ntpdate, Ubuntu operating system and Debian users must first install it.

Set your clock to sync at times you specify by using cron to runntpdate. Otherwise, run the NTP server because it uses less bandwidth andkeeps time more accurately by tracking your clock’s drift over time andadjusting accordingly. Use ntpdate for testing purposes only.

The ntpdate command does not run when the NTP server is running. If yourun ntpdate and get a response like “the NTP socket is in use,” thismeans your NTP server is running. Stop it with the appropriate commandfor your distribution:

Ubuntu operating systems / Debian

CentOS / Fedora / RHEL

Windows Server Ntp Sync

You can now run ntpdate with the server you want to sync against as anargument. For example, to tell ntpdate to try and sync with“pool.ntp.org”, run the following command:

When you’re finished testing, remember to restart NTP:

Ubuntu operating systems / Debian

CentOS / Fedora / RHEL

Summary

Fortunately, NTP time syncing is pretty easy to do. After you set thetime servers and start the NTP service, it does its work quietly inthe background.

If NTP has any problems, it logs them to the system log, which youshould be checking regularly anyway.

For more details on setting up an NTP server and what options areavailable, visit the NTP documentationsite. If you want toknow more about how NTP works, go to the main NTP website, and all will be revealed.

Share this information:

©2020 Rackspace US, Inc.

Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License