Search Text         
Search Tips?
Search By   And   Or   Boolean   Exact Match   TA #
Search In   Whole Doc   Keywords Sort By  
Product   Sub Product  

View Technical Articles (sorted by Product) New/Updated in the last:    7 days      14 days      30 days             
TA # Date Created Date Updated Resolved Issue?   Printer Friendly Version of This TA   Print Article
  E-mail This TA   E-mail Article
111921 12/15/2000 01:48 PM 08/20/2018 12:42 AM
Yes No
How do I configure NTP to synchronize correctly?
Keywords
uw7 unixware unixware7 uware 7.0.0 7.0.1 7.1.0 7.1.1 700 701 710 711 ntp xntpd ntpdate configure synchronize sco open unix openunix openunix8 ou ou8 8.0.0 openserver open server ose 505 506 5.0.5 5.0.6 sco server workstation wrkstation openlinux linux 3.1 3.1.1 31 311 ntp.belnet.be 712 7.1.2 713 7.1.3 714 7.1.4 507 5.0.7 osr6 openserver6 600 6.0.0 time timed sync synchronise synchronisation trouble troubleshoot troubleshooting 128ms synchronisation lost getting started
Release
          SCO OpenServer Release 6.0.0 
          OpenServer 6 Definitive 
          UnixWare 7 Release 7.0.0, 7.0.1, 7.1.0, 7.1.1, 7.1.3, 7.1.4 
          UnixWare 7 Definitive 
          SCO Open UNIX 8 Release 8.0.0 
          SCO OpenServer Enterprise System Release 5.0.5, 5.0.6, 5.0.7 
          OpenServer 5 Definitive 
          SCO OpenLinux Server 3.1, 3.1.1 
          SCO OpenLinux WorkStation 3.1, 3.1.1 
Problem
          How do I configure NTP to synchronize correctly to set and maintain
          a UNIX system's time-of-day in agreement with the Internet standard
          time servers.


Solution
          Configuring a Simple NTP CLIENT:

          The first section is concerned with configuring an NTP client.

          ie. a client obtaining it's time from another local Unix or Windows 
              or Linux Master Time Server either within the Intranet or, if
              available, the Internet.
          

          1. Verify that you are able to ping xxx.xxx.xxx.xxx, where this is 
             your Master Time Server.


          2. Synchronize the clocks manually with the following command:

                # ntpdate -v -b xxx.xxx.xxx.xxx

                or use the additional options:

                -d    debug

                -s    write the information into syslog rather than console
   
                -o 3  specify the ntp version (default is 3)

             Use "ntpdate" to ensure that the clocks are synchronised before 
             the "ntp" daemon starts and it is often found that no further 
             "ntp" configuration is done other than to add this command to the
             cron and run on a regular basis.
     
             This feature cannot be used if a "ntpd" daemon is already running 
             on this client as they share the same port and you will see the 
             error:

             "the NTP socket is in use, exiting"

             If you see:

             "no suitable server for synchronization found"

             then it's likely the server you are communicating with is not
             a Master Time Server and is not advertising the time.

             Running ntpdate also resets the System Clock and server's RTC.

             As an alternate to using NTP, ntpdate can be placed in the cron
             to be run on an hourly basis, for example:

             59 * * * * /etc/ntpdate -v my_time_server >> /var/log/ntp.log 
2>&1


          3. Configure the file ntp.conf as:

                broadcastclient no
                driftfile /etc/ntp.drift
                logfile /var/log/ntp.log
                server xxx.xxx.xxx.xxx
                server ...
                
             where "xxx.xxx.xxx.xxx" is the IP address of the Master Time 
             Server you wish to use.

             How to configure it?

             You should use the "scoadmin client" or use the SCOadmin Client
             Manager from the GUI to set it where the operating system is 
             either UnixWare 7.x.x, Open UNIX 8.0.x or OpenServer 5.0.x/6.0.0.

             For OpenLinux, use the KDE K-> Control Center-> System-> 
             Startup-> Services-> Network Time Protocol Daemon.

             Next, use your favourite text editor to ensure it reads as above.

             Please note, ntp will loose it's synchronisation if the time 
             varies by more than 128ms.

             Where is ntp.conf?

             ntp.conf is stored in /etc for SCO OpenServer5 and SCO
             OpenLinux, and is stored in /etc/inet for UnixWare 7.x.x,
             Open UNIX 8.0.x and OpenServer6, however, on OSR6 it is linked to
             /etc/ntp.conf.

             For UnixWare7 it is recommended to change the driftfile location
             to:

                 driftfile /etc/inet/ntp.drift

             The configured drift file is created after the next reboot if
             needed.

             # touch /etc/inet/ntp.drift
             # chmod 666 /etc/inet/ntp.drift


          4. Stop and start your server's TCP/IP or simply reboot your server
             and the "ntpd" daemon will be started if it finds the above file,
             "ntp.conf" has been configured.

             Verify that the daemon has been started with:

             # ps -ef | grep ntp
           
             ntp by definition does not work with time differences larger than 
             1000 secs. In that case it stops and tells you to set the system 
             time manually. (xntpd logs into /var/adm/syslog) 

             OpenServer starts the "ntp" daemon from /etc/tcp.
             UnixWare starts the "ntp" daemon from /etc/inet/config.


          5. You can use the "ntpq -p" command in order to check, whether ntp 
             has started ok.

             Please note, that a drift of more than 1000 seconds will not be 
             corrected from ntp, by default.

             You can now monitor the system time by entering the date command
             (without any options) from time to time. 

             Please note that it will take some time (10 to 30 mins) until NTP 
             corrects the system time.



          Configuring a simple NTP SERVER:
          ===============================

          This next section looks at setting up your SCO server as a Master
          Time Server. 

          1. To do this change your "ntp.conf" file to read:

          driftfile /etc/ntp.drift       (or /etc/inet/ntp.drift for UW7.x.x)
          broadcastclient no
          server 127.127.1.1

          2. Restart your TCP/IP services or reboot your server.

          3. Check the service has started with "ps -ef | grep ntp", as above,
             and running "ntpq -p".

          You will not be able to "ping 127.127.1.1" but this is the entry to
          use to tell "ntp" it is the Master Time Server.  

          Your NTP clients can then be pointed to this server.


