Every security control you deploy quietly assumes one thing is true: that the clock is right. Certificate validation checks "not before" and "not after" against it. Log correlation across devices only works if their timestamps agree. Kerberos flat-out refuses tickets whose time is too far off. So an attacker who can move your clock does not need to break any of those systems - they can just lie to the thing all of them trust. NTP authentication is how you stop that, and it is a control far more people configure NTP without than with. This article, part of the infrastructure security cluster, builds authenticated NTP between two Cisco routers in a real CML lab, quotes the security warning IOS XE itself throws about the cipher, and explains why authenticating the time source is a genuine security control and not just tidy housekeeping.
What unauthenticated NTP actually trusts
Plain NTP takes time from whoever answers. Point a client at a server and it will sync, no questions asked about whether that server is who it claims to be. On a segment an attacker can reach, that is an opening: stand up a rogue NTP server, answer faster or louder than the real one, and start walking the client's clock. Push it forward past a certificate's expiry and TLS validation starts failing. Push it out of Kerberos's tolerance window and authentication breaks. Skew it relative to your other devices and your log correlation - the thing you would use to detect the attack - falls apart. NTP authentication closes the opening by making the client verify a shared key before it will accept time from a server.
Building authenticated NTP on Cisco IOS XE
In our lab, CORE1 is the authenticated NTP master and EDGE1 is the authenticated client. The pieces are the same on both ends: define a keyed authentication key, turn on authentication, mark the key as trusted, and then reference the key when pointing at the peer.
! CORE1 (master)
ntp authentication-key 10 md5 <key>
ntp authenticate
ntp trusted-key 10
ntp master 3
! EDGE1 (client)
ntp authentication-key 10 md5 <key>
ntp authenticate
ntp trusted-key 10
ntp server 10.255.0.2 key 10Read the four commands in order, because each does a distinct job:
Defines key ID 10 and its secret. The client and server must share the same ID and secret, or authentication fails.
Turns on authentication globally. Without it, the keys exist but are not enforced - a common misconfiguration.
Marks key 10 as trusted for peering. Only trusted keys can authenticate a time source, so a defined-but-untrusted key still cannot sync.
Tells the client to use key 10 when talking to this server. The server must prove the key or the client rejects its time.
IOS XE warns you: MD5 is weak
The moment you configure an MD5 key on IOS XE 17.18, the OS itself pushes back with a security warning worth quoting in full, because it tells you where NTP authentication is heading:
SECURITY WARNING - Module: NTP, Command: ntp authentication-key 10 md5 *, Reason: Weak cipher(s)
are present ... NTP authentication using MD5 - vulnerable to collision attacks ... Remediation:
Transition to more secure algorithms like SHA and AESThis is real output from the device, not our commentary. MD5 for NTP is legacy: it is vulnerable to collision attacks, and Cisco now explicitly recommends transitioning to SHA and AES-based keys where your platform and software support them. The authentication model we are demonstrating is identical regardless of cipher - define key, authenticate, trust, reference - so configure it with SHA/AES if you can. We used MD5 because it is what interoperates most broadly across gear you are likely to meet, but treat the warning as your instruction: prefer the stronger algorithm.
Verifying authentication is in force
The command that confirms the client is actually authenticating its server is show ntp associations detail. The words to look for are authenticated and authtype:
EDGE1#show ntp associations detail
10.255.0.2 configured, ipv4, authenticated, authtype (md5), ... stratum 16authenticated, authtype (md5) is the whole point: EDGE1 will only accept time from 10.255.0.2 if that server proves it holds the shared key. A rogue server without the key - or with the wrong key - cannot authenticate, so its time is ignored no matter how loudly it answers. That is the security property you configured NTP authentication to get.
An honest note on sync timing in the lab
You will notice the association above still shows stratum 16 - the "unsynchronized" stratum - and that is deliberate honesty about the lab, not a config error. Full NTP synchronization is slow: the reachability register has to fill, the client has to gather enough samples to trust the offset, and the stratum has to settle. In a virtual CML lab the emulated clocks start badly skewed and this can take many minutes, exactly as we saw with the ASA NTP capture in an earlier lab. So this article deliberately teaches the authentication model - how the client proves it is talking to a trusted server - rather than the sync timing, which is a property of the (virtual) hardware clocks, not of the security configuration. On production gear with sane clocks, sync follows normally once authentication succeeds; the security-relevant part, that the client refuses an unauthenticated source, is what we captured. NTP itself is a core network service, so if you are building out time, DNS, DHCP, and the rest, pair this with the wider IP services cluster.
Why authenticating the clock is a security control
It is easy to file NTP under "operational hygiene" and move on. Resist that. The reason authenticated time is a security control, not housekeeping, is the chain of things that silently break when the clock is wrong:
An attacker who can move an unauthenticated clock gets to attack all three without touching any of them directly. ntp authenticate plus ntp trusted-key take that lever away: the router will not move its clock for a server that cannot prove the shared key. And because so much of your security tooling - especially log correlation - depends on accurate time, authenticating the time source is a prerequisite for trusting everything downstream of it, including the security logs your other hardening produces.
Operational details that trip people up
A few practicalities decide whether authenticated NTP actually works in production rather than just in the config:
- The key ID and secret must match exactly on both ends. A mismatched secret does not throw a loud error - the association simply never authenticates and the client keeps ignoring the server's time. If sync is not happening, verify the key before you suspect anything else.
- Defining a key is not the same as trusting it. Without
ntp trusted-key 10, key 10 exists but cannot authenticate a peer. It is a two-step deliberately, so you can pre-stage keys before activating them. - Turn authentication on.
ntp authentication-keyand evenntp trusted-keydo nothing on their own untilntp authenticateis present. Configs that "have keys" but skip this line are the most common way to think you are authenticated when you are not. - Restrict who can even talk NTP. Authentication proves identity, but you should still limit which sources can reach the NTP service with an access-group or control-plane protection, so an attacker cannot even attempt the exchange.
- Plan key rotation. Because the same secret lives on every client and server in the domain, rotating it is a coordinated change. Stage the new key ID on all devices as trusted, cut clients over to it, then retire the old one.
None of these are exotic, but each is a quiet way to end up with NTP that looks authenticated in the running config and is not authenticating anything on the wire. The verification command is your ground truth: if show ntp associations detail does not say authenticated, you are not.
Key Takeaways
- Unauthenticated NTP trusts any answering server, which lets an attacker move your clock and silently break certificate validation, log correlation, and Kerberos.
- Authenticated NTP needs four pieces on each end:
ntp authentication-key,ntp authenticate,ntp trusted-key, and a keyedntp server ... keyreference. - IOS XE 17.18 flags MD5 as weak - it is vulnerable to collision attacks, and Cisco recommends moving to SHA and AES. The model is identical; use the stronger cipher where you can.
- Verify with
show ntp associations detail- the wordsauthenticated, authtype (md5)confirm the client will only accept time from a server that proves the key. - Sync timing is slow in a virtual lab (the association can sit at stratum 16 for minutes), so the article teaches the authentication model, not the sync timing.
- Authenticated time is a security control, not housekeeping - it is the foundation the rest of your logging and PKI trust.
Trustworthy time underpins trustworthy logs. Continue through the infrastructure security cluster to connect authenticated NTP with syslog design, control-plane policing, and management-plane hardening.