Home > Articles

This chapter is from the book

Topic: Configure and verify NTP operating in client/server mode

It is critical for many reasons to have accurate time on your network devices. To automate this process, we have Network Time Protocol (NTP). NTP uses the transport layer protocol of UDP and port 123. NTP uses the concept of a stratum value to gauge the accuracy of time values carried by NTP. A lower stratum value is preferred. You can think of stratum like a hop count from the authoritative reference clock source. Ideally, this time source should be an atomic clock, or at least linked to one. Example 14.9 configures R1 to act as a reference clock source for the network. Notice we select a stratum value of 2.

EXAMPLE 14.9 Configuring the NTP Master in the Network

R1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#ntp master ?
  <1-15> Stratum number
  <cr>

R1(config)#ntp master 2
R1(config)#end
R1#

How do you configure an NTP client to receive the correct time from your NTP server (master)? The command is ntp server ntp-server-ip-address. Example 14.10 shows this configuration.

EXAMPLE 14.10 Configuring the NTP Client

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

There are two key commands for verifying NTP. Example 14.11 shows one of them, the show ntp associations command. Note how this allows us to easily verify our association with the configured NTP master device.

EXAMPLE 14.11 Verifying the NTP Configuration with Show NTP Associations

R2#show ntp associations

  address     ref clock     st   when poll reach  delay  offset   disp
 *~10.1.1.1   127.127.1.1   2      0   64   275 19.784 40129.7 68.951
 * sys.peer, # selected, + candidate, - outlyer, x falseticker,
 ~ configured
R2#

Example 14.12 shows another frequently used verification option of show ntp status.

EXAMPLE 14.12 Using Show NTP Status to Verify NTP

R2#show ntp status
Clock is synchronized, stratum 3, reference clock is 10.1.1.1
nominal freq is 250.0000 Hz, actual freq is 250.0000 Hz, precision is
2**24
reference time is DA5E7147.56CADEA7 (19:54:31.339 EST Thu Feb 4 2016)
clock offset is 0.0986 msec, root delay is 2.46 msec
root dispersion is 16.27 msec, peer dispersion is 5.33 msec
loopfilter state is 'CTRL' (Normal Controlled Loop), drift is
0.000000009 s/s
system poll interval is 64, last update was 530 sec ago.
R2#

CramQuiz

  1. What is a stratum in NTP?

    • src.jpg A. A measure of the proximity to the reference clock

    • src.jpg B. A key value for authentication

    • src.jpg C. The number of total NTP clients

    • src.jpg D. A measurement for the number of NTP queries per minute

  2. What command configures your Cisco device as an NTP client of 10.1.1.1?

    • src.jpg A. ntp client 10.1.1.1

    • src.jpg B. ntp master 10.1.1.1

    • src.jpg C. ntp server 10.1.1.1

    • src.jpg D. ntp 10.1.1.1

CramQuiz Answers

  1. A is correct. The stratum indicates how far a device is from the reference clock.

  2. C is correct. The ntp server command is used on a client.

Pearson IT Certification Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from Pearson IT Certification and its family of brands. I can unsubscribe at any time.