3

I am trying to set up ntpd on my servers, so that their clocks are kept in sync. I am running Ubuntu 16.04. I have followed these instructions, and everything seems fine until the end. It's now a while later and the output of timedatectl looks like:

      Local time: Thu 2018-06-14 08:41:32 UTC
  Universal time: Thu 2018-06-14 08:41:32 UTC
        RTC time: Thu 2018-06-14 08:41:05
       Time zone: Etc/UTC (UTC, +0000)
 Network time on: no
NTP synchronized: yes
 RTC in local TZ: no

and the output of ntpq -p is:

     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 0.ubuntu.pool.n .POOL.          16 p    -   64    0    0.000    0.000   0.000
 1.ubuntu.pool.n .POOL.          16 p    -   64    0    0.000    0.000   0.000
 2.ubuntu.pool.n .POOL.          16 p    -   64    0    0.000    0.000   0.000
 3.ubuntu.pool.n .POOL.          16 p    -   64    0    0.000    0.000   0.000
 ntp.ubuntu.com  .POOL.          16 p    -   64    0    0.000    0.000   0.000

I have configured my AWS security groups so that UDP is open to 0.0.0.0/0 on port 123. All outgoing connections are allowed from these servers anyway.

nmap -sU -p 123 reports:

PORT    STATE         SERVICE
123/udp open|filtered ntp

iptables -L -n -v reports:

Chain INPUT (policy ACCEPT 860K packets, 1119M bytes)
 pkts bytes target     prot opt in     out     source               destination
 1206  140K f2b-sshd   tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            multiport dports 22

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain OUTPUT (policy ACCEPT 573K packets, 460M bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain f2b-sshd (1 references)
 pkts bytes target     prot opt in     out     source               destination
 1206  140K RETURN     all  --  *      *       0.0.0.0/0            0.0.0.0/0

I haven't modified the default ntp config at all.

How can I figure out why ntp isn't updating?

11
  • Any chance your instance has a local firewall that's blocking the NTP packets?
    – MadHatter
    Jun 14, 2018 at 10:34
  • @MadHatter I don't think so. I'm afraid I don't know how I would check. Jun 14, 2018 at 11:07
  • @MadHatter I nmap'ed the port, but the situation is no clearer. Jun 14, 2018 at 11:13
  • I'm not sure the nmap output is dispositive. Could we get the output of iptables -L -n -v on the server in question?
    – MadHatter
    Jun 14, 2018 at 11:47
  • @MadHatter Done Jun 14, 2018 at 12:40

1 Answer 1

2

You're fairly confident that it isn't a firewall issue. I have my reservations, but you've followed Amazon's guide to setting up chrony with Amazon's servers, and it's working.

An interesting experiment would be to try setting up ntpd with those same servers, or to point chrony at external servers instead. That would tell us for sure whether the issue is some kind of hard-to-find firewall blocking NTP to servers which aren't internal to Amazon, or if it really is a chrony vs. ntpd issue.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .