Checking the NTP Status

Problem

You want to verify the status of NTP on your router to make sure it's running properly.

Solution

Use the NTP and clock show commands to verify the status of NTP on your router. The best place to start is the show clock detail command, which provides information on the current time, time source, and time zone configuration:

Router>show clock detail 
15:54:33.079 EST Sun Jan 29 2006
Time source is NTP
Summer time starts 02:00:00 EST Sun Apr 2 2006
Summer time ends 02:00:00 EDT Sun Oct 29 2006
Router>

To display the current NTP status of the local router, the command is:

Router>show ntp status

The command to display the current NTP associations is:

Router>show ntp associations 

And you can display detailed information about the current NTP associations with the following command:

Router>show ntp associations detail 

 

Discussion

You can view the current clock status by using the show clock detail command:

Router>show clock detail 
.15:54:33.079 EST Sun Jan 29 2006
Time source is NTP
Summer time starts 02:00:00 EST Sun Apr 2 2006
Summer time ends 02:00:00 EDT Sun Oct 29 2006
Router>

In this example, the router's current date and time are correctly set, but notice the period or decimal appended to time (some routers display an asterisk instead of a period). This indicates that NTP is unsynchronized and will appear on show commands and log messages. Recognizing the significance of the period highlights problems with NTP even when you are not specifically looking for timing issues.

This command also provides valuable information on time zone and daylight savings time. The router above is set to Eastern Standard Time (EST) and observes daylight savings time.

To display detailed NTP status information, use the following show command:

Router>show ntp status
Clock is synchronized, stratum 4, reference is 172.16.2.1
nominal freq is 250.0000 Hz, actual freq is 249.9950 Hz, precision is 2**18
reference time is C787AA2F.FB9A0F44 (15:55:11.982 EST Sun Jan 29 2006)
clock offset is 7.0738 msec, root delay is 40.48 msec
root dispersion is 65.52 msec, peer dispersion is 8.15 msec
Router>

In this example, the router is synchronized to NTP server 172.16.2.1, and it is acting as a Stratum 4 NTP server. This means that this router is four NTP "hops" away from the authoritative clock, and that it is using the server 172.16.2.1 as its master time source. The command output also shows that the NTP client is currently synchronized, which is the desired state. Any other clock status indicates problems.

To display the status of all NTP associations, use the following command:

Router>show ntp associations 

 address ref clock st when poll reach delay offset disp
+~172.25.1.1 192.5.41.40 2 148 1024 377 30.0 33.66 8.0
*~172.25.1.3 192.5.41.40 2 42 1024 377 31.3 -69.53 10.8
+~172.25.1.5 172.25.1.3 3 780 1024 377 31.9 -107.7 26.1
* master (synced), # master (unsynced), + selected, - candidate, ~ configured
Router>

This command gives a table of outbound NTP associations and their current status. However, it does not display the current inbound NTP associations that are receiving time from this router. This shows those NTP associations that have been explicitly configured as well as any broadcast and multicast servers that have been discovered.

There is a lot of useful information in this example. The most important is the NTP synchronization status for each destination. Notice the special characters situated at the left-most column of the table. These indicate the current status of the NTP associations. Table 14-2 shows what these symbols mean.

Table 14-2. NTP peer status codes

Character Description
* Synchronized to master
# Close to synchronization
+ Selected for possible synchronization
- Candidate for synchronization
~ Statically configured

The example above displays three synchronized NTP associations with one, 172.25.1.3, acting as master. The table also shows the reference clock for each neighbor, the NTP server they are synchronized to, and the current stratum number of each. Finally, the table displays polling information, availability statistics and clock offset timing. You can view detailed NTP association information by adding the keyword, detail:

Router>show ntp associations detail 
172.25.1.1 configured, selected, sane, valid, stratum 2
ref ID 192.5.41.40, time C034F56D.49F8D2E5 (20:56:13.288 UTC Sat Mar 9 2003)
our mode client, peer mode server, our poll intvl 1024, peer poll intvl 1024
root delay 113.69 msec, root disp 67.46, reach 377, sync dist 148.895
delay 29.95 msec, offset 33.6585 msec, dispersion 8.00
precision 2**20, version 3
org time C034F86F.1132617C (21:09:03.067 UTC Sat Mar 9 2003)
rcv time C034F86F.0C6A77E0 (21:09:03.048 UTC Sat Mar 9 2003)
xmt time C034F86F.04B86272 (21:09:03.018 UTC Sat Mar 9 2003)
filtdelay = 29.95 29.77 4.24 5.19 5.20 5.08 5.22 5.26
filtoffset = 33.66 35.53 49.12 46.62 46.97 47.24 47.56 45.92
filterror = 0.02 15.64 31.27 46.91 62.53 78.16 93.78 109.41

172.25.1.3 configured, our_master, sane, valid, stratum 2
ref ID 192.5.41.40, time C034F647.75CB252C (20:59:51.460 UTC Sat Mar 9 2003)
our mode client, peer mode server, our poll intvl 1024, peer poll intvl 1024
root delay 135.13 msec, root disp 51.15, reach 377, sync dist 145.172
delay 31.30 msec, offset -69.5341 msec, dispersion 10.82
precision 2**20, version 3
org time C034F8D8.F76E503F (21:10:48.966 UTC Sat Mar 9 2003)
rcv time C034F8D9.0D3CCF79 (21:10:49.051 UTC Sat Mar 9 2003)
xmt time C034F8D9.0531A98E (21:10:49.020 UTC Sat Mar 9 2003)
filtdelay = 31.30 29.75 6.39 5.40 5.34 5.37 5.33 5.34
filtoffset = -69.53 -66.27 -51.98 -50.29 -50.13 -49.93 -46.16 -43.89
filterror = 0.02 15.64 31.27 46.91 62.53 78.16 93.78 109.41
Router>

This command displays much of the same information, but in greater detail, and it includes several pieces of timer information. The first line of each association is of particular interest. For example, server 172.25.1.3 is currently acting as this router's master, meaning that we are synchronized to him, and that he is acting as a Stratum 2 server with a valid and sane time.

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