NTP server digunakan untuk ubah tanggal client dengan sinkronisasi dengan waktu internet
Instal ntp Server
Ketik perintah berikut:
# apt-get install ntp
Contoh output:
Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: libcap1 Suggested packages: ntp-doc The following NEW packages will be installed: libcap1 ntp 0 upgraded, 2 newly installed, 0 to remove and 1 not upgraded. Need to get 443kB of archives. After this operation, 1126kB of additional disk space will be used. Do you want to continue [Y/n]? y Get:1 http://ftp.us.debian.org lenny/main libcap1 1:1.10-14 [9082B] Get:2 http://ftp.us.debian.org lenny/main ntp 1:4.2.4p4+dfsg-7 [434kB] Fetched 443kB in 0s (480kB/s) Selecting previously deselected package libcap1. (Reading database ... 20411 files and directories currently installed.) Unpacking libcap1 (from .../libcap1_1%3a1.10-14_i386.deb) ... Selecting previously deselected package ntp. Unpacking ntp (from .../ntp_1%3a4.2.4p4+dfsg-7_i386.deb) ... Processing triggers for man-db ... Setting up libcap1 (1:1.10-14) ... Setting up ntp (1:4.2.4p4+dfsg-7) ... Starting NTP server: ntpd.
Konfigurasi NTP Server
/ etc / ntp.conf adalah default file konfigurasi. NTP menggunakan UDP port 123 sebagai lapisan transport-nya. Hal ini dirancang khusus untuk melawan efek dari latency variabel dengan menggunakan buffer jitter.
# vi /etc/ntp.conf
Konfigurasi default akan sync ke berbagai strata rendah NTP server. Anda dapat mengatur server sebagai berikut:
server 0.debian.pool.ntp.org iburst dynamic server 1.debian.pool.ntp.org iburst dynamic server 2.debian.pool.ntp.org iburst dynamic server 3.debian.pool.ntp.org iburst dynamic
Setelah mengajukan updaed, restart ntp:
# /etc/init.d/ntp restart
ntpq - NTP program query
Anda dapat menggunakan ntpq untuk daftar server yang sedang Anda polling:
$ ntpq
Contoh output:
ntpq> peer
remote refid st t when poll reach delay offset jitter
==============================================================================
*time.nist.gov .ACTS. 1 u 128 64 376 64.616 -8.079 0.863
+iguana.igtc.com 198.60.22.240 2 u 19 64 377 9.105 -9.229 0.543
+hydrogen.cert.u 216.218.254.202 2 u 12 64 377 35.950 -7.184 0.438
-snag.rack911.co 66.90.104.142 3 u 50 64 377 33.782 -0.376 0.464
Atau, Anda dapat mengetik berikut untuk mengetahui apakah ntp bekerja atau tidak:
$ ntpq -p
Contoh output:
remote refid st t when poll reach delay offset jitter ============================================================================== *time.nist.gov .ACTS. 1 u 3 64 373 64.616 -8.079 0.716 +iguana.igtc.com 198.60.22.240 2 u 28 64 377 9.065 -9.429 0.628 +hydrogen.cert.u 216.218.254.202 2 u 19 64 377 35.950 -7.184 0.357 -snag.rack911.co 66.90.104.142 3 u 57 64 377 33.695 -0.893 0.645
0 komentar:
Post a Comment