Skip to content
Oct 21 / jocke

Cisco IOS Clock Sync (with NTP) and Summer Time/Daylight Saving Time

Tired of having a Cisco-device that always ends up with a wrong clock? I was.

The first thing you’ll need, is a proper NTP-server. You can either set up one locally (which syncs from a hardware-device — like a GPS — or from an external server), or you can choose one of the public available NTP-servers. I’ve chosen to use «158.37.91.134» in this example.

Router(config)#ntp server 158.37.91.134

Thats it. Now your Cisco-device will stay in sync (it might need some time to get in a «accurate» state, as it has to learn how it’s internal clock varies compared to the external server). Just let it work it’s magic for a while. We can, of course, check it’s NTP-sync-status;

Router#sh ntp status
Clock is synchronized, stratum 3, reference is 158.37.91.134 
nominal freq is 250.0000 Hz, actual freq is 249.9955 Hz, precision is 2**32
reference time is D06AC4AA.47CC6D7C (15:54:50.280 CEST Thu Oct 21 2010)
clock offset is -0.0002 msec, root delay is 0.02 msec
root dispersion is 0.09 msec, peer dispersion is 0.01 msec
loopfilter state is 'CTRL' (Normal Controlled Loop), drift is 0.000017902 s/s
system poll interval is 1024, last update was 1886 sec ago.

Now that we have a working sync, we’ll need to set the correct time zone. You can verify what time zone it’s currently in, if you want;

Router#sh clock
16:29:00.378 CEST Thu Oct 21 2010

This one is in the CEST time zone (Central European Summer Time). To set your time zone;

Router(config)#clock timezone ?
  WORD  name of time zone

Router(config)#clock timezone CET ?
  <-23 - 23>  Hours offset from UTC

Router(config)#clock timezone CET 1

Where the name of the time zone is basically whatever you’d like to call the time zone. Wether you call it «CET», «UTC/GMT+1» or «LOLZONE» doesn’t really matter; it will accept it. The important part is that you get the offset correct. The offset needs to be between -23 and +23, and to figure out which one you need, you can use Google (search for «time zone + your country» or something).

Now we have a synced clock, and a correct time zone. Let’s get to the part where we configure the Summer Time/Daylight Saving Time. I’m not sure if this varies between different countries, so make sure you check what applies to your country. I’m from Norway, hence the following example is valid for Norway. We turn our clocks one hour forward at the last Sunday in March, from 02:00 to 03:00, effectively making the new time zone CEST (Central European Summer Time). The Summer Time ends at the last Sunday in October, where we turn our clocks one hour backwards, from 03:00 to 02:00, hence making our new time zone CET. Having this clarified, we can now configure it;

Router(config)#clock summer-time ?
  WORD  name of time zone in summer

Router(config)#clock summer-time CEST ?
  date       Configure absolute summer time
  recurring  Configure recurring summer time

Router(config)#clock summer-time CEST recurring ?
  <1-4>  Week number to start
  first  First week of the month
  last   Last week of the month

Router(config)#clock summer-time CEST recurring last ?
  DAY  Weekday to start

Router(config)#clock summer-time CEST recurring last Sun ?
  MONTH  Month to start

Router(config)#clock summer-time CEST recurring last Sun Mar ?
  hh:mm  Time to start (hh:mm)

Router(config)#clock summer-time CEST recurring last Sun Mar 02:00 ?
  <1-4>  Week number to end
  first  First week of the month
  last   Last week of the month

Router(config)#clock summer-time CEST recurring last Sun Mar 02:00 last ?
  DAY  Weekday to end

Router(config)#clock summer-time CEST recurring last Sun Mar 02:00 last Sun ?
  MONTH  Month to end

Router(config)#clock summer-time CEST recurring last Sun Mar 02:00 last Sun Oct ?
  hh:mm  Time to end (hh:mm)

Router(config)#clock summer-time CEST recurring last Sun Mar 02:00 last Sun Oct 03:00

Now we’re almost done. We need to make sure the time zone is printed in logs and debugs.

Router(config)#service timestamps debug datetime ?
  localtime      Use local time zone for timestamps
  msec           Include milliseconds in timestamp
  show-timezone  Add time zone information to timestamp
  year           Include year in timestamp

Router(config)#service timestamps debug datetime msec ?
  localtime      Use local time zone for timestamps
  show-timezone  Add time zone information to timestamp
  year           Include year in timestamp

Router(config)#service timestamps debug datetime msec localtime ?
  show-timezone  Add time zone information to timestamp
  year           Include year in timestamp

Router(config)#service timestamps debug datetime msec localtime show-timezone ?
  year  Include year in timestamp

Router(config)#service timestamps debug datetime msec localtime show-timezone year

This will format debugs the following way;

Oct 21 2010 16:54:53.598 CEST: ISAKMP (0): received packet from 192.168.0.200 dport 500 sport 500 Global (N) NEW SA

If you also want the above format for logs, just change «debug» with «log»;

Router(config)#service timestamps log datetime msec localtime show-timezone year

That’s it. Finally you can enjoy a Cisco-device with a working clock!

24 Comments

