NTP on Cisco switches / routers

23 07 2014

Have been looking recently to review processes and introduce efficiencies where possible. One of the monthly tasks that I set myself was to ensure the time hadn’t slipped too far on my Cisco devices, and to correct it if it had.

A power cut in one of the offices caused all my Cisco devices to reset their time to the default of Mar 1993.

These two factors combined triggered some research into implementing NTP on all Cisco devices.

Commands I used on all devices are as follows. Devices were a combination of Catalyst 3560 and 3750 switches. Routers were already configured accordingly.

#clock timezone GMT 0
#clock summer-time BST recurring 4 SUNDAY MARCH 01:00 4 SUNDAY OCTOBER 02:00 60
#ntp server x.x.x.x
#ntp server x.x.x.x

This sets the timezone to GMT, specifies BST (British Summer Time) as the daylight savings timezone, set it to recur, starting from the 4th Sunday of March to the 4th Sunday of October, and specifies the NTP servers to use. I’ve found that Server 2008 R2 Domain Controllers work pretty well as a reference NTP server for a number of different device types including Linux based (Check Point firewalls / Coyote Point load balancers) as well as Cisco devices.. my environment doesn’t require nanosecond accuracy, but we do need to be able to correlate times in logs with specific events, which Server 2008R2 provides.

For troubleshooting / verification, I used these commands:

#show clock detail

The output of this is:

11:33:32.081 BST Wed Jul 23 2014
Time source is NTP
Summer time starts 01:00:00 GMT Sun Mar 23 2014
Summer time ends 02:00:00 BST Sun Oct 26 2014

It shows the time, time source, and start / end of the summer time – useful stuff. Time source is ‘user configured’ if NTP has not been used.

#show ntp associations

This shows the IP addresses of the NTP servers configured, what their reference clock sources are, and their ‘stratum’ (the output is largely IP address related, hence leaving it out here).

#show ntp status

Clock is synchronized, stratum 4, reference is x.x.x.x
nominal freq is 119.2092 Hz, actual freq is 119.2076 Hz, precision is 2**18
reference time is D77A0BC8.3817A4F2 (11:24:08.219 BST Wed Jul 23 2014)
clock offset is -18.8268 msec, root delay is 120.00 msec
root dispersion is 159.91 msec, peer dispersion is 28.58 msec

The shows a bunch of info – the most important part is ‘Clock is synchronised’.

Info provided without warranty, please test before implementing. I don’t have the luxury of a test environment myself, but due to the low-potential for negative impact in this case, implemented the above on a switch with minimal ports in use before implementing network-wide.




Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: