Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements
Webcast-Catalyst9k
New Member

Setting NTP on 2651 router

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.

2 ACCEPTED SOLUTIONS

Accepted Solutions
Blue

Re: Setting NTP on 2651 router

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

Blue

Re: Setting NTP on 2651 router

Sean:

Glad you figured it out.

You didnt waste my time...

Just rate my posts and we'll call it even... :-)

Thanks

Victor

22 REPLIES
New Member
Blue

Re: Setting NTP on 2651 router

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.

New Member

Re: Setting NTP on 2651 router

Victor-

I'm typing in the "clock set hh:mm:ss " command but I'm getting an error. Is the date the first three characters of the month (i.e. Mar 10 2008)?

Sean

Blue

Re: Setting NTP on 2651 router

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

New Member

Re: Setting NTP on 2651 router

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.

Blue

Re: Setting NTP on 2651 router

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

New Member

Re: Setting NTP on 2651 router

Victor-

I figured it out. Sorry to waste your time. Thanks for the guidance.

Sean

Blue

Re: Setting NTP on 2651 router

Sean:

Glad you figured it out.

You didnt waste my time...

Just rate my posts and we'll call it even... :-)

Thanks

Victor

New Member

Re: Setting NTP on 2651 router

Victor-

How would I now go about configuring the same router to point to an NTP time source for clock sync?

Sean

Blue

Re: Setting NTP on 2651 router

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

New Member

Re: Setting NTP on 2651 router

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

Blue

Re: Setting NTP on 2651 router

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

New Member

Re: Setting NTP on 2651 router

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

Hall of Fame Super Gold

Re: Setting NTP on 2651 router

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

New Member

Re: Setting NTP on 2651 router

Rick-

Here is the result of that command:

OBBOE_JohnGlennSchool_2651#sho ntp association

address ref clock st when poll reach delay offset disp

~152.2.21.1 0.0.0.0 16 - 64 0 0.0 0.00 16000.

* master (synced), # master (unsynced), + selected, - candidate, ~ configured

My entire district is behind a single SecurePIX 500 series firewall.

Sean

Hall of Fame Super Bronze

Re: Setting NTP on 2651 router

They need to allow NTP (TCP 123) inbound and outbound.

Blue

Re: Setting NTP on 2651 router

Sean:

As I suspected, you do not have connectivity to the NTP server. If the firewall is what is blocking you, you must contact the security group, assuming you have one, and ask them to allow NTP traffic from your router. They may want you to configure a loopback interface and source the NTP traffic from there (use the command I gave you above to make that happen).

Once they configure the firewall, try PINGing the NTP server and executing a telnet to the NTP server address on port 123 and make sure you source the loopback interface, IF you ended up having to soucre the loopback interface.

HTH

If so, kindly rate this post.

Hall of Fame Super Gold

Re: Setting NTP on 2651 router

If there is a 7206 at the main site which is accessing the NTP server with no problem, then I am guessing that the firewall has permit statements for NTP. There may be an issue if the source addresses are restricted in the permit statements.

I still wonder if the issue could be translation of addresses is not translating the request sourced from the router. It is probably using its outward facing interface address as the source address. I wonder if it would work better if the router used the ntp source command to specify using the LAN interface as the source of the NTP request.

Sean

It occurs to me that if your 7206 is learning NTP that it might be an option to have the router at the school(s) learn NTP from the 7206 rather than having it also go to the Internet source for NTP.

HTH

Rick

New Member

Re: Setting NTP on 2651 router

Rick-

So basically what you are saying is that the 2651 school router should source NTP from the 7206? Also would I configure the FE0/0 interface on the 2651 to point to the 7206 or the ATM1/0.10 interface?

Sean

Hall of Fame Super Gold

Re: Setting NTP on 2651 router

Sean

Yes I am suggesting that having the 2651 learn NTP from the 7206 would probably be easier and would be adequate. On the 2651 change the ntp server command so that it points to the 7206 rather than to the Internet NTP server.

If you are going to the 7206 it probably does not matter which address is the source address. So for now do not worry about the ntp source command. If we think later that we might need it then we will figure it out later.

HTH

Rick

New Member

Re: Setting NTP on 2651 router

Rick-

Would I use the following command based on my timezone for DST(I'm in the East):

Router(config)# clock summer-time CDT or EDT recurring

I noticed the 7206 is an hour off.

Sean

Hall of Fame Super Gold

Re: Setting NTP on 2651 router

Sean

First it does not really matter whether you use CDT or EDT in the command. All that is doing is establishing a label that the router will apply when it timestamps things like log records. Since you are in the East it would probably be logical to use EDT, but frankly you can use anything there that you want and the only thing it will impact is your log records.

There might be a couple of reasons why your 7206 is an hour off. Was it right and then got wrong when we went to daylight saving last weekend? If so then the reason that it is an hour off is that the version of code that it is running is operating with the old date for daylight savings and it will get right in a couple of weeks. Or you can modify the configuration to allow for the different dates. You could use this in the config if you wish the router to process the new dates:

clock summer-time EDT recurring 2 Sun Mar 2:00 1 Sun Nov 2:00

If the issue is not the change in daylight savings dates then perhaps the 7206 does not have the correct offset for NTP. In the clock timezone command what offset is specified. For the East it should be -5. If it were -4 or -6 it would explain the router being 1 hour off.

HTH

Rick

619
Views
0
Helpful
22
Replies
CreatePlease to create content