leave a comment
  1. Darren / Oct 27 2010

    I can’t stress the importance of good timekeeping. Most of our devices are running UTC. Everytime we are in summer time we need to remember to move the logs back. Damn annoying!

  2. havard / Nov 9 2010

    You can set the router as a NTP server as well. And with an ACL you have your own intern NTP server not eating Internett-bandwith :)
    command: NTP master

    Then your router syncs agains a NTP server and you have your own private NTP in your network. Add it to your DHCP pool with
    ip dhcp POOL
    option 41 ip.to.router

    • jocke / Nov 10 2010

      I had totally forgotten the «option 41» in DHCP pools. Thanks!

      You don’t have to use the «ntp master» to enable it as an NTP-server (as long as you use «ntp server», that is). The «ntp master» is just if you’d like it to be an NTP-server without the use of an external NTP-server.

    • jocke / Nov 10 2010

      Btw, it seems that NTP is «option 42», and not «option 41». (The latter is for NIS).

      • havard / Nov 11 2010

        oops! miss-typing.! ment option 42 ;) Just like the meaning with life, the universe and everything ;)

  3. Andre / Sep 1 2011

    Summer Time/Daylight Saving Time does vary between different countries, but some are the same. Anywho – great recipe for NTP/summertime! :)

    Bergen, NO

  4. Web Hosting / Oct 31 2011

    Nice one! I still find it annoying that for Europe we need to enter the whole information on the clock summer-time command.

    • http://www./ / Jan 29 2017

      Sehr geniale Musik, nur leider sind die Jungs persönlich in einer ganz eigenen Welt und denken sie waeren das beste! Schade drum.

  5. objectclass / Sep 7 2016

    Great article!

  6. porn online / Dec 11 2016

    Thanks tօ my father who shared with me regarding this blog, this web site is ǥenuinely amazing.

  7. คลิปโป๋ / Dec 28 2016

    I ɑm regular reader, how are you everybody? This piece of writing postеd at
    thіs web sitе is truly nice.

  8. หนัง sex / Dec 28 2016

    Helⅼo, I геad your bloցs regularlү. Yoսr story-telling style іs wittү,
    keep doing what yօu’re doing!

  9. xxx18 / Dec 28 2016

    I lіke іt when individuals get together and share opinions.

    Great website, continue the good woгk!

  10. It’s actually ɑ сool and helpful piece of info.
    I’m satisfied that you simply shared this heⅼpful information with us.
    Please stɑy uѕ up to date lіke this. Thanks for shɑring.

  11. soy'FxU / Jan 7 2017

    Have you ever thߋught about including a little bіt more than just your articles?
    I mean, what you say is impоrtant and all. Nevertheless jᥙst imagine іf you
    added some ɡreat images or vidеo clips to gіvᥱ your posts more, “pop”!
    Your content is exceⅼlent but with images and clips, this site сould undeniably be one of
    the most benefіciɑl in its niche. Amaᴢing
    blog!

    • Destiny / Feb 12 2017

      Celso Azevedo • 19 de Agosto de 2010 às 10:51Em principio o Classipress funciona em qualquer alojamento. A principal pruopecação deve de ser com o WordPress, contacte a empresa que escolheu e pergunte se alojamento é compatível com o WordPress 3.0

    • autokredit / Jun 8 2017

      Bonjour,Votre histoire me ramène 30 ans en arrière!j’ai travaillé avec le Dr Segal dans les années 80 et c’est en parti à cause de son histoire de maison que j’ai découvert que l’école Marie-Curie de Nogent sur Marne était dans la même situation et que nous avons fait comme lui avec un compteur Geiger.La suite est bien connue de tous. L’école a été rasée cette année.

  12. porn / Jan 14 2017

    If you woսld like to obtain a great deal from this post then you have tօ apply theѕe techniques to
    your won websitе.

  13. คลิปsex / Jan 14 2017

    Ⲏowdy! This post cоuld not be written much better!
    Reаding through tɦis post reminds me of my previous roоmmate!

    He continually kept preaching about this. I will forward this post to him.
    Prᥱtty sure he’s going to have a very good reɑd. Ꭲhanks for ѕharing!

  14. porn tube / Jan 15 2017

    Good way ߋf еxplaining, and good article tⲟ take facts about my presentatіon subject, which i am
    going to convey іn college.

    • Henrietta / Feb 12 2017

      Wow, you are so knwaledgeoble, I wouldn't even know what a button hook is. Another great treatment for leather is Patchouli oil, it smells bloody lovely too. Dried out leather never puts me off, it can always be fixed. You look like a green goddess in that dress. xx

  15. http://www./ / Mar 1 2017

    If you’re looking to buy these articles make it way easier.

  16. Hi Kevin, I think you make some good points about the state of hybrids and electric cars. However, the CR-Z hybrid is only about $20,000 so it’s competitive with the high MPG gas cars you list. I have a friend with one and he really likes it (and his last car was a Porsche). My car is 10 years old so I think about replacing it sometimes. I could get away with an electric car because I rarely drive more than 20 miles in a day. However, I agree that they are expensive for what you get. Maybe in a few years they will be much better and cheaper!

  1. Pingback / Dec 18 2010
Leave a Comment