ntp Howto (2)

From RaySoft

This howto is based on the following documentation:

Installation

Synchronize the repository and show dependencies:

emaint --auto sync
emerge --update --pretend 'net-misc/ntp'

Install the package:

emerge --update 'net-misc/ntp'

Configuration

Edit the following files:

Start the daemon:

/etc/init.d/ntpd start

Include the daemon to the start procedure:

rc-update add 'ntpd' 'default'
rc-update del 'ntp-client' 'default'
rc-update show | grep 'ntp'

Output:

                 ntpd |      default

Test

Test the listener's availability:

netstat --numeric --program --listening --all --tcp --udp | grep ':123 '

Output:

udp        0      0 10.0.0.1:123            0.0.0.0:*               2864/ntpd
udp        0      0 127.0.0.1:123           0.0.0.0:*               2864/ntpd
udp        0      0 0.0.0.0:123             0.0.0.0:*               2864/ntpd

Test from localhost:

ntpdate -q '127.0.0.1'

Output:

server 127.0.0.1, stratum 3, offset -0.000008, delay 0.02565
19 Mar 20:54:01 ntpdate[18078]: adjust time server 127.0.0.1 offset -0.000008 sec

Test over the network:

ntpdate -q '10.0.0.1'

Output:

server 10.0.0.1, stratum 3, offset -0.000009, delay 0.02565
19 Mar 20:55:20 ntpdate[18079]: adjust time server 10.0.0.1 offset -0.000009 sec