03-10-2008 07:22 AM - edited 03-05-2019 09:39 PM
I have a 2651 router that I want to sync to an NTP time source. It appears as though the hardware clock needs to be set. What are the commands to set this up? Thanks.
Solved! Go to Solution.
03-10-2008 08:45 AM
Sean, why dontyou just use the question mark utility to find out what the switch is looking for?
hostname# clock set ?
or hostname# clock set 12:34:10 ?
...etc
Victor
03-10-2008 09:01 AM
Sean:
Glad you figured it out.
You didnt waste my time...
Just rate my posts and we'll call it even... :-)
Thanks
Victor
03-10-2008 07:33 AM
03-10-2008 07:49 AM
Sean:
Here is something I wrote for one of my clients.
2.5 Clock and NTP settings
The Network Time Protocol (NTP) is the defacto standard for Internet time synchronization. The current standard for NTP is version 3, which is defined in RFC 1305.
The protocol allows devices to communicate over UDP port 123 to obtain time information from an authoritative source. An NTP server connected directly to that source is considered a stratum 1 time server. A device that receives time synchronization from a stratum 1 server is a stratum 2 source - and so on, up to 16 hops.
Every network device that is NTP-capable must have it configured to aid in troubleshooting and forensics.
2.5.1 Synchronizing the Internal Clocks
Every Cisco router has an internal system clock. When the router boots, the internal system clock starts to maintain the current date and time, which is useful information to have in logging events.
Most high-end routers also have an internal battery-powered clock called a calendar. It maintains the correct date and time even when the router is turned off. Upon booting, the calendar automatically synchronizes the internal clock to its own clock to give the correct time.
The command to see if your router has a calendar is:
Router# show calendar
(If you receive an error message, your router does not have a calendar)
Sometimes the calendar clock and the system clock drift after synchronization, but there is a command to use to resynchronize them.
Router# clock update-calendar
(set the calendar time to internal clock)
Router# clock read-calendar
(set the internal clock to calendar time)
If the router does not have a battery-powered calendar to synchronize the internal clock, you will need to set the clock time manually or you can configure the router to time off of a centralized NTP server.
2.5.2 Setting the Time
Use this command to configure the clock manually:
Router(config)# clock set hh:mm:ss
(The date and time will revert to the default after the router is rebooted if there is no NTP server to synchronize to)
2.5.3 Synchronizing to an NTP Server
The time taken from a time server is in UTC (Greenwich Mean Time). You may want the time to reflect the time zone in which the router exists, which will be a number of hours offset from UTC.
Use the following commands to synchronize to an NTP time server:
Router(config)# clock timezone EST -5
(EST is 5 hours back from UTC).
Router(config)# ntp source loopback0
(source the loopback interface for NTP traffic)
Router(config)# ntp server
(Repeat as needed for multiple NTP servers).
Router(config)# clock summer-time CDT recurring
(enable the device to adjust for daylight savings time)
HTH
Victor
If so, please rate this post.
03-10-2008 08:14 AM
Victor-
I'm typing in the "clock set hh:mm:ss
Sean
03-10-2008 08:32 AM
Sean:
hostname# clock set hh:mm:ss {month day | day month} year
Where hh:mm:ss sets the hour, minutes, and seconds in 24-hour time. For example, set 20:54:00 for 8:54 pm.
The day value sets the day of the month, from 1 to 31. You can enter the day and month as april 1 or as 1 april, for example, depending on your standard date format.
The month value sets the month. Depending on your standard date format, you can enter the day and month as april 1 or as 1 april.
The year value sets the year using four digits, for example, 2004. The year range is 1993 to 2035.
The default time zone is UTC. If you change the time zone after you enter the clock set command using the clock timezone command, the time automatically adjusts to the new time zone.
This command sets the time in the hardware chip, and does not save the time in the configuration file. This time endures reboots. Unlike the other clock commands, this command is a privileged EXEC command. To reset the clock, you need to set a new time for the clock set command.
HTH
If so, please rate this post
Victor
03-10-2008 08:40 AM
Victor-
Not sure what the problem is. I have tried both formats (hostname# clock set hh:mm:ss {month day | day month} year and I still get an error. The IOS version is 12.2(10r)1.
03-10-2008 08:45 AM
Sean, why dontyou just use the question mark utility to find out what the switch is looking for?
hostname# clock set ?
or hostname# clock set 12:34:10 ?
...etc
Victor
03-10-2008 08:50 AM
Victor-
I figured it out. Sorry to waste your time. Thanks for the guidance.
Sean
03-10-2008 09:01 AM
Sean:
Glad you figured it out.
You didnt waste my time...
Just rate my posts and we'll call it even... :-)
Thanks
Victor
03-10-2008 09:04 AM
Victor-
How would I now go about configuring the same router to point to an NTP time source for clock sync?
Sean
03-10-2008 10:59 AM
Sean:
I gave you the config commands to do that in my first response to you...
I'll post it again...
2.5.3 Synchronizing to an NTP Server
The time taken from a time server is in UTC (Greenwich Mean Time). You may want the time to reflect the time zone in which the router exists, which will be a number of hours offset from UTC.
Use the following commands to synchronize to an NTP time server:
Router(config)# clock timezone EST -5
(EST is 5 hours back from UTC).
Router(config)# ntp source loopback0
(source the loopback interface for NTP traffic)
Router(config)# ntp server
(Repeat as needed for multiple NTP servers).
Router(config)# clock summer-time CDT recurring
(enable the device to adjust for daylight savings time)
HTH
Victor
03-13-2008 08:23 AM
Victor-
This is the reply when I do a SHOW NTP STATUS
OBBOE_JohnGlennSchool_2651#sho clock
11:20:14.520 est Thu Mar 13 2008
OBBOE_JohnGlennSchool_2651#sho ntp status
Clock is unsynchronized, stratum 16, no reference clock
nominal freq is 249.5901 Hz, actual freq is 249.5901 Hz, precision is 2**16
reference time is 00000000.00000000 (19:00:00.000 est Thu Dec 31 1899)
clock offset is 0.0000 msec, root delay is 0.00 msec
root dispersion is 0.00 msec, peer dispersion is 0.00 msec
03-13-2008 10:01 AM
Sean:
once agin, please post your config.
Also, are you able to PING the NTP server?
Is authentication configured?
It looks like your router is not communicating with the NTP server, and thereby not getting synchronized.
Victor
03-13-2008 10:26 AM
Victor-
I have a 7206VXR at my main site pointing to that NTP time source and I have no sync problems.But from the 2651, I get no PING response from that same source.
Sean
03-13-2008 10:28 AM
Sean
The information from show ntp association detail might be helpful. And as Victor says it would be most helpful to see how your router is configured.
Would I be correct in assuming that this router is in a school and that its access to the Internet is protected by some kind of firewall? If so can you check and see whether the firewall rules permit NTP traffic to the NTP server and permit responses from the NTP server?
[edit] I just saw your response to Victor indicating that the router can not ping the server so it NTP issue is an IP connectivity issue. In addition to my question about firewall rules I wonder if there might be an issue with address translation from packets sourced from the router?
HTH
Rick
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: