Skip to Content
Cisco IOS Cookbook, 2nd Edition
book

Cisco IOS Cookbook, 2nd Edition

by Kevin Dooley, Ian Brown
December 2006
Intermediate to advanced
1188 pages
72h 8m
English
O'Reilly Media, Inc.
Content preview from Cisco IOS Cookbook, 2nd Edition

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

Recipe 14.16

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

IP Routing on Cisco IOS, IOS XE, and IOS XR: An Essential Guide to Understanding and Implementing IP Routing Protocols

IP Routing on Cisco IOS, IOS XE, and IOS XR: An Essential Guide to Understanding and Implementing IP Routing Protocols

Brad Edgeworth, Aaron Foss, Ramiro Garza Rios
Cisco Software-Defined Access

Cisco Software-Defined Access

Srilatha Vemula, Jason Gooley, Roddie Hasan

Publisher Resources

ISBN: 0596527225Supplemental ContentErrata Page