Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 47

NTP: Syncing Network Time

Recommended resources

Welcome to your next lesson on essential IP services. In our previous session, we configured a DHCP relay agent, allowing a centralized server to manage IP addressing across different network segments. We'll continue this theme by exploring another fundamental service that ensures your network devices operate in unison: the Network Time Protocol (NTP).

This lesson focuses on why time synchronization is critical for network operations and how to configure a device to be an NTP client. For your upcoming project, having all devices share an accurate, synchronized time is not just good practice—it's essential for effective troubleshooting and security analysis. Without it, correlating event logs from different devices becomes nearly impossible.

1. Why Time Synchronization is Crucial

Before we dive into configuration, let's establish why synchronized time is so important in a network. While you already have a foundational understanding of services like DHCP and DNS, the role of timekeeping is often underestimated. Every router, switch, and server on your network maintains its own internal clock, but these clocks are prone to "drifting" and becoming inaccurate over time.

To see a practical example of the problems this causes, watch this short segment from Jeremy's IT Lab. It demonstrates how unsynchronized clocks can turn troubleshooting into a nightmare.

Free CCNA | NTP | Day 37 | CCNA 200-301 Complete Course

This video introduces the importance of accurate time on network devices.

Watch the section from the introduction. Notice how the log messages from two different routers are impossible to correlate because their timestamps are completely out of sync.

As the video shows, having inconsistent timestamps makes it incredibly difficult to build a coherent timeline of events during a network issue. The following article expands on this and lists several other critical functions that rely on synchronized time.

Network Time Protocol (NTP)

This article from NetworkAcademy.io provides a clear, structured list of reasons for time synchronization.

Read the section titled "Why does a network device need a synchronized clock?" Focus on the key areas mentioned: Logging, Security, Compliance, and Automation.

The key takeaways are that accurate time is essential for:

  • Troubleshooting: Correlating log messages across multiple devices to understand the sequence of events.
  • Security: Validating digital certificates (which have expiration dates), time-based access rules, and properly timestamping security events.
  • Automation: Ensuring scheduled tasks like backups or script execution run at the correct time across the network.

2. Understanding the Network Time Protocol (NTP)

Manually setting the clock on every device is not a scalable solution. NTP automates this process by allowing devices to synchronize their clocks with a reliable, authoritative time source.

NTP operates on a hierarchical system using the concept of stratum levels to define the distance from an authoritative time source.

  • Stratum 0: These are high-precision timekeeping devices like atomic clocks or GPS clocks. They are the reference sources but are not typically used directly on a network.
  • Stratum 1: These are servers directly connected to a Stratum 0 source. They are considered the most authoritative time servers on the network.
  • Stratum 2: These servers get their time from Stratum 1 servers.
  • Stratum 3: These servers get their time from Stratum 2 servers, and so on.

The stratum number increases with each hop away from the original source, and the accuracy slightly decreases. A device will not synchronize with a source that has a stratum level of 16, as this is considered unreachable or unreliable.

This diagram illustrates the NTP stratum hierarchy, showing how time is distributed from a Stratum 0 reference clock down through layers of servers to the end clients.

To get a more detailed overview of how NTP works, including its use of UDP port 123, watch the following video segment.

Free CCNA | NTP | Day 37 | CCNA 200-301 Complete Course

This video segment explains the fundamentals of NTP, including stratum levels and the server/client hierarchy.

Watch the portion from the NTP overview. Pay close attention to the explanation of stratum levels and the distinction between primary (Stratum 1) and secondary servers.


3. Configuring and Verifying an NTP Client

Now for the practical part: configuring a Cisco device to act as an NTP client. The goal is to point our device to one or more NTP servers and let it automatically synchronize its clock.

The primary command for this is ntp server [ip-address | hostname], which is configured in global configuration mode. It's best practice to configure multiple NTP servers for redundancy.

This image shows the basic process: the router's clock is initially incorrect, the `ntp server` command is configured, and after a few moments, the clock synchronizes with the correct time.

The following video provides a complete walkthrough of configuring a router to synchronize with public NTP servers on the internet. It also covers important related configurations, such as setting the timezone.

Free CCNA | NTP | Day 37 | CCNA 200-301 Complete Course

This video demonstrates the full configuration and verification process for an NTP client.

Watch from the configuration demo. Follow the steps the presenter takes: Configuring Servers: Using the ntp server command to specify multiple public Google NTP servers. Verification: Using show ntp associations and show ntp status to check the synchronization state. Notice the meaning of the symbols (*, +, ~). Timezone and Calendar: Configuring the local timezone with clock timezone (since NTP uses UTC) and using ntp update-calendar to keep the hardware clock in sync, which is useful across reboots.

Verification Commands

As shown in the video, two commands are essential for verifying NTP operation:

  1. show ntp status: This gives you a high-level summary. The most important line is the first one. If it says "Clock is synchronized," you're in good shape. It will also show your device's stratum level (which will be one higher than the server it's synced to) and the IP address of its reference NTP server.

    R1# show ntp status
    Clock is synchronized, stratum 2, reference is 216.239.35.0
    ...
    
  2. show ntp associations: This provides details about each configured NTP server. The most important symbol to look for is the asterisk (*), which indicates the "system peer" — the server your device is currently synchronized with.

    R1# show ntp associations
          address         ref clock     st   when   poll   reach   delay   offset    disp
    *~ 216.239.35.0    .GOOG.            1     32     64    377    25.132   0.518    1.231
    +~ 216.239.35.4    .GOOG.            1     28     64    377    24.876   -0.234   1.543
    * sys.peer, # selected, + candidate, - outlyer, x falseticker, ~ configured
    

Important Note: NTP is slow to synchronize. After you configure the ntp server command, it can take several minutes for the device to successfully sync. Be patient and re-check the status after a little while. Manually setting the clock to be reasonably close to the correct time before configuring NTP can speed this process up.


Conclusion

In this lesson, you've learned about the critical role of Network Time Protocol in maintaining a healthy and manageable network. Accurate, synchronized time is the bedrock for effective troubleshooting, robust security, and reliable automation.

Key Takeaways:

  • Importance: Synchronized time is essential for correlating log files, validating security certificates, and ensuring scheduled tasks run correctly.
  • Hierarchy: NTP uses a hierarchical system of stratum levels to measure the distance from an authoritative time source (like an atomic clock).
  • Client Configuration: A device is configured as an NTP client using the ntp server [ip-address] command in global configuration mode.
  • Verification: The show ntp status and show ntp associations commands are used to verify that the clock is synchronized and to see which server is being used.
  • Timezones: NTP communicates in UTC, so you must configure the local timezone on your device using the clock timezone command to display the correct local time.

In our next lesson, we will configure syslog. You will see firsthand how the accurate timestamps provided by NTP make syslog messages an invaluable tool for monitoring and troubleshooting your network.