Find the answer to your Linux question:
Results 1 to 3 of 3
I'm having difficulty with NTP syncing correctly across multiple machines. They are all configured identically (as far as NTP goes) to use one local NTP server (attached to a GPS ...
  1. #1
    Just Joined!
    Join Date
    Jun 2010
    Posts
    4

    RHEL NTP syncing issue

    I'm having difficulty with NTP syncing correctly across multiple machines. They are all configured identically (as far as NTP goes) to use one local NTP server (attached to a GPS receiver) as their server and use their local clock as a backup.

    My issue is that some choose the NTP server as their primary sync, and some choose to latch on to their local clock. The NTP server is of stratum 6 where the local clock is fudged to 10.


    Example using ntpq -p (Sorry about the formatting, apparently white space isn't allowed):
    remote refid st t when poll reach delay offset jitter
    ==================================================
    *hostname LOCAL(0) 6 u 59 64 377 0.094 -0.079 0.270
    LOCAL(0) .LOCL. 10 l 64 64 377 0.000 0.000 0.001

    vs.

    hostname LOCAL(0) 6 u 88 128 377 0.105 -0.223 0.296
    *LOCAL(0) .LOCL. 10 l 46 64 377 0.000 0.000 0.001

    Over time the one synced up to the local clock will drift.

    Using the 'prefer' switch (in /etc/ntp.conf) as below doesn't seem to make any difference:
    server hostname prefer

    Is there any way to force a primary NTP server? I want them all to sync to the hostname machine.

    Thanks in advance for any ideas.

  2. #2
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,281
    What does your ntp.conf file look like? White spaces are allowed when you use the proper tags, in this case the tasgs would be code not quote.

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

  3. #3
    Just Joined!
    Join Date
    Jun 2010
    Posts
    4
    Thanks for the reply, sorry about the lax response...I posted this right before going on vacation.

    Here is the NTP servers ntp.conf file. It is the default file with a couple modifications:
    -Removed the pool.ntp.org server lines
    -Commented out the fudge line for the local clock
    Code:
    # Permit time synchronization with our time source, but do not
    # permit the source to query or modify the service on this system.
    restrict default kod nomodify notrap nopeer noquery
    restrict -6 default kod nomodify notrap nopeer noquery
    
    # Permit all access over the loopback interface.  This could
    # be tightened as well, but to do so would effect some of
    # the administrative functions.
    restrict 127.0.0.1
    restrict -6 ::1
    
    # Hosts on local network are less restricted.
    #restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
    
    # Use public servers from the pool.ntp.org project.
    # Please consider joining the pool (WEBSITE REMOVED).
    
    
    
    
    #broadcast 192.168.1.255 key 42         # broadcast server
    #broadcastclient                        # broadcast client
    #broadcast 224.0.1.1 key 42             # multicast server
    #multicastclient 224.0.1.1              # multicast client
    #manycastserver 239.255.254.254         # manycast server
    #manycastclient 239.255.254.254 key 42  # manycast client
    
    # Undisciplined Local Clock. This is a fake driver intended for backup
    # and when no outside source of synchronized time is available.
    server  127.127.1.0     # local clock
    #fudge  127.127.1.0 stratum 10
    
    # Drift file.  Put this in a directory which the daemon can write to.
    # No symbolic links allowed, either, since the daemon updates the file
    # by creating a temporary in the same directory and then rename()'ing
    # it to the file.
    driftfile /var/lib/ntp/drift
    
    # Key file containing the keys and key identifiers used when operating
    # with symmetric key cryptography.
    keys /etc/ntp/keys
    
    # Specify the key identifiers which are trusted.
    #trustedkey 4 8 42
    
    # Specify the key identifier to use with the ntpdc utility.
    #requestkey 8
    
    # Specify the key identifier to use with the ntpq utility.
    #controlkey 8
    The only difference between the server file and the client files are:
    -There is an additional server line to the hostname that owns the ntp.conf file above (with or without 'prefer' made no difference):
    server hostname prefer
    -The fudge line for the local clock is not commented out

    Thanks for the tip on the code block.

Posting Permissions

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