View previous topic :: View next topic |
Author |
Message |
sveyret n00b

Joined: 27 Oct 2016 Posts: 23
|
Posted: Fri Feb 01, 2019 8:55 am Post subject: [SOLVED] ntpd not updating time |
|
|
Hi,
I installed net-misc/ntp with the following USE flags:
Code: |
net-misc/ntp-4.2.8_p12::gentoo USE="ipv6 readline ssl threads -caps -debug -libressl -openntpd -parse-clocks -samba (-selinux) -snmp -vim-syntax -zeroconf"
|
and the following configuration:
Code: |
~ > cat /etc/ntp.conf
# Pools for Gentoo users
server 0.gentoo.pool.ntp.org
server 1.gentoo.pool.ntp.org
server 2.gentoo.pool.ntp.org
server 3.gentoo.pool.ntp.org
# you should not need to modify the following paths
driftfile /var/lib/ntp/ntp.drift
restrict default ignore
restrict 127.0.0.1
restrict [::1]
|
The daemon is started at default level:
Code: |
~ > rc-update
ntpd | default
|
The daemon is correctly running, I didn't find any ntp line in dmesg nor any ntp file in /var/log. It seems to listen to network interfaces. But it never tries to read the time in the servers, and so never update time.
Code: |
~ > ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
dedibox.demonge .INIT. 16 u - 64 0 0.000 0.000 0.000
mica.ad-notam.n .INIT. 16 u - 64 0 0.000 0.000 0.000
ntp-1.arkena.ne .INIT. 16 u - 64 0 0.000 0.000 0.000
obelix.fraho.eu .INIT. 16 u - 64 0 0.000 0.000 0.000
|
As a test, I stopped the ntpd service and tried ntpdate. It updated my clock correctly.
Does someone have a clue for explaining why ntpd is not working correctly? Did I make something wrong either in the use flags or in the configuration file which prevent ntpd from reading time in servers? I am behind a firewall, but outgoing connections should not be blocked (and ntpdate has managed to set time!)
Thank you by advance. _________________ Stéphane
Gentoo in the Alps…
Last edited by sveyret on Fri Feb 01, 2019 11:19 am; edited 1 time in total |
|
Back to top |
|
 |
Syl20 Guru


Joined: 04 Aug 2005 Posts: 568 Location: France
|
Posted: Fri Feb 01, 2019 9:45 am Post subject: Re: ntpd not updating time |
|
|
sveyret wrote: | Code: | restrict default ignore
restrict 127.0.0.1
restrict [::1]
|
|
"restrict default ignore" is a good security choice, but you need to add exceptions for the clients and for the servers :
Code: | restrict 0.gentoo.pool.ntp.org kod notrap nomodify nopeer noquery
restrict 1.gentoo.pool.ntp.org kod notrap nomodify nopeer noquery
restrict 2.gentoo.pool.ntp.org kod notrap nomodify nopeer noquery
restrict 2.gentoo.pool.ntp.org kod notrap nomodify nopeer noquery
restrict 127.0.0.1
restrict [::1]
restrict default ignore |
|
|
Back to top |
|
 |
sveyret n00b

Joined: 27 Oct 2016 Posts: 23
|
Posted: Fri Feb 01, 2019 11:07 am Post subject: |
|
|
Thank you, it works now. I wouldn't guess that restrictions also applied to servers! _________________ Stéphane
Gentoo in the Alps… |
|
Back to top |
|
 |
sveyret n00b

Joined: 27 Oct 2016 Posts: 23
|
Posted: Fri Feb 01, 2019 11:28 am Post subject: |
|
|
Just for futur references, in order to prevent from adding a line for each server, I actually added the line:
Code: |
restrict source kod notrap nomodify nopeer noquery
|
_________________ Stéphane
Gentoo in the Alps… |
|
Back to top |
|
 |
Syl20 Guru


Joined: 04 Aug 2005 Posts: 568 Location: France
|
Posted: Tue Feb 12, 2019 9:39 am Post subject: |
|
|
Interesting. Thank you for this tip. |
|
Back to top |
|
 |
|