PDA

View Full Version : My notes on configuring NTPd



ToddAndMargo
12th August 2017, 01:18 AM
Fedora 26+: NTP server

Refernces:
https://docs.fedoraproject.org/en-US/Fedora/15/html/Deployment_Guide/sect-Date_and_Time_Configuration-Command_Line_Configuration-Network_Time_Protocol.html
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/s1-Understanding_the_ntpd_Configuration_File.html
http://support.ntp.org/bin/view/Support/AccessRestrictions#Section_6.5.1.2.


# dnf install ntpdate ntp

Find and test a server:
http://tf.nist.gov/tf-cgi/servers.cgi

# ntpdate -q time-a.nist.gov
server 129.6.15.28, stratum 1, offset 0.000755, delay 0.11977

# systemctl enable ntpdate.service


Note: add multiple lines for multiple restrists
# vi /etc/ntp.conf
server time-a.nist.gov iburst
server time-b.nist.gov iburst
server time-c.nist.gov iburst
server time-d.nist.gov iburst
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
restrict 127.0.0.1
restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap nopeer
restrict -6 ::1


# systemctl enable ntpd.service
# systemctl restart ntpd.service

To test:
$ ntpq -p
ntpq -p
remote refid st t when poll reach delay offset jitter
================================================== ============================
-time-a.nist.gov .NIST. 1 u 9 64 3 347.931 -126.76 78.492
+time-b.nist.gov .NIST. 1 u 11 64 3 94.621 0.240 1.328
+time-c.nist.gov .NIST. 1 u 12 64 3 94.671 0.268 1.291
*time-d.nist.gov .NIST. 1 u 18 64 3 93.467 0.313 1.573

tim8723
12th August 2017, 02:44 PM
Good write-up. Thanks.

Tim

ToddAndMargo
13th August 2017, 01:11 AM
Good write-up. Thanks.

Tim

You are most welcome.

marko
13th August 2017, 01:48 AM
Why are you using the obsolete Fedora 15 and Centos 6 ntp instructions? Fedora 26 uses chrony

https://docs.fedoraproject.org/en-US/Fedora/26/html/System_Administrators_Guide/ch-Configuring_NTP_Using_the_chrony_Suite.html

ToddAndMargo
13th August 2017, 06:55 AM
Why are you using the obsolete Fedora 15 and Centos 6 ntp instructions? Fedora 26 uses chrony

https://docs.fedoraproject.org/en-US/Fedora/26/html/System_Administrators_Guide/ch-Configuring_NTP_Using_the_chrony_Suite.html

The note started out with CentOS 5. Kind of a trip down memory lane. If you know a better reference, I will swap them out.

marko
13th August 2017, 07:01 AM
The note started out with CentOS 5. Kind of a trip down memory lane. If you know a better reference, I will swap them out.

I'd say the Fedora 26 URL I quoted is pretty good:

https://docs.fedoraproject.org/en-US/Fedora/26/html/System_Administrators_Guide/ch-Configuring_NTP_Using_the_chrony_Suite.html

Ntp and Chrony both have their advantages, the URL covers them.

ToddAndMargo
13th August 2017, 07:56 AM
I'd say the Fedora 26 URL I quoted is pretty good:

https://docs.fedoraproject.org/en-US/Fedora/26/html/System_Administrators_Guide/ch-Configuring_NTP_Using_the_chrony_Suite.html

Ntp and Chrony both have their advantages, the URL covers them.

From the link you gave me:


Things ntpd can do that chronyd cannot do:

ntpd fully supports NTP version 4 (RFC 5905), including broadcast, multicast, manycast clients and servers, and the orphan mode. It also supports extra authentication schemes based on public-key cryptography (RFC 5906). chronyd uses NTP version 3 (RFC 1305), which is compatible with version 4.



I meant to use ntpd and not chrony. This is meant for a server. You will notice from my write up that I use the NIST server's to synchronize with. And U want to get up to date with RFC 5905

Sounds like chrony would be nice for a workstation though.