Configuring time synchronization

To configure time synchronization with NTP servers:

  1. Install the chrony package. To do so, run one of the following commands depending on the utilized operating system:
    • CentOS or Red Hat Enterprise Linux:

      yum install -y chrony

    • SUSE Linux Enterprise Server:

      zypper install chrony

    • Ubuntu or Debian:

      apt-get install chrony

  2. Enable autostart of the chronyd service. To do so, run one of the following commands depending on the utilized operating system:
    • Ubuntu or Debian:

      systemctl enable chrony

    • Other operating systems:

      systemctl enable chronyd

  3. Depending on the operating system, open one of the following files:
    • CentOS, Red Hat Enterprise Linux, SUSE Linux Enterprise Server, or Debian:

      /etc/chrony.conf

    • Ubuntu:

      /etc/chrony/chrony.conf

  4. Add strings with the IP addresses of those NTP servers with which you want to configure time synchronization. For example:

    server <IP address of the NTP server> iburst

  5. Comment (add the # character at the beginning of the string) the strings with the IP addresses of those NTP servers that you want to use for time synchronization.
  6. If you are using a Windows domain controller for time synchronization, add the following string:

    maxdistance 16.0

  7. Save and close the /etc/chrony.conf file.
  8. Restart the chronyd service. To do so, run one of the following commands depending on the utilized operating system:
    • Ubuntu or Debian:

      systemctl restart chrony

    • Other operating systems:

      systemctl restart chronyd

  9. Verify the time synchronization. To do so, execute the command:

    chronyc sources -v

    If the displayed IP addresses match the addresses of the NTP servers that you specified in the chrony.conf file, synchronization was correctly configured.

Time synchronization between the Squid server and NTP servers will be configured.

Page top