How to use

How to use NTP pool?

Short instructions how to setup your computer/device in few simple steps.

  • Linux
  • How to set NTP pool on Linux.
  • Windows
  • How to set NTP pool on Windows.
  • macOS
  • How to set NTP pool on macOS.
  • FreeBSD and other
  • How to set NTP pool on FreeBSD or other devices.

Configure NTP client on FreeBSD or other system.

Procedure to configure NTP client on FreeBSD or other system.

FreeBSD operating system

other devices/operating systems
  • other devices not listed here
  • other operating systems not listed here

Configuration procedure for FreeBSD operating system.

0. Before start.

To configure NTP client you need super user privileges or root password. It is not possible to change configuration without sufficient privileges. All required packages are normally already installed. It is beyond scope of this short document to guide trough chrony package installation procedure.

Please note, that commands may be splitted to several lines depending of device browser width.

1.) Open ssh terminal window.

Login to FreeBSD device with user name which has sufficient priviledes. User may have sudo privilege, it is in correct administrative user group or it is root user.

2.) Select IP protocol version.

In order to align server connection to your network configuration it is advisable to define IP protocol version for ntpd daemon. There are three possible variants - use one from list:

   IPver=""      # use IPv4 and IPv6
   IPver="ipv6." # use IPv6 only
   IPver="ipv4." # use IPv4 only
   ntpServers=$(for t in 1 2 3 4 ; do echo -n "${t}.${IPver} ";done)

3.) Update current time.

This command will update current time on computer. Requirement for ntpd startup is to have reasonably small time difference at startup, otherwise it will not start.

   sudo ntpdate -vq $ntpServers

4.) Update startup configuration file /etc/rc.conf.

To update time and start ntpd daemon automatically at computer boot we have to update /etc/rc.conf

Delete existing definitions if they exists:

   sudo sed -i "/^ntpdate_enable=/d" /etc/rc.conf
   sudo sed -i "/^ntpd_enable=/d" /etc/rc.conf

Add updated definitions back to /etc/ntp.conf:

   sudo echo 'ntpdate_enable="YES"' >> /etc/rc.conf
   sudo echo 'ntpd_enable="YES"' >> /etc/rc.conf

This two definitions instruct FreeBSD to synchronize time on startup (1st line) and to use ntpd for time synchronization (2nd line).

5.) Update ntpd configuration file /etc/ntp.conf.

We have to delete our servers from configuration file in case that configuration already exsists:

   sudo sed -i '/^[ \t]*server[ \t]\+\([1-4]\.\)*\(ipv[46]\.\)*\(pool\.\)*chrony\.eu/d' /etc/ntp.conf

We have to add our servers back to to ntpd configuration file /etc/ntp.conf

   sudo /bin/sh -c "for t in $ntpServers ; do echo server \$t iburst ; done >>/etc/ntp.conf"

Now we can check configuration file with:

   sudo grep '^[ \t]*server[ \t]\+\([1-4]\.\)*\(ipv[46]\.\)*\(pool\.\)*chrony\.eu' /etc/chrony.conf && \
        echo "OK"

Command will print all configured server(s). If last line of command output is "OK, you applied command successfully.

5.) Restart ntpd.

It it wise to stop ntpd first and then start it again to assure that configuration file /etc/ntp is read:

   sudo /etc/rc.d/ntpd stop
   sudo /etc/rc.d/ntpd start

Now we should check status of ntpd that it is operational:

   sudo /etc/rc.d/ntpd status

6.) Check ntpd's servers in use.

For our piece of mind let's check ntpd status:

  sudo ntpq -p

If servers are on list, they are in use for time synchronization.

NTP client on other devices.

What to do if your device is not on list?

Unfortunately, we can't cover all configuration possibilities for all devices with many different operating systems. There are a lot of embedded, IoT,... devices which do not fall in any of this category. There are also switches, routers, other communication devices which use custom version of operating system and have own way of configuring time service. Generally, they use some sort of modified version of chrony or ntpd packages. A lot of times manufacturers add own cli or web interfaces to hide implementation specific differences. In this case check how to configure NTP client in user manual of device and / or manufacturer's web site.

  Sorry we do not cover that cases.

  It would be nice to build database for that cases ... maybe sometimes in future...
Stay tuned...