NTP (Network Time Protocol) adalah protokol yang digunakan untuk sinkronisasi waktu di dalam sebuah jaringan, baik jaringan LAN maupun pada jaringan internet. NTP itu sendiri menggunakan jalur data TCP/IP dan NTP menggunakan port UDP 123
Saya menggunakan 1 sebagai server (CentOS7) dengan 1 client yaitu, CebtOS7. Saya akan menggunakan waktu (time) indonesia dengan format Asia/Jakarta. Jadi, saya akan konfigurasi pertama di server untuk NTP-nya. Selanjutnya saya akan sinkronkan waktu client dengan server.
Server
Ip Address 172.16.24.1/16
Client (CentOS7)
Ip Address 172.16.24.2/16
Konfigurasi untuk Server :
Install paket NTP di Server
[root@NTP-Server]# yum install ntp -y
Akses Server NTP di www.pool.ntp.org, setelah itu edit file (ntp.conf). Untuk mengedit file bisa memakai nano ,bisa memakai vi. terserah kalian ingin menggunakan apa.
[root@NTP-Server]# vi /etc/ntp.conf
#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst
Ubah menjadi :
server 0.id.pool.ntp.org iburst
server 1.id.pool.ntp.org iburst
server 2.id.pool.ntp.org iburst
server 3.id.pool.ntp.org iburst
Masih di ntp.conf , tambahkan script untuk mendaftarkan network client
#restrict 172.16.0.0 mask 255.255.0.0 nomodify notrap
restrict 172.16.24.0 mask 255.255.0.0 nomodify notrap
Setelah itu, atur zona waktu Asia/Jakarta (indonesian time)
[root@NTP-Server]# timedatectl set-timezone Asia/Jakarta
Masukkan NTP Server kedalam firewall
[root@NTP-Server]# firewall-cmd --add-service=ntp --permanent
[root@NTP-Server]# firewall-cmd --reload
Apabila kita sudah melakukan konfigurasi sebaiknya NTP tersebut dilakukan restart.
[root@NTP-Server]# systemctl start ntpd
[root@NTP-Server]# systemctl enable ntpd
[root@NTP Server]# systemctl status ntpd
Untuk melihat status timezone yang sudah diatur
[root@NTP-Server]# ntpq -p
[root@NTP-Server]# date -R
Konfigurasi untuk client CentOS7
Install paket NTP
[root@NTP-Client]# yum install ntp -y
edit file ntp seperti tadi menggunakan server id (indonesia)
[root@NTP-Client]# vi /etc/ntp.conf
#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst
Tambahkan scrip dibawah ini
server 172.16.24.1
aktifkan NTP Server tersebut
[root@NTP-Client]# systemctl start ntpd
[root@NTP-Client]# systemctl enable ntpd
CEK status timezone di client
[root@NTP-Server]# ntpq -p
Samakan dengan timezone server
CEK my video (NTP Server) : Network Time Protocol
Saya menggunakan 1 sebagai server (CentOS7) dengan 1 client yaitu, CebtOS7. Saya akan menggunakan waktu (time) indonesia dengan format Asia/Jakarta. Jadi, saya akan konfigurasi pertama di server untuk NTP-nya. Selanjutnya saya akan sinkronkan waktu client dengan server.
Server
Ip Address 172.16.24.1/16
Client (CentOS7)
Ip Address 172.16.24.2/16
Konfigurasi untuk Server :
Install paket NTP di Server
[root@NTP-Server]# yum install ntp -y
Akses Server NTP di www.pool.ntp.org, setelah itu edit file (ntp.conf). Untuk mengedit file bisa memakai nano ,bisa memakai vi. terserah kalian ingin menggunakan apa.
[root@NTP-Server]# vi /etc/ntp.conf
#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst
Ubah menjadi :
server 0.id.pool.ntp.org iburst
server 1.id.pool.ntp.org iburst
server 2.id.pool.ntp.org iburst
server 3.id.pool.ntp.org iburst
Masih di ntp.conf , tambahkan script untuk mendaftarkan network client
#restrict 172.16.0.0 mask 255.255.0.0 nomodify notrap
restrict 172.16.24.0 mask 255.255.0.0 nomodify notrap
Setelah itu, atur zona waktu Asia/Jakarta (indonesian time)
[root@NTP-Server]# timedatectl set-timezone Asia/Jakarta
Masukkan NTP Server kedalam firewall
[root@NTP-Server]# firewall-cmd --add-service=ntp --permanent
[root@NTP-Server]# firewall-cmd --reload
Apabila kita sudah melakukan konfigurasi sebaiknya NTP tersebut dilakukan restart.
[root@NTP-Server]# systemctl start ntpd
[root@NTP-Server]# systemctl enable ntpd
[root@NTP Server]# systemctl status ntpd
Untuk melihat status timezone yang sudah diatur
[root@NTP-Server]# ntpq -p
[root@NTP-Server]# date -R
Konfigurasi untuk client CentOS7
Install paket NTP
[root@NTP-Client]# yum install ntp -y
edit file ntp seperti tadi menggunakan server id (indonesia)
[root@NTP-Client]# vi /etc/ntp.conf
#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst
Tambahkan scrip dibawah ini
server 172.16.24.1
aktifkan NTP Server tersebut
[root@NTP-Client]# systemctl start ntpd
[root@NTP-Client]# systemctl enable ntpd
CEK status timezone di client
[root@NTP-Server]# ntpq -p
Samakan dengan timezone server
CEK my video (NTP Server) : Network Time Protocol
Komentar
Posting Komentar