Configure and Verify NTP on Cisco IOS Devices
Learn how to configure, authenticate, verify, and troubleshoot NTP time synchronization on Cisco IOS routers and switches.
Network Time Protocol (NTP) synchronizes the clocks of networked devices. This lesson shows how to configure Cisco IOS routers and switches as NTP clients, verify synchronization, provide time to downstream devices, and troubleshoot common failures.
This lesson assumes familiarity with Cisco IOS configuration modes, IPv4 addressing, routing, ping, loopback interfaces, standard ACLs, DNS, and UDP.
Why Accurate Network Time Matters
A Cisco device has a local software clock. Without synchronization, that clock may drift, reset, or differ from the clocks on other devices. NTP provides a common time reference so devices can maintain consistent timestamps.
- Logs and Syslog: Accurate timestamps show when events occurred and help order messages from multiple devices.
- Authentication: AAA systems and time-sensitive protocols can reject requests when clocks are too far apart.
- Certificates: Certificate validation depends on valid start and expiration times.
- Monitoring: Performance and availability tools use timestamps to calculate durations and correlate events.
- Troubleshooting: Consistent time makes it easier to match an interface failure, routing change, authentication event, and application alert.
- Incident response: Investigators can correlate records from routers, switches, firewalls, servers, and security systems.
The configured timezone changes how the device displays time; it does not replace synchronization. NTP normally distributes time based on UTC, while the Cisco device applies its timezone and optional daylight-saving rules for local display.
NTP Fundamentals
Network Time Protocol is an application-layer protocol that synchronizes clocks over IP. In the common client-server model, a Cisco device sends periodic requests to one or more NTP servers. The device measures the exchange, estimates the difference between clocks, and gradually disciplines its local clock.
NTP uses UDP port 123. Successful synchronization therefore requires IP reachability and policy permitting UDP 123, normally in both directions.
Stratum
Stratum describes the number of logical steps from an authoritative reference clock. A reference clock may be backed by GPS, an atomic clock, or another highly accurate source. A server directly connected to that reference is commonly stratum 1. A server synchronized to a stratum 1 server may be stratum 2, and downstream devices have higher stratum values.
A lower valid stratum number is generally closer to the reference clock. Stratum alone does not guarantee that a server is reachable, synchronized, or appropriate; NTP also evaluates the quality and consistency of available associations.
Important NTP Measurements
- System peer: The association selected as the device's active synchronization source.
- Offset: The calculated difference between the local clock and the server clock.
- Delay: The measured network path delay for NTP exchanges.
- Jitter: Variation in measured timing values over time.
- Reachability: An association health indication based on replies to recent polls.
- Poll interval: The interval between synchronization requests.
A configured server is only a candidate. The device must receive valid replies and select a suitable source before its clock becomes synchronized.
Configure the Cisco Clock and Timezone
First inspect the current software clock:
show clock detailSet the local display timezone with clock timezone. The name is a display label and the offset is measured from UTC.
configure terminal
clock timezone EST -5Where regional policy requires recurring daylight-saving changes, configure them explicitly. The exact rule depends on the region and IOS release.
clock summer-time EDT recurringUTC is the global time basis normally used by NTP. The timezone command controls local display, and the summer-time command applies a seasonal display adjustment. An incorrect timezone can make the displayed local time look wrong even when NTP reports synchronization.
Basic NTP Client Configuration
Configure approved NTP servers using their IP addresses:
configure terminal
ntp server 10.10.10.10
ntp server 10.10.20.10Using multiple reliable sources improves availability and lets the device compare candidates. In this example, the branch router can route to both internal servers. The normal process is:
- The router resolves or uses the configured server address.
- It polls the server using UDP 123.
- It evaluates replies, timing measurements, stratum, and association health.
- It selects a valid system peer.
- It disciplines the local clock over time.
You can configure a DNS hostname instead of an IP address when the platform and IOS release support it:
ntp server ntp1.example.internalHostname-based configuration requires working DNS resolution, a configured resolver, and reachability to the resolved address. IP-based configuration removes DNS as a dependency but still requires routing and UDP 123 access.
Use a Stable NTP Source Interface
By default, the source address of an NTP packet may depend on the outgoing interface. A stable loopback address is often preferable because it remains available while physical paths change and gives the NTP server one predictable client address.
configure terminal
interface Loopback0
ip address 10.255.255.1 255.255.255.255
exit
ntp source Loopback0
ntp server 10.10.10.10
ntp server 10.10.20.10The NTP servers must have a return route to 10.255.255.1. Their access controls and any firewalls must permit UDP 123 from that address. The source interface must be up, have a valid address, and be reachable through bidirectional routing.
Cisco IOS NTP Configuration Commands
Configure Symmetric-Key NTP Authentication
Symmetric-key authentication uses a shared key identifier and secret to help a client verify that NTP messages came from a trusted participant and were not altered in transit. It does not encrypt NTP traffic, protect the entire network path, or prove that the remote clock is authoritative. Network Time Security (NTS) is a more modern related technology where platform and server support are available; Cisco IOS symmetric-key authentication remains the core configuration covered here.
Example: the router and enterprise NTP server share key ID 10 and the same secret.
configure terminal
ntp authenticate
ntp authentication-key 10 md5 ExampleSharedSecret
ntp trusted-key 10
ntp server 10.10.10.10 key 10The key number and value must match on both participating systems. The server statement must reference the intended key, and the key must be trusted locally. Authentication syntax and supported algorithms can vary by Cisco platform and IOS release; protect secrets according to organizational policy.
Serve Time to Downstream Devices
A Cisco device that has a valid upstream NTP synchronization source can provide time to downstream clients. For example, a distribution switch can synchronize with central servers while access switches use the distribution switch as a nearby source.
Serving time does not make the Cisco device authoritative. Verify its upstream state first:
show ntp statusntp master makes the local clock an advertised NTP source at a configured stratum. It is useful in an isolated training lab or as a carefully planned fallback, but it should not replace a reliable authoritative source in production.
configure terminal
ntp master 5The configured value represents the advertised master stratum. A higher value indicates greater distance from an authoritative reference than a lower value. Do not use an unsynchronized local clock as a production time authority merely because clients can reach it.
Control NTP with Access Groups
Cisco IOS NTP access groups use standard ACLs to restrict NTP behavior. The mode determines what matching addresses are allowed to do.
Example allowing clients in 10.20.0.0/16 to receive time:
configure terminal
access-list 10 permit 10.20.0.0 0.0.255.255
ntp access-group serve-only 10Choose the least-permissive mode that meets the requirement. An incorrect access-group can block legitimate synchronization, including upstream associations if the policy is applied too broadly. Test both approved and unapproved source networks after applying the policy.
Verify NTP Operation
Inspect the Clock
show clock detailCheck the displayed time, timezone, daylight-saving indication, and whether the clock is identified as authoritative or synchronized by NTP.
Inspect Overall NTP Status
show ntp statusA healthy result identifies a synchronized state, the current stratum, reference source, and clock quality indicators. An unsynchronized message means that configuration alone has not produced a valid system peer.
Inspect Associations
show ntp associations
show ntp associations detailAssociation output shows candidate servers, selection state, reachability, poll information, and peer health. Detailed output adds measurements such as offset, delay, jitter, and server details.
Symbols can vary slightly by IOS release, so use the command's legend when available. The asterisk is the key exam and operational indicator: it normally marks the selected system peer.
NTP Verification Commands and Expected Results
Save and Maintain the Configuration
After successful validation, save the running configuration:
copy running-config startup-configDocument the approved time servers, source interface, timezone and daylight-saving policy, authentication-key handling, NTP access groups, and firewall requirements. NTP configuration persists in the startup configuration, but the live clock and synchronization state change over time. Monitor them periodically.
Structured NTP Troubleshooting
Use this order rather than changing several settings at once:
- Review the configuration.
- Test IP reachability using the intended source address.
- Validate routing and UDP 123 policy in both directions.
- Inspect associations and reachability.
- Inspect overall NTP status.
- Confirm the displayed clock and timezone.
Useful Tests
show running-config
ping 10.10.10.10 source Loopback0
show ntp associations
show ntp associations detail
show ntp status
show clock detailIf necessary, packet debugging can show NTP exchanges, but it can generate substantial output and affect an operational device:
debug ntp packets
undebug allUse debugging cautiously, preferably in a lab or maintenance window, and disable it immediately after collecting the required evidence.
Common NTP Failures
Interpretation Rules
A server command only creates an association candidate. It does not guarantee that the server responds, passes authentication, is synchronized itself, or wins peer selection. Allow sufficient time for polling and convergence before concluding that a new configuration has failed.
When using a hostname, confirm DNS resolution. When using a loopback source, confirm that the server can route back to the loopback address. When authentication is enabled, compare key ID and secret exactly. When an ACL or firewall is present, validate both the source address and UDP 123 behavior.
Practical Configuration Scenarios
Branch Router with Redundant Internal Servers
configure terminal
clock timezone EST -5
clock summer-time EDT recurring
ntp server 10.10.10.10
ntp server 10.10.20.10
end
show ntp status
show ntp associationsThis provides two approved sources and establishes the local display policy. Validate that one association becomes the system peer and that the clock reports synchronization.
Loopback-Sourced NTP
configure terminal
interface Loopback0
ip address 10.255.255.1 255.255.255.255
exit
ntp source Loopback0
ntp server 10.10.10.10
ntp server 10.10.20.10
endConfirm return routing and server-side permission for 10.255.255.1.
Distribution Switch Serving Access Switches
Configure the distribution switch with resilient upstream servers, verify that it is synchronized, and then permit only the access-switch subnet with a suitable NTP access group. Configure access switches to use the distribution switch as their NTP server.
Isolated Training Lab
configure terminal
ntp master 5This lets other lab devices use the router as a local source. It is intentionally non-authoritative and should not be substituted for enterprise or external time infrastructure in production.
Related Cisco Topics
Accurate NTP supports Cisco NTP configuration and complements the OSI reference model when analyzing protocol operation. For broader networking foundations, review computer networking concepts.