Home
Support

Knowledge Base

BSPs and drivers
Community resources
Product documentation
Questions?
Contact us

NTP Setup
 
________________________________________________________________________

Applicable Environment
________________________________________________________________________
  • Topic: NTP
  • SDP: 7.0.0, 7.1.0
  • Target: AArch64, x86_64
________________________________________________________________________

Question
________________________________________________________________________
    Purpose: To complete a basic setup of Network Time Protocol (NTP)

    The Network Time Protocol (NTP) utilizes a daemon on the local network of the host to
    synchronize the time with the standard time servers. It then broadcasts this time with its clients.

    Errors Addressed: "servname not supported for ai_socktype"

    ________________________________________________________________________

    Solution
    ________________________________________________________________________
      Example usage - Two VMs to test NTP:

      Configuration/steps used for the server (192.168.186.135) and client (192.168.186.132):

      =========
      Server Setup:
      =========

      Found in host directory: /target/qnx7/etc/ntp.conf (in SDP installation folder)
      Save in target (server) directory: /tmp/ntp.conf:

      -----------------------------------
      Step 1: [ntp.conf]
      -----------------------------------

      Copy/paste the content below to the ntp.conf file

      -----
      logfile /tmp/ntp.log

      logconfig=all

      # public NTP servers
      server 0.pool.ntp.org prefer iburst
      # restrict client so it cannot modify the server but can access it
      restrict 192.168.186.132 nomodify
      -----

      -----------------------------------
      Step 2: [services]
      -----------------------------------

      Add /etc/services from the same host directory mentioned above (qnx710/target/qnx7/etc/services) to the server to avoid the error "servname not supported for ai_socktype"

      -----------------------------------
      Step 3: [commands]
      -----------------------------------

      Run these commands on server:

      # ntpd -g -c /tmp/ntp.conf
      # ntpq -pn

      ========
      Client Setup:
      ========

      Found in host directory: /target/qnx7/etc/ntp.conf (in SDP installation folder)
      Save in target (client) directory: /etc/ntp.conf:

      ----------------------------------
      Step 1: [ntp.conf]
      ----------------------------------

      Copy/paste the content below to the ntp.conf file

      -----
      driftfile /etc/ntp/ntp.drift
      logfile /tmp/ntp.log

      logconfig=all

      # public NTP servers (connect to IP of server)
      server 192.168.186.135 iburst
      -----

      -----------------------------------
      Step 2: [services]
      -----------------------------------

      Add /etc/services from the same host directory mentioned above (qnx710/target/qnx7/etc/services) to the client to avoid the error "servname not supported for ai_socktype"

      -----------------------------------
      Step 3: [commands]
      -----------------------------------

      Run these commands on client:

      # ntpd -g -c /etc/ntp.conf
      # ntpq -i
      > peers
      > sysinfo

      Reference:

      http://www.qnx.com/developers/docs/7.1/index.html#com.qnx.doc.neutrino.sys_arch/topic/tcpip_NTP.html
      http://www.qnx.com/developers/docs/7.1/#com.qnx.doc.neutrino.utilities/topic/n/ntpd.html
      http://www.qnx.com/developers/docs/7.1/#com.qnx.doc.neutrino.utilities/topic/n/ntpq.html

      ________________________________________________________________________
      NOTE: This entry has been validated against the SDP version listed above. Use caution when considering this advice for any other SDP version. For supported releases, please reach out to QNX Technical Support if you have any questions/concerns.
      ________________________________________________________________________


      Related Attachments
       None Found





      Please contact us with your questions or concerns.