Back to Command Reference
Global ConfigDomain 7.0

ntp server

Instructs the Cisco device to synchronize its internal hardware clock with an external Network Time Protocol (NTP) server. Consistent time across the enterprise is mandatory for correlating syslog error messages, validating cryptographic certificates, and logging security events.

Quick Reference

Execution ModeRouter(config)#
Protocol / PortUDP 123
Verification Commandsshow ntp status | show ntp associations
Negation Commandno ntp server [ip-address]

Syntax & Architecture Logic

ntp server [ip-address] [prefer]

NTP relies on a hierarchical system of Stratum Levels to determine the most accurate time source. Stratum 1 servers are directly connected to atomic clocks or GPS satellites. A Stratum 2 server gets its time from a Stratum 1 server, and so on.

  • [ip-address]: The target NTP server. Enterprise routers rarely point directly to the internet; they usually point to an internal core switch or a local Windows Domain Controller.
  • [prefer]: If you configure multiple ntp server statements for redundancy, the prefer keyword forces the router to trust a specific server over the others, overriding standard stratum-based selection logic.

CLI Deployment Scenarios

Scenario 1: Standard NTP Client Configuration

You want your edge router to pull time from two internal core servers for redundancy, but you strictly want it to prioritize Core Server A (10.1.1.1).

Router(config)# ntp server 10.1.1.1 prefer
Router(config)# ntp server 10.1.1.2
! The router will now silently begin polling these servers over UDP port 123.

Scenario 2: The "ntp master" Fallback

If your enterprise is completely air-gapped and disconnected from the internet, you can force a central Cisco router to act as the authoritative Stratum 1 time source for your entire network using the ntp master command.

! Configured on the Core Router
Core_Router(config)# ntp master 4
! The core router now claims to be a Stratum 4 time source, and downstream switches can point to it.
! Note: If you do not specify a stratum number, it defaults to Stratum 8.

CCNA Exam Gotchas

[!]

NTP UTC vs Local Time

A classic troubleshooting scenario: You successfully configure an NTP server, verify the sync, but your log timestamps are off by 5 hours.

The Cause: NTP distributes time exclusively in Coordinated Universal Time (UTC). It never sends timezone data. If you want your logs to reflect local time, you must manually offset the router's internal clock using the global command: clock timezone EST -5.

[!]

Stratum 16 is Dead

The valid Stratum range is 1 through 15. If you run show ntp status and see that your router is at Stratum 16, that is Cisco's code indicating the clock is unsynchronized. The NTP traffic is either being blocked by an ACL, or the target server is unreachable.