Saturday, December 31, 2016

[Cisco] Implementasi Network Time Protocol(NTP) Pada Router Cisco

Settingan waktu pada router sangat bermanfaat yang akan menampilkan aktifitas log, history dan penggunaan akses pada router.waktu yang tidak sinkron dengan waktu yang ada akan menimbulkan “miss” ataupun salah perkiraan dalam akses jaringan.

NTP ataupun Network Time Protocol merupakan sistem untuk mensikronisasikan waktu pada perangkat dengan menggunakan jaringan. Beberapa jenis ntp antara lain sebagai server, yaitu memberikan akses informasi waktu ke client. Client, mendapatkan informasi waktu dari server NTP ataupun perangkat yang melakukan peer ke NTP servernya.

Topologi



Konfigurasi Basic NTP pada router Cisco
Berikut contoh konfigurasi pada router Cisco dalam mengimplementasikan NTP
  • Pada Router R1 ataupun Router yang dijadikan NTP Server

Berikut melakukan settingan waktu pada NTP server
R1#clock set 13:39:10 31 Dec 2016

*Dec 31 13:39:10.000: %SYS-6-CLOCKUPDATE: System clock has been updated from 00:02:47 UTC Fri Mar 1 2002 to 13:39:10 UTC Sat Dec 31 2016, configured from console by console.

Menampilkan waktu pada router sesuai dengan waktu yang disetting

R1#show clock 
13:39:13.035 UTC Sat Dec 31 2016
R1#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.

Menjadikan Router R1 sebagai NTP server

R1(config)#ntp master 

Memberikan alamat IP pada interface yang akan terhubung secara langsung dengan NTP Client

R1(config)#interface fastEthernet 0/0           
R1(config-if)#ip address 10.10.10.1 255.255.255.0
R1(config-if)#no shutdown
  • Pada Router R2/Router yang dijadikan NTP Client

Menampilkan waktu pada router R2, secara default masih belum mengikuti waktu dari NTP server

R2(config)#do show clock
*00:07:13.063 UTC Fri Mar 1 2002

Memberikan alamat IP pada interface yang terhubung secara langsung dengan NTP Server, dengan catatan alamat IP harus satu network dengan alamat IP NTP server

R2(config)#interface fastEthernet 0/0
R2(config-if)#ip address 10.10.10.2 255.255.255.0
R2(config-if)#no shutdown
R2(config)#ntp server 10.10.10.1  
R2(config)#^Z
Dec 31 13:44:40.803: %SYS-5-CONFIG_I: Configured from console by console

Menampilkan waktu pada router R2, yang sudah berubah sesuai dengan waktu pada R1

R2#show clock
13:44:45.959 UTC Sat Dec 31 2016

Menampilkan NTP status pada R2

R2#show ntp status
Clock is synchronized, stratum 9, reference is 10.10.10.1
nominal freq is 250.0000 Hz, actual freq is 250.0000 Hz, precision is 2**18
reference time is DC1234C4.2805F599 (13:44:36.156 UTC Sat Dec 31 2016)
clock offset is -21.8627 msec, root delay is 12.22 msec
root dispersion is 36.35 msec, peer dispersion is 14.45 msec
R2#

Menampilkan NTP Associations pada R2 yang sudah tersinkronisasi dengan NTP server melalui alamat IP 10.10.10.1

R2#show ntp associations 
      address         ref clock     st  when  poll reach  delay  offset    disp
*~10.10.10.1       127.127.7.1       8    34    64  377    12.2  -21.86    26.4
 * master (synced), # master (unsynced), + selected, - candidate, ~ configured

R2#show ntp associations detail 
10.10.10.1 configured, our_master, sane, valid, stratum 8
ref ID 127.127.7.1, time DC1235FA.20C5B65C (13:49:46.128 UTC Sat Dec 31 2016)
our mode client, peer mode server, our poll intvl 64, peer poll intvl 64
root delay 0.00 msec, root disp 0.03, reach 377, sync dist 17.807
delay 4.20 msec, offset 3.5338 msec, dispersion 15.69
precision 2**18, version 3
org time DC123604.21DB9DC3 (13:49:56.132 UTC Sat Dec 31 2016)
rcv time DC123604.217E00A3 (13:49:56.130 UTC Sat Dec 31 2016)
xmt time DC123604.20696AAD (13:49:56.126 UTC Sat Dec 31 2016)
filtdelay =     4.20   20.22   32.21   36.19   32.21   12.22   32.23   32.23
filtoffset =    3.53    8.01   10.49   12.96    7.50  -21.86  -11.91  -11.92
filterror =     0.02    0.99    1.97    2.94    3.92    4.90    4.91    4.93

Konfigurasi NTP AUTHENTICATION pada router Cisco
Berbeda dengan Basic NTP, untuk NTP Authentication menggunakan Key dan enkripsi MD5
  • Pada Router R1 ataupun Router yang dijadikan NTP Server
(catatan : Konfigurasi sebelumnya silahakan di hapus). Pada router R1,setelah melakukan konfigurasi setting clock/waktu pada server dan menjadikan sebagai master, maka selanjutnya tambahkan konfigurasi berikut.

R1(config)#ntp authentication-key 1 md5 BLOGTWS
R1(config)#ntp trusted-key 1
R1(config)#
  • Pada Router R2 ataupun Router yang dijadikan NTP Server
(catatan : Konfigurasi sebelumnya silahakan di hapus). Pada router R2,setelah melakukan konfigurasi setting clock/waktu pada server dan menjadikan sebagai master, maka selanjutnya tambahkan konfigurasi berikut.

R2(config)#ntp authentication-key 1 md5 BLOGTWS
R2(config)#ntp trusted-key 1
R2(config)#ntp server 10.10.10.1 key 1
R2(config)#ntp authenticate

Proses debugging untuk NTP server dan NTP client.


R2#debug ntp authentication    

NTP authentication debugging is on
14:40:20.440 UTC Sat Dec 31 2016
R2#
Dec 31 14:41:04.929:  Authentication key 1
R2#
Dec 31 14:42:08.929:  Authentication key 1
R2#

Referensi :
  • http://resources.intenseschool.com/gns3-labs-cisco-ios-network-time-protocol/

No comments:

Post a Comment