Sinkronisasi waktu dengan NTP
November 28th, 2007
Sinkronisasi waktu dengan NTP
konfigurasi dibawah mengacu kepada distro Fedora, sesuaikan dengan distro anda
Konfigurasi ntp untuk client (diletakkan di masing-masing client) dapat diambil di:
Install ntp dengan yum,
siapkan 1 komputer yang akan menjadi sistem acuan bagi sistem yang lain, 1 komputer ini (server) akan melakukan sinkronisasi menggunakan NTP dengan sistem lain di luar network (eg. istilahnya stratum 1 atau 2 server, misal clock.isc.org, atau tick.usno.navy.mil), semua sistem didalam jaringan tersebut tidak perlu ikut melakukan sinkronisasi ke luar, namun cukup ke lokal sistem saja.
Konfigurasi di server sbb:
download ntp (lewat yum, ‘yum install ntp’)
backup /etc/ntp.conf ke /etc/ntp.conf.dist
modifikasi isi /etc/ntp.conf menjadi
------------>8---------------->8-----------------------------
# OK with local
restrict 127.0.0.1
# REMOTE SERVER
server tock.usno.navy.mil
server clock.isc.org
server tick.usno.navy.mil
restrict tock.usno.navy.mil mask 255.255.255.255 nomodify notrap noquery
restrict clock.isc.org mask 255.255.255.255 nomodify notrap noquery
restrict tick.usno.navy.mil mask 255.255.255.255 nomodify notrap noquery
# CLIENT NETWORK
restrict 202.XXX.XXX.0 mask 255.255.255.0 nomodify notrust notrap
# Drift file. Put this in a directory which the daemon can write to.
# No symbolic links allowed, either, since the daemon updates the file
# by creating a temporary in the same directory and then rename()’ing
# it to the file.
#
driftfile /etc/ntp/drift
#logfile /var/log/ntplog
————>8—————->8—————————–
test dengan ntpdate,
# /usr/sbin/ntpdate tick.usno.navy.mil
cek proses ntp untuk dijalankan tiap kali sistem booting,
# /sbin/chkconfig ntpd on
jalankan proses ntpd,
# /sbin/service ntpd start
test konfigurasi diatas dengan ntpq,
# /usr/sbin/ntpq -p
Untuk konfigurasi client hampir sama dengan diatas,
perbedaan pada isi dari ntp.conf sbb:
------------>8---------------->8-----------------------------
# /etc/ntp.conf
#
# taken from http://adamantium.XXX.XXX.id/conf/ntp.conf.client
# sync clock to vanadium.XXX.XXX.id
#
# Permit all access over the loopback interface. This could
# be tightened as well, but to do so would effect some of
# the administrative functions.
restrict 127.0.0.1
# — OUR TIMESERVERS —–
# or remove the default restrict line
# Permit time synchronization with our time source, but do not
# permit the source to query or modify the service on this system.
# restrict mytrustedtimeserverip mask 255.255.255.255 nomodify notrap noquery
# server mytrustedtimeserverip
server vanadium.XXX.XXX.id
#
# Drift file. Put this in a directory which the daemon can write to.
# No symbolic links allowed, either, since the daemon updates the file
# by creating a temporary in the same directory and then rename()’ing
# it to the file.
#
driftfile /etc/ntp/drift
#
# Logs
#logfile /var/log/ntplog
————>8—————->8—————————–
Note:
Karena konfigurasi sinkronisasi antar sistem tidak
menggunakan authentikasi, modifikasi /etc/sysconfig/ntpd
dan tambahkan parameter “-A” didalamnya, lihat ntpd(8)
Jangan lupa untuk membuka akses ke firewall untuk protokol
UDP ke port 123
Referensi:
[x] NTP
http://www.ntp.org
[x] Public NTP servers (stratum 1 & 2) lists
http://www.eecis.udel.edu/~mills/ntp/servers.html
Darma Patri said:
This is veru usefully .
Thanks
slempase said:
bagaimana membuka akses ke firewall untuk protokol
UDP ke port 123
mohon pencerahan nya