Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] ntpd not updating time
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
sveyret
n00b
n00b


Joined: 27 Oct 2016
Posts: 9

PostPosted: Fri Feb 01, 2019 8:55 am    Post subject: [SOLVED] ntpd not updating time Reply with quote

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
View user's profile Send private message
Syl20
Guru
Guru


Joined: 04 Aug 2005
Posts: 553
Location: France

PostPosted: Fri Feb 01, 2019 9:45 am    Post subject: Re: ntpd not updating time Reply with quote

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
View user's profile Send private message
sveyret
n00b
n00b


Joined: 27 Oct 2016
Posts: 9

PostPosted: Fri Feb 01, 2019 11:07 am    Post subject: Reply with quote

Thank you, it works now. I wouldn't guess that restrictions also applied to servers!
_________________
Stéphane
Gentoo in the Alps…
Back to top
View user's profile Send private message
sveyret
n00b
n00b


Joined: 27 Oct 2016
Posts: 9

PostPosted: Fri Feb 01, 2019 11:28 am    Post subject: Reply with quote

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
View user's profile Send private message
Syl20
Guru
Guru


Joined: 04 Aug 2005
Posts: 553
Location: France

PostPosted: Tue Feb 12, 2019 9:39 am    Post subject: Reply with quote

Interesting. Thank you for this tip.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum