NTP makes sure every network device has the same precise time so that logs, security and troubleshooting make sense.
Facts
| Point | Detail |
|---|---|
| Purpose | Synchronize time on network devices |
| Transport | UDP port 123 |
| Model | Hierarchical stratum model |
| Accuracy | Milliseconds (LAN), typically <100 ms over WAN/internet |
| Alternative | PTP (very high precision, hardware dependent) |
| Used for | Logs, syslog, SNMP, Kerberos, certificates, SIEM |
How it works
- Stratum 0: reference clocks (GPS, atomic)
- Stratum 1: servers directly connected to stratum 0
- Stratum 2–15: clients / secondary servers
- A client sends a time request, measures delay and offset, and adjusts the clock gradually (slew) or directly (step if the difference is large). Cisco devices normally slew to avoid time jumps.
What problem does NTP solve?
- Inconsistent timestamps in logs, impossible cross-device troubleshooting, security failures (certificates, AAA, Kerberos), wrong SIEM correlation → fixed by a central time source and consistent time everywhere.
Special considerations
- UDP 123 must be allowed (ACL/firewall)
- NTP delivers UTC – local time needs
clock timezone - Use NTP authentication in enterprise, internal NTP servers instead of public ones directly
- Time may be wrong until the first NTP sync completes
Master vs server vs peer
| Master | Server | Peer | |
|---|---|---|---|
| Use | No external source (lab, fallback) | Classic client → server | Active–active sync |
| Behaviour | Device declares itself time source | Clients receive, never reply time | Both adjust each other |
| Structure | — | Hierarchical | Flat |
ntp masterbecomes stratum 8 by default (or manual) – never use in production if real NTP existsntp serveris unidirectionalntp peerrequires mutual configuration – used in core/datacenter for redundancy
Configuration
! Simple client
ntp server 192.0.2.10
! With prefer + stable source interface (best practice)
ntp server 192.0.2.10 prefer
ntp source Loopback0
! Authentication (CCNP)
ntp authentication-key 1 md5 CISCO123
ntp authenticate
ntp trusted-key 1
ntp server 192.0.2.10 key 1
! Local fallback master (stratum 5 = low priority)
ntp master 5
clock timezone CET 1
! Peer on BOTH routers
ntp peer 192.0.2.2
Verification & troubleshooting
show ntp status
show ntp associations
show clock detail
Check: Clock is synchronized, Reference is …, stratum, and the reach field. Legend: * = selected source, + = candidate, ~ = peer; stratum reveals the hierarchy.
Exam overview
| Command | Function |
|---|---|
ntp master |
Local time source |
ntp server x.x.x.x |
Client → server |
ntp peer x.x.x.x |
Active–active |
ntp source Lo0 |
Stable source IP |
prefer |
Primary source |
CCNA: what NTP is, stratum concept, simple client config, basic verification. CCNP: authentication, peers vs servers, design (internal servers), security, troubleshooting.