Troubleshooting notes · IP services
NTP with authentication won't sync: the key isn't trusted
An NTP client with an authentication key stays unsynchronized at stratum 16. How to see that the key isn't trusted on the client or on the server, and fix it with ntp trusted-key. Real output from Cisco IOS XE 17.18.
The symptom
The router has an NTP server and an authentication key configured, but its clock stays unsynchronized. The association shows the server as rejected and unsynchronized, and IOS XE 17.18 even logs a hint at boot:
R3# show logging | include INSECURE_CONFIG
%SYS-4-INSECURE_CONFIG: Module: NTP - Command: ntp server 10.0.13.1 key 1 <cr> - Reason: NTP configuration lacks authentication, allowing potential time manipulation attacks - Remediation: Please make the configured auth key trusted using the command - ntp trusted-key
R3# show ntp associations detail | include 10.0.13.1
10.0.13.1 configured, ipv4, authenticated (' ' reject), authtype (md5), insane, invalid, unsynced, stratum 16
Why it happens
On the client, NTP authentication needs the key (ntp authentication-key), ntp authenticate, the key on the ntp server line, and ntp trusted-key for that key number. Having the key and using it on the server line isn't enough: until the key is marked as trusted, the client rejects the server's replies.
The server needs the key trusted too. In the lab, after the client trusted its key, the client still got no time: the server had the key but hadn't marked it as trusted. It couldn't verify the client's signed requests and answered each one with a crypto-NAK:
R3# debug ntp packets
NTP Core (ERROR): Invalid-NAK error at 1894 10.0.13.3<-10.0.13.1
NTP Core (ERROR): Invalid-NAK error at 1961 10.0.13.3<-10.0.13.1
The fix
Mark the key as trusted on the client and on the server:
R3(config)# ntp trusted-key 1
R1(config)# ntp trusted-key 1
Check it
show ntp associations should show the server with a * (sys.peer) and a reach value that grows, and show ntp status should say Clock is synchronized. Syncing takes a few poll intervals, so allow a few minutes. If reach stays 0 from the start, check the basics first: the server address and reachability.
Practise this fault
This fault is in ENCOR Lab 18 of ENCOR Core Labs: a ready-made GNS3 project where you find and fix it yourself, alongside the other faults in the ticket, with the tested solution.
Or start with 15 free labs (5 each from CCNA, ENARSI and ENCOR), by email:
We’ll email you the download links and occasional lab tips. Unsubscribe with one click, any time. Your address is never shared.