NTP

From Schmid.wiki
Jump to: navigation, search

Contents

Installation

# emerge ntp

Configuration

This configuration is for danish users. There are only 3 danish pool.ntp.org time servers, so I use 2 german ones as well.

Edit /etc/ntp.conf - add the following lines:

server dk.pool.ntp.org
server dk.pool.ntp.org
server de.pool.ntp.org
server de.pool.ntp.org

edit /etc/conf.d/ntp-client - change:

NTPCLIENT_OPTS="-b 130.235.20.3"

edit /etc/init.d/net.eth0 - change:

/sbin/dhcpcd -N ${dhcpcd_... etc.
              |___________________ this one prevents dhcpcd from overwriting /etc/ntp.conf

change router configuration to forward port 123 to the server

execute these commands

# rc-update add ntp-client default
# rc-update add ntpd default
# rc default

check functionality

$ ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 0x50a13f43.boan .INIT.          16 u    -   64    0    0.000    0.000 4000.00
 0x50a13f43.boan .RSTR.          16 u    -   64    0    0.000    0.000 4000.00
 ipx10540.ipxser .INIT.          16 u    -   64    0    0.000    0.000 4000.00
 ipx10540.ipxser .INIT.          16 u    -   64    0    0.000    0.000 4000.00

compare system time with estimated UTC

$ ntptime;date 

check for errors in the log file

$ cat /var/log/ntp.log

Making the NTP Server Available Through Samba

edit /etc/samba/smb.conf:

[global]
    time server = true

On a normal Windows XP system, this won't be all that clever, because timedate.cpl (the Windows XP date/time component) won't accept time from a stratum 3 time server (stupid!). However, you can manually synchronize with the time server using:

C:\>net time /set /y

References

Personal tools