4.2 Configure and verify NTP clients and servers
CCNA 200-301 v1.1 · 4.0 IP Services
Routers and switches need the same, correct time so that logs from different devices line up, certificates validate and scheduled jobs run when they should. NTP synchronises clocks over UDP 123 from a hierarchy of servers ranked by stratum. For the CCNA you make a device an NTP client, a server for others, and verify that it is synchronised.
What you must know
- Configure a device as an NTP client of one or more servers.
- Make a router a time source for the LAN, and explain stratum.
- Set the time zone and timestamps so logs show local time.
- Read
show ntp associationsandshow ntp status. - Add NTP authentication.
Clients, servers and stratum
A device configured with ntp server is a client: it asks that server for the time. Once synchronised it also answers other devices, so a router can be the LAN's time source while it follows an upstream server. Stratum counts the distance from a reference clock: an atomic or GPS clock is stratum 0, a server attached to it stratum 1, its clients stratum 2, and so on. Stratum 16 means unsynchronised.
! R1
ntp server 192.0.2.123 prefer
ntp server 192.0.2.124
ntp source Loopback0
!
! SW1 and SW2
ntp server 10.0.0.1With no upstream server at all, ntp master 4 makes a router an authoritative source at stratum 4 from its own clock. Use it in labs or isolated networks only.
Time zone and timestamps
clock timezone EST -5
clock summer-time EDT recurring
service timestamps log datetime msec localtime show-timezoneNTP always carries UTC. The time zone is a local display setting on each device.
Authentication
Without authentication a device trusts any NTP server it reaches. With it, the client only accepts time signed with a trusted key.
ntp authenticate
ntp authentication-key 1 md5 N7pAth
ntp trusted-key 1
ntp server 10.0.0.1 key 1Commands
show ntp associations | Each server: * synchronised to it, + candidate, - outlier, ~ configured; with stratum, reach and offset. |
show ntp status | Whether the clock is synchronised, its stratum and the reference server. |
show clock detail | The time and its source (NTP or user configuration). |
debug ntp packets | NTP packets sent and received, to see whether the server answers. |
Exam traps
- Synchronising can take several minutes after
ntp server; an unsynchronised clock right away is normal. - NTP uses UDP 123. A filter that blocks it leaves the clock unsynchronised.
- A lower stratum is closer to the reference clock and preferred. Stratum 16 means unsynchronised.
ntp mastermakes a device a source using its own clock; on a production device that may spread the wrong time.- NTP carries UTC. The time zone is set per device with
clock timezone.
Check yourself
- R1 synchronises to a stratum 2 server. What stratum do its clients see?
- Stratum 3 for R1, so its clients become stratum 4.
- In
show ntp associations, what does the*mean? - That is the server the clock is synchronised to.
- Which command makes logs show the local date and time with milliseconds?
service timestamps log datetime msec localtime, together withclock timezone.- Which transport and port does NTP use?
- UDP port 123.
Labs
Try it live: PAT, DHCP server and NTP
More topics in 4.0 IP Services
- 4.4 Explain how SNMP is used in network operations
- 4.5 Describe syslog, including facilities and severity levels
- 4.6 Configure and verify DHCP client and relay
- 4.7 Explain QoS per-hop behavior: classification, marking, queuing, congestion handling, policing, shaping
- 4.8 Configure and verify remote device access with SSH
- 4.9 Describe what TFTP and FTP do on a network