Chronyd<\/strong> on Fedora28\/Fedora29<\/a>.<\/p>\n\n\n\nInstalling NTP Server Using NTPd on Fedora 29\/Fedora 28<\/h2>\n\n\n\nInstall NTPd on Fedora<\/h3>\n\n\n\n
The ntpd deamon is provided by the ntp package. Therefore, run the command below to install ntpd.<\/p>\n\n\n\n
dnf install ntp -y<\/code><\/pre>\n\n\n\nIn order to use ntpd the default user space daemon, chronyd, must be stopped and disabled, if at all it is installed on the same system. Run the commands below to stop and disable chronyd from restarting at system start.<\/p>\n\n\n\n
systemctl stop chronyd\nsystemctl disable chronyd<\/code><\/pre>\n\n\n\nTo start and enable ntpd at system start, run the following command;<\/p>\n\n\n\n
systemctl start ntpd\nsystemctl enable ntpd<\/code><\/pre>\n\n\n\nConfigure NTP on Fedora<\/h2>\n\n\n\n
The main configuration file for NTP is \/etc\/ntp.conf<\/code>. This file is installed together with ntpd and is configured to use time servers from the Fedora pool by default.<\/p>\n\n\n\nConfigure Acces control to NTP service<\/h4>\n\n\n\n
Access to the NTP service can be controlled or restricted by making the use of the restrict<\/code>command in the ntp.conf file. The command syntax is;<\/p>\n\n\n\nrestrict option<\/code> where option can be;<\/p>\n\n\n\n\nignore<\/code> \u2014 All packets will be ignored, including ntpq and ntpdc queries.<\/li>\n\n\n\nkod<\/code> \u2014 a \u201cKiss-o’-death\u201d packet is to be sent to reduce unwanted queries.<\/li>\n\n\n\nlimited<\/code> \u2014 do not respond to time service requests if the packet violates the rate limit default values or those specified by the discard command. ntpq and ntpdc queries are not affected.<\/li>\n\n\n\nlowpriotrap<\/code> \u2014 traps set by matching hosts to be low priority.<\/li>\n\n\n\nnomodify<\/code> \u2014 prevents any changes to the configuration.<\/li>\n\n\n\nnoquery<\/code> \u2014 prevents ntpq and ntpdc queries, but not time queries, from being answered. This can help prevent NTP amplification attacks.<\/li>\n\n\n\nnopeer<\/code> \u2014 prevents a peer association being formed.<\/li>\n\n\n\nnoserver<\/code> \u2014 deny all packets except ntpq and ntpdc queries.<\/li>\n\n\n\nnotrap<\/code> \u2014 prevents ntpdc control message protocol traps.<\/li>\n\n\n\nnotrust<\/code> \u2014 deny packets that are not cryptographically authenticated.<\/li>\n\n\n\nnotpport<\/code> \u2014 modify the match algorithm to only apply the restriction if the source port is the standard NTP UDP port 123.<\/li>\n\n\n\nversion<\/code> \u2014 deny packets that do not match the current NTP version.<\/li>\n<\/ul>\n\n\n\nTo restrict local access to the server, edit the \/etc\/ntp.conf<\/code> and add the network range the server is allowed to receive requests from.<\/p>\n\n\n\nvim \/etc\/ntp.conf<\/code><\/pre>\n\n\n\n...<\/strong>\n# Hosts on local network are less restricted.\n#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap\nrestrict 192.168.43.0 mask 255.255.255.0 nomodify notrap\n<\/strong>...<\/strong><\/code><\/pre>\n\n\n\nConfigure time servers<\/h4>\n\n\n\n
NTP is configured to use time servers from the Fedora pool by default. Therefore, change this by replacing the time servers with the servers close to your timezone area.<\/p>\n\n\n\n
\n...<\/strong>\n# Use public servers from the pool.ntp.org project.\n# Please consider joining the pool (http:\/\/www.pool.ntp.org\/join.html).\n#pool 2.fedora.pool.ntp.org iburst\nserver 0.africa.pool.ntp.org iburst<\/strong>\nserver 1.africa.pool.ntp.org iburst<\/strong>\nserver 2.africa.pool.ntp.org iburst<\/strong>\nserver 3.africa.pool.ntp.org iburst\n<\/strong>...<\/strong>\n<\/code><\/pre>\n\n\n\nConfigure Firewall to Allow Incoming NTP connections<\/h3>\n\n\n\n
NTP listens on UDP port 123 and therefore, traffic to this port has to be e permitted through network and host-based firewalls in order for NTP to function. Run the command below to allow packets to port 123\/UDP.<\/p>\n\n\n\n
firewall-cmd --add-port=123\/udp --permanent\nfirewall-cmd --reload<\/code><\/pre>\n\n\n\nRestart NTPd daemon<\/p>\n\n\n\n
systemctl restart ntpd<\/code><\/pre>\n\n\n\nTo verify if NTP server is working normally, run the command below.<\/p>\n\n\n\n
ntpq -p<\/code><\/pre>\n\n\n\n\n remote refid st t when poll reach delay offset jitter\n==============================================================================\n*lon1.kakte.com 178.62.115.212 3 u 56 64 377 232.746 115.195 181.208\n+ntp3.inx.net.za 0.60.139.194 2 u 13 64 377 289.535 15.691 202.211\n+ntp.blueline.mg 193.79.237.14 2 u 55 64 377 501.236 131.465 54.479\n<\/code><\/pre>\n\n\n\nNow that all is well, proceed to configure NTP client.<\/p>\n\n\n\n
Configure NTP client<\/h2>\n\n\n\n
In order to receive time synchronization from our NTP server, proceed to configure the client. In this case, you can either use the NTP service daemon (ntpd<\/code>) or ntpdate<\/code> command as follows;<\/p>\n\n\n\nUsing NTPd<\/h4>\n\n\n\n
Install ntp package that provides ntpd daemon.<\/p>\n\n\n\n
dnf install ntp -y<\/code><\/pre>\n\n\n\nAfter the installation, you need to edit the \/etc\/ntp.conf<\/code> configuration file to add the address of your NTP server.<\/p>\n\n\n\nThe server command takes the following syntax;<\/p>\n\n\n\n
server address<\/em><\/code><\/pre>\n\n\n\nwhere address is either the IP or resolvable hostname of the NTP server.<\/p>\n\n\n\n
...<\/strong>\n# Use public servers from the pool.ntp.org project.\n# Please consider joining the pool (http:\/\/www.pool.ntp.org\/join.html).\n#pool 2.fedora.pool.ntp.org iburst\nserver 192.168.43.69 iburst\n...<\/strong><\/code><\/pre>\n\n\n\nSave the configuration file and restart ntpd daemon.<\/p>\n\n\n\n
Verify the connection to the server using the netcat command;<\/p>\n\n\n\n
nc -zuv 192.168.43.69 123<\/code><\/pre>\n\n\n\nNcat: Version 7.70 ( https:\/\/nmap.org\/ncat )\nNcat: Connected to 192.168.43.69:123<\/strong>.\nNcat: UDP packet sent successfully\nNcat: 1 bytes sent, 0 bytes received in 2.01 seconds.<\/code><\/pre>\n\n\n\nNow that your client can successfully connect to your NTP server, verify that time synchronization is working;<\/p>\n\n\n\n
ntpq -p<\/code><\/pre>\n\n\n\n remote refid st t when poll reach delay offset jitter\n==============================================================================\n 192.168.43.69 167.99.82.6 4 u 31 64 7 0.292 67.320 12.531<\/code><\/pre>\n\n\n\nUsing ntpdate<\/h4>\n\n\n\n
If you want to synchronize the time of your client with NTP server once, you can use ntpdate<\/code> as follows;<\/p>\n\n\n\ndnf install ntpdate -y<\/code><\/pre>\n\n\n\nOnce the installation is done, you can use the ntpdate to synchronize the time as follows;<\/p>\n\n\n\n
Start and enable ntpdate<\/p>\n\n\n\n
systemctl start ntpdate\nsystemctl enable ntpdate<\/code><\/pre>\n\n\n\nTo use ntpdate, you need to stop and disable ntpd<\/p>\n\n\n\n
systemctl stop ntpd\nsystemctl disable ntpd<\/code><\/pre>\n\n\n\nTo verify that time synchronization works fine, run ntpdate command as shown below<\/p>\n\n\n\n
ntpdate 192.168.43.69<\/code><\/pre>\n\n\n\n18 Nov 12:30:02 ntpdate[4983]: step time server 192.168.43.69 offset 3608.684470 sec<\/code><\/pre>\n\n\n\nGreat. That is all it takes to install and configure NTP server Using NTPd on Fedora 29\/Fedora 28.<\/p>\n\n\n\n
To configure NTP server on Fedora 30 using NTPd, then check our guide by following the link below;<\/p>\n\n\n\n
Configure NTP Server using NTPd on Fedora 30<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"This is yet another guide on how to install and configure NTP server using NTPd on Fedora 29\/Fedora 28. Step through this guide in order<\/p>\n","protected":false},"author":1,"featured_media":12718,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[121,236,237],"tags":[5141,243,245,244],"class_list":["post-1445","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howtos","category-ntp","category-rhel","tag-how-to-install-and-configure-ntp-server-using-ntpd-on-fedora-29-fedora-28","tag-ntpd","tag-ntpdate","tag-ntpq","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50","resize-featured-image"],"_links":{"self":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/1445"}],"collection":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=1445"}],"version-history":[{"count":7,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/1445\/revisions"}],"predecessor-version":[{"id":21060,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/1445\/revisions\/21060"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media\/12718"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=1445"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=1445"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=1445"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}