[CISCO] Force Time Update via NTP Server

Solved
lml-mike Posted messages 449 Registration date   Status Contributor Last intervention   -  
 yaya1983 -
Hello,

I have migrated the logs from my Cisco routers to a centralized server on my network. For this, I used the following commands:
 service timestamps debug datetime msec localtime show-timezone service timestamps log datetime msec localtime show-timezone clock timezone CET 1 clock summer-time CET recurring last Sun Mar 2:00 last Sun Oct 2:00 logging <ip> ntp server <ip> 

Since then, everything is working correctly, except for a few devices that cannot synchronize with the NTP server, probably due to the large time difference between the current date and that of the routers (some show the date of 2002!).

I would like to know if anyone knows a Cisco command that would allow forcing the update of the date and time of the Cisco routers on the NTP server. My searches have yielded nothing :S

Thank you so much!
Configuration: 800 Series Routers

8 answers

  1. Esila
     
    NTP synchronization, when the time offset is significant, is slow. To speed up the time update of your device on the NTP server, you can use the command clock set (command mode). This allows you to manually set the time and thus reduce the time offset. Afterwards, the NTP synchronization will happen more quickly.

    The command ntp update-calendar allows you to update the hardware clock (specific to the device) according to the software clock (the one learned from NTP). Thus, in case of a device reboot, the time from the hardware clock will match that learned during the last NTP exchange. The time offset will therefore be small (unless the device has been powered off for some time) and the NTP synchronization will occur rapidly.
    2
  2. lml-mike Posted messages 449 Registration date   Status Contributor Last intervention   123
     
    up ! :)
    0
  3. lml-mike Posted messages 449 Registration date   Status Contributor Last intervention   123
     
    ...
    is there anyone who knows the command then? Maybe at least a place where I could get a bit of help :)

    thank you!
    0
  4. brupala Posted messages 111140 Registration date   Status Member Last intervention   14 441
     
    hello,
    clock set ....
    it should work.
    --
    and ... There you go!
    0
  5. lml-mike Posted messages 449 Registration date   Status Contributor Last intervention   123
     
    I don’t have the command "clock set", I only have:

    clock initialize
    clock save
    clock summer-time
    clock timezone

    Thank you anyway for your support :)
    0
    1. brupala Posted messages 111140 Registration date   Status Member Last intervention   14 441
       
      not in config mode,
      in command mode !!
      --
      and ... Here you go!
      0
      1. lml-mike Posted messages 449 Registration date   Status Contributor Last intervention   123 > brupala Posted messages 111140 Registration date   Status Member Last intervention  
         
        Oops, my bad!

        But doesn't this command serve for manual time entry?

        I have an NTP server to update the date and time of my routers; is it possible to use this command for the router to refer to this server for updates?

        In any case, the help doesn't suggest it!

        Thanks =)
        0
      2. brupala Posted messages 111140 Registration date   Status Member Last intervention   14 441 > lml-mike Posted messages 449 Registration date   Status Contributor Last intervention  
         
        Yes,
        this is for manual time setting,
        isn't it what you wanted in your first question?
        --
        and ... Here you go!
        0
      3. yaya1983 > lml-mike Posted messages 449 Registration date   Status Contributor Last intervention  
         
        Router#configure terminal
        Router(config)#ntp server <@ NTP server IP>
        Router(config)#exit
        0
  6. lml-mike Posted messages 449 Registration date   Status Contributor Last intervention   123
     
    No,

    In fact, I wanted my routers to refer to my "ntp server <ip>" for updates and force this update if it doesn't happen automatically.

    Do you have any ideas? :$</ip>
    0
    1. brupala Posted messages 111140 Registration date   Status Member Last intervention   14 441
       
      It should happen automatically,
      I don't see a command to force an NTP request.
      show ntp status
      show clock
      optionally debug ntp events
      --
      and ... There you go!
      0
  7. lml-mike Posted messages 449 Registration date   Status Contributor Last intervention   123
     
    I will do my research to find a way to manually modify the time on the channel.

    Indeed, based on the information I've gathered, we cannot force something that is supposed to happen automatically; it’s a bit like asking to force the time to move forward :P

    Problem considered solved :)
    0
    1. brupala Posted messages 111140 Registration date   Status Member Last intervention   14 441
       
      but ...
      your routers, once they catch up with the initial offset (too large for NTP compensation), do not sync with NTP?
      (stratum < 16)?
      --
      and ... There you go!
      0
    2. Marcus
       
      #ntpdate ntp.cru.fr
      0
      1. brupala Posted messages 111140 Registration date   Status Member Last intervention   14 441 > Marcus
         
        We were talking about Cisco, there, Cisco == IOS
        --
        and ... Here you go!
        0
  8. Thibault
     
    What I just did was to reconfigure the NTP server and then reconfigure it:

    R2#conf t
    R2(config)#no ntp server 10.1.1.1
    R2(config)#ntp logging [I recommend this logs the NTP events]
    R2(config)#ntp server 10.1.1.1
    R2(config)#end
    R2#copy running-config startup-config

    In my case, it worked
    If it didn't work, you could make R2 believe that it will synchronize with
    another NTP server by taking another IP address from the same router
    acting as the NTP server.
    0