NTP example

NTP synchronizes timekeeping among a set of distributed time servers and clients. This synchronization allows events to be correlated when system logs are created and other time-specific events occur.

See below an example of an NTP configuration

NTP

In this example R1 is the NTP server and R3 is the client, the NTP key for this configuration is iplogic, the stratum is 3.

On Router 1 :

Ntp authenticate
Ntp authentication-key 1 md5 iplogic
Ntp master 2
Ntp source lo 0

On Router 3 :

Ntp authenticate
Ntp authentication-key 1 md5 iplogic
Ntp trusted-key 1
Ntp server 1.1.1.1 source lo 0 key 1

R1#clock set 10:55:55 17 october 2008
R1#sh clock
*Oct 17 10:55:55.003: %SYS-6-CLOCKUPDATE: System clock has been updated from 02:26:15 UTC Fri Mar 1 2002 to 10:55:55 UTC Fri Oct 17 2008, configured from console by console.
10:55:58.047 UTC Fri Oct 17 2008

R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#Ntp authenticate
R1(config)#Ntp authentication-key 1 md5 iplogic
R1(config)#Ntp master 2
R1(config)#Ntp source lo 0

R3#sh clock
*02:28:07.595 UTC Fri Mar 1 2002
R3#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R3(config)#Ntp authenticate
R3(config)#Ntp authentication-key 1 md5 iplogic
R3(config)#Ntp trusted-key 1
R3(config)#Ntp server 1.1.1.1 source lo 0 key 1

After this let’s you can see that NTP is synchronized with R1

R3#sh clock
.11:01:23.149 UTC Fri Oct 17 2008

R3#sh ntp status
Clock is synchronized, stratum 3, reference is 1.1.1.1
nominal freq is 250.0000 Hz, actual freq is 250.0000 Hz, precision is 2**24
reference time is CCA2EF1C.0FE93F62 (11:01:48.062 UTC Fri Oct 17 2008)
clock offset is -19.9619 msec, root delay is 76.17 msec
root dispersion is 15895.03 msec, peer dispersion is 15875.03 msec

R3#sh ntp associations

address ref clock st when poll reach delay offset disp
*~1.1.1.1 127.127.7.1 2 27 64 1 76.2 -19.96 15875.
* master (synced), # master (unsynced), + selected, - candidate, ~ configured

Leave a comment

You must be logged in to post a comment.