NOTES:
          TROUBLESHOOTING:
          ===============
          Check the port 123 is opened with "netstat -an" and run:

# ntpq
ntpq> peers
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*LOCAL(0)        LOCAL(0)         7 l   46   64  377    0.000    0.000   0.000
 xxx.xxx.xxx.255 0.0.0.0         16 u    -   64    0    0.000    0.000 4000.00

          On the Client:

ntpq> peers
     remote           refid      st t when poll reach   delay   offset    disp
==============================================================================
 LOCAL(0)        LOCAL(0)         7 l   13   64  377     0.00    0.000   10.01
*my_time_server. LOCAL(0)         8 u   44   64  377     0.76    0.134    0.05

                or:

                # ntpq -p


          and:

          On the Server:


#ntpq
ntpq> as
ind assID status  conf reach auth condition  last_event cnt
===========================================================
  1 39588  8000   yes   yes  none    reject
  2 39589  8000   yes   yes  none    reject
  3 39590  9614   yes   yes  none  sys.peer   reachable  1

ntpq> rv <assID>

          On the Client:

ntpq> as
ind assID status  conf reach auth condition  last_event cnt
===========================================================
  1 32724  9614   yes   yes  none  sys.peer   reachable  1
  2 32725  9014   yes   yes  none    reject   reachable  1

ntpq> rv <assID>


          and:

          You can set debugging from ntpq:


ntpq> debug more
debug level set to 1
ntpq> debug more
debug level set to 2
ntpq> debug more
debug level set to 3

ntpq> peers
Sending 12 octets
select() returns 1
Packet shows signs of authentication (total 20, data 24, mac -4) 18349014
18359634 90f2ab2a 3a010000 5f646e73 7268ad2a Authenticated with keyid 973144064
We don't know that key Got packet, size = 20 Packet okay
     remote           refid      st t when poll reach   delay   offset    disp
==============================================================================
Sending 12 octets
select() returns 1
Packet shows signs of authentication (total 476, data 480, mac -4) 2e30302c
0d0a0000 00000000 01000000 78fc0508 b4d7bd2a Authenticated with keyid 16777216
We don't know that key Got packet, size = 476 Packet okay
select() returns 1
Got packet, size = 168
Packet okay
 LOCAL(0)        LOCAL(0)         7 l   55   64  377     0.00    0.000   10.01
Sending 12 octets
select() returns 1
Got packet, size = 408
Packet okay
select() returns 1
Packet shows signs of authentication (total 244, data 248, mac -4) 362e3835
0d0a0000 3d302e30 322c2072 65616368 3d307866 Authenticated with keyid 841752690
We don't know that key Got packet, size = 244 Packet okay
*my_time_server. LOCAL(0)         8 u   22   64  377     0.69    0.126    0.02



SEE ALSO:
          For UnixWare 7.x.x/Open UNIX 8.0.x/OpenServer6:

             in.xntpd (1Mtcp)        - Network Time Protocol daemon
             xntpd (1Mtcp)           - Network Time Protocol daemon
             ntpdate (1Mtcp)

          For SCO OpenServer 5.0.x:

             ntpdate(ADMN)
             ntpd(ADMN)

          For SCO OpenLinux 3.x:

             /usr/share/doc/packages/xntp-4.0.99k/html/ntpdate.htm

             http://www.linuxdoc.org/HOWTO/Belgian-HOWTO/configuration.html

             which suggests:

             To change the CMOS clock and then synchronize the system time with
             the CMOS clock, do something like this:

                  hwclock --set --date="Feb 25 03:38"
                  clock -u -s

             If your computer has Internet access, you can use NTP (Network
             Time Protocol) to keep your system clock in sync using the "ntp"
             daemon.  However, one way of doing this is manually is by starting
             "ntpdate" from cron by adding:

          05 0 * * * root /usr/sbin/ntpdate -s uk.pool.ntp.org > /dev/null 2>&1

             which syncs the clock to the NTP time server ntp.belnet.be.

          For a list of public NTP servers, see

             http://support.ntp.org/bin/view/Servers/NTPPoolServers

             http://support.ntp.org/bin/view/Servers/WebHome#Browsing_the_Lists

          The NTP home page is at:

             http://www.ntp.org

          For example, 
          
             uk.pool.ntp.org is a UK NTP server.

          Technical Article 107619, "How do I configure xntpd(ADMN) to alter timekeeping 
                     limitations?"
Back to Search ResultsBack to Search Results