Synchronizing the Time on All Routers (NTP)
Problem
You want your routers to automatically learn the time and synchronize their clocks through the network.
Solution
Network Time Protocol (NTP) is an open standard protocol for time synchronization. You can implement NTP on a router to provide automatic and efficient time synchronization. To enable a basic NTP configuration, enter the following commands:
Router#configure terminalEnter configuration commands, one per line. End with CNTL/Z. Router(config)#clock timezoneRouter(config)#EST -5clock summer-timeEDTrecurringRouter(config)#ntp serverRouter(config)#172.25.1.1endRouter#
The ntp server command accepts either IP addresses or hostnames. To use a hostname, however, you will need to configure the router to either use a static host table or DNS for name resolution, as discussed in Chapter 2.
Some low-end routers such as Cisco 1000 series, Cisco 1600 series, Cisco 1720, and Cisco 1750 series do not support NTP. For these, Cisco provides support for the Simple Network Time Protocol ( SNTP), which is a compatible subset of the NTP standard. The SNTP configuration is similar to NTP:
Router#configure terminalEnter configuration commands, one per line. End with CNTL/Z. Router(config)#clock timezoneRouter(config)#EST -5clock summer-timeEDTrecurringRouter(config)#sntp serverRouter(config)#172.25.1.1endRouter#
Discussion
When NTP is enabled on a router, it will start trying to synchronize with the configured peers or servers as soon ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access