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

Router Configuration and File Management

Router Management

User Access and Privilege Levels

TACACS+

IP Routing

RIP

EIGRP

OSPF

BGP

Frame Relay

Handling Queuing and Congestion

Tunnels and VPNs

Dial Backup

NTP and Time

DLSw

Router Interfaces and Media

Simple Network Management Protocol

Logging

Access-Lists

DHCP

NAT

First Hop Redundancy Protocols

IP Multicast

IP Mobility

IPv6

MPLS

Security

Appendix 1. External Software Packages

Appendix 2. IP Precedence, TOS, and DSCP Classifications

Index



Cisco IOS Cookbook
Cisco IOS Cookbook (Cookbooks (OReilly))
ISBN: 0596527225
EAN: 2147483647
Year: 2004
Pages: 505

Flylib.com © 2008-2020.
If you may any questions please contact us: flylib@qtcs.net