Instalasi dan Konfigurasi NTP Server

Layanan ini berfungsi untuk mensinronkan waktu beberapa komputer ke Time Server Pusat. Walaupun bertugas mensinkronisasi waktu, layanan ini memakai protokol UDP yang relatif tidak banyak memakan bandwidth. Di bawah ini akan saya urai langkah2 instalasi hingga konfigurasi NTP server:

1. Download source NTP server:

cd /tmp
wget -t0 -b -c ftp://ftp.udel.edu/pub/ntp/ntp4/ntp-4.1.2.tar.gz

2. Ekstrak, kompile dan install:

tar xzvf ntp-4.1.2.tar.gz
cd ntp-4.1.2
./configure --prefix=/usr/local
make
make install

3. Konfigurasi file ada di /etc/ntp.conf, berisi:

restrict ntp.teras.net.id mask 255.255.255.255 nomodify notrap noquery
restrict time.nuri.net mask 255.255.255.255 nomodify notrap noquery
restrict ntp.ewha.net mask 255.255.255.255 nomodify notrap noquery
server ntp.teras.net.id
server time.nuri.net
server ntp.ewha.net
driftfile /etc/ntp.drift
restrict 127.0.0.1
restrict 202.95.128.0 mask 255.255.255.0 notrust nomodify notrap
restrict 202.95.156.0 mask 255.255.255.0 notrust nomodify notrap
restrict 202.95.157.0 mask 255.255.255.0 notrust nomodify notrap
restrict 202.95.158.0 mask 255.255.255.0 notrust nomodify notrap
restrict 202.95.159.0 mask 255.255.255.0 notrust nomodify notrap

Server2 di atas dapat dipilih dari http://www.eecis.udel.edu/~mills/ntp/clock2a.html, untuk server2 stratum 2.
Pilihlah yang paling dekat dengan anda, bisa diketahui dari ping latency jika anda melakukan ping.
Lima baris terakhir adalah jaringan lokal kita, diberikan akses seperti di atas.

touch /etc/ntp.drift

4. Sebelum menjalankan daemon ntpd, sinkronkan terlebih dahulu server kita ke salah satu server yang kita masukkan di /etc/ntp.conf:

ntpdate ntp.teras.net.id

5. Ok, sekarang jalankan ntpd dengan script ringkas berikut:

#!/bin/sh
case $1 in
'start' )
/usr/local/bin/ntpd
;;
'stop' )
kill `ps -ef | grep ntpd | grep -v grep | awk '{print $2}'` > /dev/null
2>&1
;;
*)
echo "usage: $0 {start|stop}"
esac

6. Cek apakah server kita sudah sinkron dengan server yang kita masukkan di /etc/ntp.conf:

ntpq -p
remote refid st t when poll reach delay offset jitter
=====================================================
+netmon-01.teras clepsydra.dec.c 2 u 751 1024 377 491.368 17.788 1.143
+203.255.112.96 time-B.timefreq 2 u 804 1024 377 854.402 13.284 12.138
*211.39.143.103 usno.pa-x.dec.c 2 u 581 1024 377 653.404 -0.738 9.231

Apabila pada salah satu baris nilai jitter 4000, berarti server tersebut belum sinkron dengan server kita.

Demikian.