Results 1 to 6 of 6

Thread: NTP client not syncing with server

  1. #1
    Join Date
    Jan 2018
    Beans
    14

    NTP client not syncing with server

    I have a Ubuntu server running NTP. This seems to be working OK

    Code:
    sudo ntpq -npcrv
         remote           refid      st t when poll reach   delay   offset 
    jitter
    ==============================================================================
    *216.239.35.0    .GOOG.           1 u  302 1024  377   16.475    0.523  
    0.256
    +216.239.35.4    .GOOG.           1 u  793 1024  377   20.461    1.155  
    1.203
    +216.239.35.8    .GOOG.           1 u  140 1024  377   21.860    1.204  
    0.587
    -216.239.35.12   .GOOG.           1 u  971 1024  377   19.215   -0.035  
    2.464
    associd=0 status=0615 leap_none, sync_ntp, 1 event, clock_sync, leap=00, stratum=2,
    precision=-23, rootdelay=16.475, rootdisp=29.552, refid=216.239.35.0,
    reftime=e96b46fd.e6fd1f35  Mon, Feb  5 2024 11:37:33.902,
    clock=e96b482c.941f5352  Mon, Feb  5 2024 11:42:36.578, peer=33036,
    tc=10, mintc=3, offset=0.834, frequency=22.740, sys_jitter=0.522,
    clk_jitter=0.358, clk_wander=0.047
    On my Ubuntu client the time is not syncing as shown my the leap_alarm state. The time was about 10 mins out, so I manually adjusted it and restarted the ntp service. But it's still showing as leap_alarm.

    Code:
    ntpq -npcrv
         remote           refid      st t when poll reach   delay   offset 
    jitter
    ==============================================================================
     srv1.company.loc .POOL.          16 p    -   64    0    0.000    0.000  
    0.000
    associd=0 status=c016 leap_alarm, sync_unspec, 1 event, restart, leap=11,
    stratum=16, precision=-24, rootdelay=0.000, rootdisp=3.795, refid=INIT,
    reftime=00000000.00000000  Thu, Feb  7 2036  6:28:16.000,
    clock=e96b4843.14967997  Mon, Feb  5 2024 11:42:59.080, peer=0, tc=3,
    mintc=3, offset=0.000000, frequency=4.418, sys_jitter=0.000000,
    clk_jitter=0.000, clk_wander=0.000
    Code:
     sudo ntpdate -q srv1.company.local
    server 10.1.0.1, stratum 2, offset -0.193649, delay 0.04465
     5 Feb 11:45:17 ntpdate[12231]: adjust time server IP offset
    -0.193649 sec
    Running:
    Code:
    sudo service ntp stop
    sudo ntpdate srv1.company.local
            5 Feb 12:05:14 ntpdate[13086]: adjust time server IP offset -0.193957 sec
    sudo service ntp start
    Last edited by godatum2; February 5th, 2024 at 01:07 PM.

  2. #2
    Join Date
    Mar 2010
    Location
    USA
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: NTP client not syncing with server

    You missed providing some information that would help with this...

    Do you have firewall rules to allow the NTP updates through from NTP client to NTP server?
    Code:
    sudo ufw allow from any to any port 123 proto udp
    In the hosts file of the clients, did you specify the IP and hostname of the NTP server in their hosts file? Or do you have verified local DNS resolv?

    Did you disable the systemd timesyncd service on the NTP client so that it doesn't fight and conflict with NTP client?

    Did you configure the /etc/ntp.conf file to add your NTP server as the new time server by adding a line
    Code:
    server <NTP-server-name> prefer iburst
    Substituting the name with what the NTP host is?

    Did you restart the NTP services on the clients and host to pick up any changes?
    Last edited by MAFoElffen; February 5th, 2024 at 07:09 PM.

    "Concurrent coexistence of Windows, Linux and UNIX..." || Ubuntu user # 33563, Linux user # 533637
    Sticky: Graphics Resolution | UbuntuForums 'system-info' Script | Posting Guidelines | Code Tags

  3. #3
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: NTP client not syncing with server

    Isn't NTP deprecated for security issues? Not that it is any better, but I switched to Chrony a few years ago. Don't forget to disable/purse systemd-timed.

    https://www.ntpsec.org/ has some specific hardware sync clocks available too. Most tie into GPS hardware, since GPS provided very accurate time anywhere on Earth.

  4. #4
    Join Date
    Jan 2018
    Beans
    14

    Re: NTP client not syncing with server

    The firewall is allowing UDP 123.

    I can resolve DNS for srv1.company.local using nslookup.

    Output of timedatectl:
    Code:
          
    Local time: Tue 2024-02-06 10:55:42 GMT
    Universal time: Tue 2024-02-06 10:55:42 UTC
    RTC time: Tue 2024-02-06 10:55:42
    Time zone: Europe/London (GMT, +0000)
     Network time on: yes
    NTP synchronized: no
     RTC in local TZ: no

    Contents of /etc/ntp.conf:
    Code:
    driftfile /var/lib/ntp/ntp.drift
    
    pool srv1.company.local
    
    # by default act only as a basic NTP client
    restrict -4 default nomodify nopeer noquery notrap
    restrict -6 default nomodify nopeer noquery notrap
    
    # Local users may interrogate the ntp server more closely.
    restrict 127.0.0.1
    restrict ::1
    


    I did restart the NTP service on the srv1.company.local host and client.

    On the host running
    sudo ss -lu:
    Code:
    State               Recv-Q              Send-Q                           Local Address:Port                             Peer Address:Port             Process
    
    UNCONN              0                   0                                   IP:NTP                                               *:*
    On the client:
    Code:
    sudo nmap -sU srv1.company.local
    
    PORT       STATE    SERVICE
    123/udp  open     ntp
    Last edited by godatum2; February 6th, 2024 at 12:29 PM.

  5. #5
    Join Date
    Nov 2008
    Location
    Boston MetroWest
    Beans
    16,326

    Re: NTP client not syncing with server

    Have you run ntpdate with the -v switch enabled?
    If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  6. #6
    Join Date
    Jan 2018
    Beans
    14

    Re: NTP client not syncing with server

    Quote Originally Posted by SeijiSensei View Post
    Have you run ntpdate with the -v switch enabled?
    I get an error:

    Code:
    no servers can be used, exiting

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •