How to use

How to use chrony.eu NTP pool?

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

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

Configure NTP client on Linux.

Procedure to configure NTP client on Linux.


Distributions with chrony package
  • any Linux distributions
  • with installed chrony package.

Distributions with ntpd package
  • any Linux distributions
  • with installed ntpd package

Linux configuration procedure with chrony NTP time clients.


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. It is beyond scope of this short document to guide trough chrony package installation procedure for particular linux distribution and version.

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


1.) Open ssh terminal window.

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


2.) Search for chrony configuration file.

Search for chrony configuration file (normally in /etc or one of sub directories) with:

   sudo find / -name "chrony.conf"

For this example we will assume that configuration file is located at /etc/chrony.conf .


3.) Show current configured time servers(s) or pool(s).

Now we know full path of configuration file. We will display configured server(s) and/or pool(s) in the configuration file.

   sudo grep '^[ \t]*server[ \t]\+' /etc/chrony.conf
   sudo grep '^[ \t]*pool[ \t]\+' /etc/chrony.conf

Commands displays currently configured time server(s) and pool(s) for chronyd daemon.


4.) Select IP protocol version.

In order to align server connection to your network configuration it is advisable to define IP protocol version for chronyd 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
   ntpPool=$(echo -n "ipv${IPver}.pool.chrony.eu ")

5.) Update chronyd configuration file /etc/chrony.conf.

We have to delete our server(s) and/or pool(s) from configuration file in case that configuration already exsists:

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

We have to add our pool back to chronyd configuration file /etc/chrony.conf .

   sudo /bin/sh -c "echo pool $ntpPool iburst >>/etc/chrony.conf"

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

Command will print chrony.eu configured pool. If last line of command output is "OK", you applied command successfully.


7.) Restart chronyd service.

Restart of chronyd on systemd based distributions:

   sudo systemctl restart chronyd.service

Restart of chronyd on classical non systemd based distributions:

   sudo service chronyd restart

7.) Check chrony NTP sources.

To figure out which NTP sources are currently in use by chrony daemon enter

   sudo chronyc sources

This command will list all NTP sources. If both IPv4 and IPv6 are available each server from pool.chrony.eu may be listed twice as IPv4 and as IPv6 address, depending on server selection algorithm.


8.) Not all NTP servers visable?

Note that default value of maxsources is four and this limits NTP clients to select (depending on algorithm selection) maximum of four servers per pool. That means that only four NTP servers from pool.chrony.eu will be selected out of eight total ( 4x IPv4 + 4x IPv6). It can be changed to higher value with:

    maxsources 10

This will set maximum NTP servers from one pool to 10 NTP servers.

Linux configuration procedure with ntpd NTP time clients.


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 Linux device with user name which has sufficient privileges. User may have sudo privilege, it is in correct administrative user group or it is root user.


2.) Search for ntpd configuration file.

Search for ntpd configuration file (normally in /etc or one of sub directories) with:

   sudo find / -name "ntp.conf"

For this example we will assume that configuration file is located at /etc/ntp.conf .


3.) Show current time servers(s) configuration.

Now we know full path of configuration file. We will display configured server(s) in the configuration file.

   sudo grep '^[ \t]*server[ \t]\+' /etc/ntp.conf

Commands displays currently configured time server(s) for ntpd daemon.


4.) 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}pool.chrony.eu ";done)

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"

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

If last line of command output is "OK", you applied command sucessfully.


7.)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

8.) Restart ntpd service.

Restart of ntpd on systemd based distributions:

   sudo systemctl restart ntpd.service

Restart of ntpdd on classical non systemd based distributions:

   sudo service ntpd restart

This command stops ntpd server and start server again with updated configuration.


10.) Check ntpd's sources.

To figure out which NTP sources are currenty in use by ntpd daemon enter

   sudo ntpq -p

This command will list all NTP sources. If both IPv4 and IPv6 are avaliable each server from configuration may be listed twice as IPv4 and as IPv6 address, depending on server selection algorithem.