Configure NTP server
To configure your Linux system as an NTP server, you will need to install the ntp daemon (ntpd). You can do this with the sudo apt-get install ntp command:
The ntpd configuration file is /etc/ntp.conf. Open this file in a text editor:
This file contains the list of internet NTP servers that will be used for time synchronization by your NTP server. You should also add a range of IP addresses that will be allowed to use this server as their NTP server. This can be done using the restrict command:
In our example, the restrict 192.168.198.0 mask 255.255.255.0 nomodify notrap line will allow clients from the 192.168.198.0 – 192.168.198.255 subnet to query our NTP server.
Next, restart the NTP deamon with the sudo service ntp reload command:
Next, you need to configure your NTP clients to use your NTP server for time synchronization.:
Restart the NTP deamon on the NTP client (sudo service ntp reload). You can check whether time synchronization is successful by executing the sudo ntpq -p command on your NTP client: