Setting up an NTP server to include it in pool.ntp.org

Most distributions of Linux-based operating systems and many network devices use a * .pool.ntp.org server to set the clock.





Let's take a closer look at where the server data comes from, what is required to create your own server and add it to this cluster to help the time synchronization community.





As stated on the website https://www.ntppool.org/ru/   , it is a huge cluster of time servers providing reliable and easy-to-use NTP service for millions of clients and tens of millions of systems around the world use its services.





How to install your server, what is required for this?

Requires a regular server with a static real IP address with an up-to-date operating system, be it Linux / BSD or a similar device that is able to work stably as an ntp server using the NTP protocol https://ru.wikipedia.org/wiki/NTP that works over the Internet networks on port 123 / udp





Due to the low consumption of resources and channel (up to 10-15 kilobits per second), almost any configuration is suitable, for example, VPS / VDS based on KVM with minimal resources.





I quote from the site https://www.ntppool.org/ru/join.html





β€œCurrently, most servers receive around 5-15 NTP packets per second. Several times a day, peaks of 60-120 packets per second can occur. Converting to kilobits, we get about 10-15Kbps on average and about 50-120Kbps at peak loads. More and more servers are gradually joining the pool, so a sharp increase in load is not expected in the future. Thus, you are unlikely to need more than 384-512Kbit bandwidth (for receiving and sending) "





Installing an NTP server

In most Linux distributions, it is included in the standard operating system repositories and you just need to install it





apt install ntp for Debian / Ubuntu or yum install ntp for CentOS





/etc/ntp.conf 99% :





pool 0.debian.pool.ntp.org iburst







pool 1.debian.pool.ntp.org iburst







pool 2.debian.pool.ntp.org iburst







pool 3.debian.pool.ntp.org iburst







#,





http://support.ntp.org/bin/view/Servers/StratumTwoTimeServers http://support.ntp.org/bin/view/Servers/StratumOneTimeServers





google β€œntp server _”





4 6





2+2+2 -





2 - StratumOne





2 - StratumTwo





2 -





, ( ) - time.apple.com / time.facebook.com / time.google.com. - , "-" , , google leap second.





ntpdate -q -





root@gw:~# ntpdate -q ntp4.vniiftri.ru







server 89.109.251.24, stratum 1, offset 0.001008, delay 0.08249







 8 Jan 03:50:07 ntpdate[1414]: adjust time server 89.109.251.24 offset 0.001008 sec







, , β€œ ” (stratum 1).





(stratum) https://habr.com/ru/post/79461/





(, GPS-) (stratum 0).





(, GPS-)  1.





2 3 - .





( ntpdate -q) ntp- (service ntp restart) ntpq -pn





root@gw:~# ntpq -pn







     remote           refid      st t when poll reach   delay   offset  jitter







==============================================================================







-51.15.74.121    131.176.107.13   2 u   48   64   17    1.009   -0.030   0.246







*193.190.230.37  .EXT.            1 u   41   64   17    4.825   -0.263   0.853







+145.238.203.14  .MRS.            1 u   41   64   17   14.549   -0.857   0.127







-89.109.251.24   .MRS.            1 u   44   64   17   46.043    0.501   1.539







+62.231.6.98     .GPS.            1 u   43   64   17   41.770   -1.292   0.647







-80.60.208.118   193.67.79.202    2 u   43   64   17    8.324   -1.364   1.338







* - .





ntp . delay jitter, .





ntpdate -q ip- , udp/123





pool.ntp.org

https://www.ntppool.org/ru/join.html -





IP , .





( score) 10 - .





On the server management page, there is monitoring in the form of a graph and csv-format, where you can track the stability of the clock and the responses of your NTP server, if it is unavailable, an email will be sent about the problem.





You can observe the packets with the tcpdump port 123 command - you will see requests from various networks of different providers, mainly from client devices (Internet routers).





04:00:50.531801 IP gw.mytimeserver.net.ntp > 82-217-46-231.cable.dynamic.v4.ziggo.nl.59634: NTPv4, Server, length 48







04:00:50.888803 Imytimeserver.netP 51.144.84.29.ntp > gw.mytimeserver.net.ntp: NTPv4, Client, length 48







04:00:50.888998 IP gw.mytimeserver.net.ntp > 51.144.84.29.ntp: NTPv4, Server, length 48







04:00:51.621673 IP 46.11.105.3.54627 > gw.mytimeserver.net.ntp: NTPv4, Client, length 48







04:00:51.621916 IP gw.mytimeserver.net.ntp > 46.11.105.3.54627: NTPv4, Server, length 48







04:00:52.037807 IP 51.136.36.226.ntp > gw.mytimeserver.net.ntp: NTPv4, Client, length 48







04:00:52.052103 IP gw.mytimeserver.net.ntp > 40.68.72.138.ntp: NTPv4, Server, length 48







In this regard, I strongly recommend that Internet service providers install an ntp server on their network and include it in the ntp pool.





useful links





https://www.ntppool.org/ru/





https://www.ntp.org/





https://ru.wikipedia.org/wiki/NTP








All Articles