User Tools

Site Tools




10 Network Time Protokoll (NTP)

On systems with NI Linux RT the NTP daemon can be installed with the package manager.

opkg install ntp

Other related packages which may be useful: ntp-utils ntp-doc ntpdate ntp-dbg ntp-tickadj


To configure the NTP daemon open the file /etc/ntp.conf with an editor like vi or nano. The default configuration can work as it is and contains the addresses to a few timeservers hosted by NI. Because the NI time server are probably located in the US it is recommended to adopt the list to more local time servers, e.g.:

  • … (
  • (only German time servers)
  •,, (Physikalisch-Technische Bundesanstalt)


The default configuration permits only the local host to access the NTP daemon. This is sufficient if the system is intended to act only as an client. If the system should also act as a server for other systems not connected with the internet a line in the following format is required.

restrict mask nomodify notrap nopeer

This allows all clients in the given subnet to query the time and statistics.

Example Configuration with Permission for Clients in Subnet

# Default config file used for ntpd and sntp on NI Linux RT
 # Panic threshold
# Checks if the offset is greater than this and exits if it is,
# believing something is horribly wrong.
# When set to 0, disables sanity check and will accept any time.
tinker panic 0
 # By default, the server allows:
# - all queries from the local host
# - only time queries from remote hosts, protected by rate limiting and kod
 # Prevent access to everything not explicitly allowed; we only want to
# answer time queries from servers.
restrict default kod limited nomodify nopeer noquery notrap
 # Permit standard loopback addresses because some applications may
# require them.
restrict ::1
 # Permit clients in the subnet to query the time.           
restrict mask nomodify notrap nopeer
 # By default, NTP doesn't use a drift file            
# Specifying the file will enable the drift file option
driftfile /var/lib/ntp/drift
 # Servers              


kb/ni-rt/linuxrt/ntp.txt · Last modified: 2020/05/13 13:32 by manuel.sebald