NTP in Linux

The NTP is a core protocol that is used by most of the IT infrastructure. The purpose of using it is to synchronize the date and time information.

But it’s very important to configure the NTP for your server, client, and other networking device. The NTP uses the UDP port number, which is by default 123.

Networking in Python (UDP Server &a...
Networking in Python (UDP Server & Client) (Video 71)

In this article, we will illustrate the use of NTP, and also we will see a sample execution of the command with the necessary explanation to make the topic easier.

Network Time Protocol NTP in Linux

Below shared an example where we illustrated the use of the command NTP in Linux. The command will be as follows:

systemctl status ntp

We printed a list of NTP services status through the above command.

After executing the above command, you will get an output like the one below.

ntp.service - Network Time Service
  Loaded: loaded (/lib/systemd/system/ntp.service; enabled; vendor preset: enabled)
  Active: active (running) since Sun 2022-08-14 14:23:48 PST; 10h left
    Docs: man: ntpd (8)
Main PID: 80903 (ntpd)
   Tasks: 2 (limit: 3476)
  Memory: 3.2M
CGroup: /system.slice/ntp.service
L80901 /usr/sbin/ntpd -p /var/run/ntpd.pid -g -U 131:139
Aug 14 03:26:39 ubuntu ntpd[80903]: Soliciting pool server 62.12.173.11
Aug 14 03:26:42 ubuntu ntpd[80903]: Soliciting pool server 91.189.89.198
Aug 14 03:27:45 ubuntu ntpd[80903]: Soliciting pool server 2001:4f8:110: 12c8: :2:123
Aug 14 03:27:47 ubuntu ntpd[80903]: Soliciting pool server 91.189.94.4,
Aug 14 03:28:51 ubuntu ntpd[80903]: Soliciting pool server 2001:8a8: 1005:1::11
Aug 14 03:28:53 ubuntu ntpd[80903]: Soliciting pool server 2001:67c:1560:8003::07
Aug 14 03:29:38 ubuntu ntpd[80903]: kernel reports TIME ERROR: Ox41: Clock Unsynchronized
Aug 14 03:29:57 ubuntu ntpd[80903]: Soliciting pool server 2001:440:1880:5555: :2
Aug 14 03:29:58 ubuntu ntpd[80903]: Soliciting pool server 2001:67c:1560:8003: :08
Aug 14 03:31:02 ubuntu ntpd[80903]: Soliciting pool server 2001:a98:11::40

Please take note that the command shared in this article is only executable for the Linux environment.