cisco hands-on experience


Cisco NTP

Cisco NTP basics

NTP is a protocol designed to synchronize clock with a atomic- or a radio clock.
The NTP Protocol uses the current standard of protocol version 4.
NTP is reserved for the UDP-Port 123.
The timestamp at NTP are 64bit long. 32 bits encode the seconds since the beginning of 1. Januar 1900 00:00:00. The next 32 bits are the fraction of the seconds.
With this manner it is possible to calculate the time in a resolution of 2 -32 seconds.

NTP uses a hierarchical system of serveral strata. stratum 0 is called
time normal for example for an antomic- or a radio clock. The directly connected NTP-Server are called stratum 1.
Each furhter dependent unit get the next higher incemental. see the following figure.


Configuring on the command line looks like this

Step 1. show ntp server
searching in the running config for NTP server
LabDevice#sh run | i ntp
ntp clock-period 36028310
ntp server 40.99.153.30
ntp server 40.99.154.30

The output show that there are 2 NTP Servers. If not – you can add the ntp servers like this

LabDevice#conf t
LabDevice(config)#ntp server [ip address](Server 1)
LabDevice(config)#ntp server [ip address](Server 2)
LabDevice(config)#exit
LabDevice#

Step 2. checking if NTP is functional
checking if NTP is functional

LabDevice#clock set 10:10:10 1 januar 1993

LabDevice#sh clock
.10:11:10.816 UTC Fri Jan 1 1993
(if there is a dot infront – you see that the clock in not synchronized yet.
After synchronization it lookes like the next output.

LabDevice#sh clock
02:17:30.829 UTC Sat Jan 13 2013

LabDevice#sh ntp asso

address                  refclock              st    when      poll        reach        delay           offset            disp
*~40.99.153.30    146.83.8.200     3      62           64         17              1.4              6.89              1899.4
+~40.99.154.30   213.9.73.106     3      63          64           37              2.3             -5.89              1894.8
* master (synced), # master (unsynced), + selected, – candidate, ~ configured

LabDevice#sh ntp status
Clock is unsynchronized, stratum 16, no reference clock
nominal freq is 119.2092 Hz, actual freq is 119.2097 Hz, precision is 2**18
reference time is 00000000.00000000 (00:00:00.000 UTC Mon Jan 1 1900)
clock offset is 0.0000 msec, root delay is 0.00 msec
root dispersion is 0.00 msec, peer dispersion is 0.00 msec

now we change the primary NTP Server to a address it doesn ‘t exist.

LabDevice(config)#no ntp server 40.99.153.30
LabDevice(config)#no ntp server 40.99.154.30

LabDevice(config)#ntp server 1.2.3.4
LabDevice(config)#ntp server 40.99.154.30
LabDevice(config)#exit

With the debug command ‘debug ntp events’ and ‘debug ntp sync’ the change of the time or an adjustment of NTP will be logged.

logging output

Jan 13 02:17:30.829 UTC: NTP: synced to new peer 40.99.154.30
Jan 13 02:17:30.829 UTC: NTP: 40.99.154.30 synced to new peer
Jan 13 02:17:30.829 UTC: NTP: sync change
Jan 13 02:17:30.829 UTC: NTP: peer stratum change
Jan 13 02:17:30.829 UTC: NTP: 40.99.154.30 reachable

  1. Love Reply

    , since I don’t have access to my aucatl server b/c I’m hosted w/ dreamhost (at least, I don’t think I do; if I do, I don’t know how to use it, and it’s probably not good for me to touch it anyway), I just sent a support request to dreamhost; they updated it and got back to me within 30 minutes.badda-mother-freaking-bing.of course, I spent WAY TOO DAMN MUCH TIME fixing this myself. I gotta learn to just send problems to tech support immediately but I always figure oh, it will take 10 minutes! and before I know it, I’m reading wikipedia articles about feathered dinosaurs.regardless .your blog post was invaluable in figuring out my issue. Thanks a lot.

Leave a Reply

*

captcha *