Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    OpenNTPD works well few days and then not sync

    Scheduled Pinned Locked Moved 2.1 Snapshot Feedback and Problems - RETIRED
    29 Posts 7 Posters 14.1k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • jimpJ
      jimp Rebel Alliance Developer Netgate
      last edited by

      Current snaps should be switched to ntpd, works fine for me so far on a vm.

      Some notes that I mentioned to other devs about the switch:

      1. The boot-time behavior needs some observation, not sure if what I'm doing there is sufficient. I pass -g to ntpd which allows a large first skew, but I'm not sure if it's fast enough to sync at boot. We may need to bring back the call to ntpdate in rc before launching.

      2. FreeBSD's ntpd has no concept of selective binding/listening, it listens on all by default, and we can't use its restrict keywords because they are not compatible with *.pool.ntp.org - the restrict keywords can't handle multiple A records being returned. As such, I removed Services > OpenNTPD since the options were now irrelevant.

      3. I added a status page at Status > NTP that parses the ntpq output

      Adding on 3, I committed a fix today to clean the page up and make it a little better, but that's not in a snapshot yet.

      Remember: Upvote with the ๐Ÿ‘ button for any user/post you find to be helpful, informative, or deserving of recognition!

      Need help fast? Netgate Global Support!

      Do not Chat/PM for help!

      1 Reply Last reply Reply Quote 0
      • jimpJ
        jimp Rebel Alliance Developer Netgate
        last edited by

        That may be possible. If you pkg_add -r that and it works with those keywords, it would certainly be worth adding in.

        FYI- checked in a bunch more fixes this afternoon for various issues I found, it's fairly solid now.

        If we can get the interface bindings to go that'll be the icing on the cake.

        As an added bonus, this ntpd support ipv6, openntpd did not.

        Remember: Upvote with the ๐Ÿ‘ button for any user/post you find to be helpful, informative, or deserving of recognition!

        Need help fast? Netgate Global Support!

        Do not Chat/PM for help!

        1 Reply Last reply Reply Quote 0
        • D
          dominique.fournier
          last edited by

          Just a little html error need to be corrected in status_ntpd.php :

          Tally code
          Server
          Ref ID
          Stratum
          Type
          When
          Poll
          Reach
          Delay
          Offset
          Jitter

          should be :

          Tally code
          Server
          Ref ID
          Stratum
          Type
          When
          Poll
          Reach
          Delay
          Offset
          Jitter

          BTW, ntpd works well and stay synchronized since one hour. I will check for the long term. Thanks !!!

          2.1 (amd64)

          1 Reply Last reply Reply Quote 0
          • jimpJ
            jimp Rebel Alliance Developer Netgate
            last edited by

            That's already been corrected.

            Remember: Upvote with the ๐Ÿ‘ button for any user/post you find to be helpful, informative, or deserving of recognition!

            Need help fast? Netgate Global Support!

            Do not Chat/PM for help!

            1 Reply Last reply Reply Quote 0
            • D
              dhatz
              last edited by

              A question about a somewhat related topic: When there is a large time skew, is it possible to sync time without rebooting pfsense (which invokes ntpdate on startup) ?

              I run pfsense in a VM and suspend/hibernate the host PC every evening, which results in several hours time diff when the PC wakes up the next morning. Unfortunately in this scenario ntpd won't sync to the correct time, even after pfsense has been running for several hours.

              I could create a cron job to periodically run ntpdate -s xyz, but maybe pfsense offers a better way which I haven't found yet.

              1 Reply Last reply Reply Quote 0
              • jimpJ
                jimp Rebel Alliance Developer Netgate
                last edited by

                On new snaps (not out yet) or 2.0.2 you can run /usr/local/sbin/ntpdate_sync_once.sh
                That will kill ntpd, run ntpdate to force a sync, then restart ntpd.

                I suppose I could add a button to Status > NTP to invoke that.

                Remember: Upvote with the ๐Ÿ‘ button for any user/post you find to be helpful, informative, or deserving of recognition!

                Need help fast? Netgate Global Support!

                Do not Chat/PM for help!

                1 Reply Last reply Reply Quote 0
                • P
                  podperson
                  last edited by

                  On latest Snap, nano i386, D510MO.ย  Would not stay synced without use of JimP script.

                  Changed /var/etc/ntpd.conf.
                  On server lines, removed iburst, set minpoll 6 maxpoll 6.

                  Staying within 1 ms for 12 hours now.

                  1 Reply Last reply Reply Quote 0
                  • jimpJ
                    jimp Rebel Alliance Developer Netgate
                    last edited by

                    The values after the server line were pulled from FreeBSD's defaults. Not sure why yours needed to be changed that much.

                    What was the clock doing when you said it wouldn't stay in sync?

                    We may need to have a settings page to tweak those values if the defaults don't work for everyone.

                    Remember: Upvote with the ๐Ÿ‘ button for any user/post you find to be helpful, informative, or deserving of recognition!

                    Need help fast? Netgate Global Support!

                    Do not Chat/PM for help!

                    1 Reply Last reply Reply Quote 0
                    • johnpozJ
                      johnpoz LAYER 8 Global Moderator
                      last edited by

                      maxpoll 6 is pretty aggressive.. This is talking to ntp server every 64 seconds.. This really should not be required, normally maxpoll will work its way up to 9, or 1024 seconds.

                      Normally you should not have to make changes to these settings.

                      An intelligent man is sometimes forced to be drunk to spend time with his fools
                      If you get confused: Listen to the Music Play
                      Please don't Chat/PM me for help, unless mod related
                      SG-4860 24.11 | Lab VMs 2.8, 24.11

                      1 Reply Last reply Reply Quote 0
                      • jimpJ
                        jimp Rebel Alliance Developer Netgate
                        last edited by

                        OK, locking this topic for now so it doesn't attract more random ntp issues, this thread originally was for OpenNTP losing sync which is very far away from tweaking ntpd.

                        I may split some older posts from this topic off into separate threads since there are still interesting things in them, but they have diverged from the original topic.

                        Remember: Upvote with the ๐Ÿ‘ button for any user/post you find to be helpful, informative, or deserving of recognition!

                        Need help fast? Netgate Global Support!

                        Do not Chat/PM for help!

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post
                        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.