Welcome to the Slackware Documentation Project

Fresh HOWTO in need of proofreading. Enjoy. Niki Kovacs Fri Sep 7 18:53:47 CEST 2012

Looks good content-wise, Niki, but titles and headings need proper capitalization. I can fix if you would like me to. — V. T. Eric Layton 2012/09/07 20:50
Looks OK to me. I've stated my opinion of the capitalisation rule on the styleguide discussion page. — Brian Lawrence 2012/09/08 06:10

There is a HUGE problem in this HOWTO: a sysadmin should NEVER select a time server, but always go through the pooling facility of ntp.org - this prevents individual time servers from being swamped by time sync requests. In other words, one should always use the ISO two-letter country code, for instance: de.pool.ntp.org for Germany, uk.pool.ntp.org for the United Kingdom and so on and so forth. Please see: http://www.pool.ntp.org/en/use.html and correct accordingly…


As per Niki request, I'm mentioning here that I (cmyster) have added the minor change of NTP sync without daemonizing.


Quoting from http://www.pool.ntp.org: “As pool.ntp.org will assign you timeservers from all over the world, time quality will not be ideal. You get a bit better result if you use the continental zones (For example europe, north-america, oceania or asia.pool.ntp.org), and even better time if you use the country zone (like ch.pool.ntp.org in Switzerland) - for all these zones, you can again use the 0, 1 or 2 prefixes, like 0.ch.pool.ntp.org. Note, however, that the country zone might not exist for your country, or might contain only one or two timeservers. If you know timeservers that are really close to you (measured by network distance, with traceroute or ping), time probably will be even better.” Which means the information displayed on the HOWTO is correct. Niki Kovacs


Thanks, Niki, I learned something today! ;-) (isn't that what this wiki is all about?)



Deordiev Oleg notes about article:
For understand NTP engine and program, i read special book, and write article on ukrainian language.
Some recommendation (used around Internet) about ntpd - is wrong (for new versions of ntpd).
For example:
1)
Directive “server” used for one domain name or IP address.
Directive “pool” used for CNAME with list of more than one IP address (for example 0.ua.pool.ntp.org is a pool of ip addresses) (NTP if “pool” use export list of IPs from CNAME).
As a result, in ntp world have 2x types of server - this is s “server” and “pool”. And use server directive for pool - is wrong.

2)
Method - Undisciplined Local Clock driver is old:
server 127.127.1.0
fudge 127.127.1.0 stratum 10
For short it use only for local net without access to Internet. And very important if you have Internet in mode local clock, you need set PREFER argument for external source of time, because only this argument can override FUDGE modifier. If not use Prefer arg. NTP automatically set local time as only one right source of time, even if exist connection with external source (NTP even not check connection with it, and permanent set itself as valid source).
This driver is old, and not provide redundant.

For new version NTP (newer then 4.2.2 (2006-06-08)) need use Orphan-Mode Driver.
Delete directives:
server 127.127.1.0
fudge 127.127.1.0 stratum 10
And use:
tos orphan 5
For set itself Stratum 5 if external sources is not reachable, after 60 sec (can ovveride this by set: tos orphanwait 60). This option set in some servers in local net (for examples 2 server with NTP) and enumerate one itself other “cross”, and if one of it get valid time, other server sync with it. This provide redundancy.

Config for example:

Server-1 (192.168.68.1)

server 192.168.68.2 burst iburst
server 62.149.0.30
pool 0.ua.pool.ntp.org
pool 1.ua.pool.ntp.org
pool 2.ua.pool.ntp.org
pool 3.ua.pool.ntp.org

tos orphan 10
tinker panic 0

keys /etc/ntp/keys
driftfile /etc/ntpd.drift
logfile /var/log/ntp.log
pidfile /var/run/ntpd.pid

restrict default ignore
restrict 127.0.0.1
restrict 192.168.0.0 mask 255.255.0.0 nomodify notrap

restrict 192.168.68.2 notrap noquery nomodify
restrict 62.149.0.30 notrap noquery nomodify
restrict 0.ua.pool.ntp.org noquery notrap
restrict 1.ua.pool.ntp.org noquery notrap
restrict 2.ua.pool.ntp.org noquery notrap
restrict 3.ua.pool.ntp.org noquery notrap

Server-2 (192.168.68.2)

server 192.168.68.1 burst iburst
server 62.149.0.30
pool 0.ua.pool.ntp.org
pool 1.ua.pool.ntp.org
pool 2.ua.pool.ntp.org
pool 3.ua.pool.ntp.org

tos orphan 10
tinker panic 0

keys /etc/ntp/keys
driftfile /etc/ntpd.drift
logfile /var/log/ntp.log
pidfile /var/run/ntpd.pid

restrict default ignore
restrict 127.0.0.1
restrict 192.168.0.0 mask 255.255.0.0 nomodify notrap

restrict 192.168.68.1 notrap noquery nomodify
restrict 62.149.0.30 notrap noquery nomodify
restrict 0.ua.pool.ntp.org noquery notrap
restrict 1.ua.pool.ntp.org noquery notrap
restrict 2.ua.pool.ntp.org noquery notrap
restrict 3.ua.pool.ntp.org noquery notrap

Client (192.168.68.100)

server 192.168.68.1 iburst burst
server 192.168.68.2 iburst burst

tinker panic 0

driftfile /etc/ntpd.drift
logfile /var/log/ntp.log
pidfile /var/run/ntpd.pid

restrict default ignore

restrict 192.168.68.1 noquery notrap
restrict 192.168.68.2 noquery notrap
restrict 127.0.0.1

Server NTP with Orphan mode can by even One. But for all right - need some servers.

For very detail info read book The Network Time Protocol on Earth and in Space because i not provide very clear and right English for understand. But if you can questions, can write my.

Мy suggestions for articles - ftp://ifconfig.com.ua/pub/book/ntp-daemon.odt


In Other Languages
Translations of this page?:
QR Code
QR Code talk:howtos:network_services:ntp (generated for current page)