NTP Logging

NTP Logging

Problem

You want to log significant NTP events.

Solution

Use the ntp logging command to enable the logging of NTP events:

Router2#configure terminal 
Enter configuration commands, one per line. End with CNTL/Z.
Router2(config)#ntp logging
Router2(config)#end
Router2#

Discussion

Starting in IOS Version 12.3(7)T, Cisco added the NTP logging feature. By implementing this feature, the router will log significant NTP events such as peer loss, peer reachability, and clock synchronization events.

To view the NTP logging events on the router, use the following command:

Router2#show logging | include NTP
000019: Jan 29 10:57:52.633 EST: %NTP-5-PEERSYNC: NTP synced to peer 172.25.1.5
000020: Jan 29 10:57:52.637 EST: %NTP-6-PEERREACH: Peer 172.25.1.5 is reachable
000023: Jan 29 10:57:53.635 EST: %NTP-6-PEERREACH: Peer 172.25.1.3 is reachable
000024: Jan 29 11:01:20.653 EST: %NTP-4-PEERUNREACH: Peer 172.25.1.5 is unreachable
000026: Jan 29 11:15:11.985 EST: %NTP-4-UNSYNC: NTP sync is lost
Router2#

In this example, we can see that the router initially synchronized its time to server 172.25.1.5 before the server became unreachable, causing the router to lose synchronization. This kind of forensic information can assist you in investigating NTP issues.

See Also