Comware

 View Only
Expand all | Collapse all

NTP and time change

This thread has been viewed 6 times
  • 1.  NTP and time change

    Posted Apr 14, 2017 05:35 AM

    Hi everyone,

    I have a mistake for the time management on our switchs. I configured the NTP service like this : ntp-service unicast-server X.X.X.X

    But the system time on the switch has 2 hours late. Actually it's 11:27 but on the switch it's 09:27.

    I'm in France and we change to the summer time in March (+1 hour) and to the winter time in October (-1 hour) each year.

    How can i put the good time ? I saw the commands "clock summer-time ..." and "clock timezone ...". But must I manually change the year in the command "clock summer-time ..." each year ?

    Cordially.


    #NTP


  • 2.  RE: NTP and time change

    Posted Apr 14, 2017 06:38 AM

    Can you specify which HPE/Aruba Switch(es) are you speaking about?



  • 3.  RE: NTP and time change

    Posted Apr 14, 2017 09:36 AM

    Hi Parnassus!

    It sounds to me like a Comware switch.  It shouldn't matter what switch it is for ntp on a Comware device.  The commands are all there.

    Since the clock is 2 hours off, that is a much bigger time change than ntp is allowed to make.  The way to fix this is to shut off ntp, manually set the time, and then turn ntp back on.

    Assuming this is a Comware switch:

    • sys
    • undo ntp-service unicast-peer (or server) whatever is configured
    • quit
    • Use the clock datetime command to manually set the clock
    • You can also use the clock timezone command to set up your timezone at this point
    • sys
    • re-enable the ntp server or peer with the ntp-service command and you should be good to go
    • save the configuration so it isn't lost

    David

     



  • 4.  RE: NTP and time change

    Posted Apr 14, 2017 09:51 AM

    VoIP-Buddy wrote: Since the clock is 2 hours off, that is a much bigger time change than ntp is allowed to make.

    Is that true even if the offset (reported: 2 hours) is exactly equal to the time offset between UTC versus CEST time in France as of today (Summer time)? ...that time offset is exactly 2 hours now (see here).

    I mean: NTP client on the Switch appears synchronized...but it is so only against UTC clock because NTP synchronize on UTC...the OP just need to fix the Switch timezone/summertime if he need to see the Switch's clock referring to CET/CEST instead of just UTC.

    NTP isn't un-synchronized with an offset so large...or am I missing something?



  • 5.  RE: NTP and time change

    Posted Apr 14, 2017 09:55 AM

    Hi Parnassus!

    There are two things working here.  NTP base time is UTC.  You then need to set the timezone to convert it to local time.  If the UTC is 2 hours off you will have to set the time closer to the real time so that NTP can sync.

    I wasn't sure if NTP was synchronized at the UTC or if it was 2 hours off from UTC.  Maybe we'll get some more information from the original poster to make it more clear.

    Regards,

    David



  • 6.  RE: NTP and time change

    Posted Apr 14, 2017 10:00 AM

    Yep see my above post...the only thing I wasn't aware is that NTP client service should be shutted down and then bring back on again to force a re-synch if the time offset is *so* large that can't be automatically managed correctly (clearly if the issue is only UTC versus CEST/CET, NTP synchronization is not *the* issue). Let we see what OP will report back to us.



  • 7.  RE: NTP and time change

    Posted Apr 16, 2017 08:05 AM

    try:

    time timezone 60
    timesync sntp
    sntp unicast
    sntp server priority 1 x.x.x.x
    time daylight-time-rule Western-Europe



  • 8.  RE: NTP and time change

    Posted Apr 14, 2017 09:46 AM

    What is the output of display ntp-service sessions, display clock and display ntp-service status CLI commands?

    Since NTP uses UTC you should probably use the clock timezone CET add 01:00:00 (CET is UTC+1 for France between 01/01/2017 and 26/03/2017 and during 29/10/2017 and 31/12/2017; CEST is UTC+2 for France during summer time in between) and the clock summer-time CEST repeating 02:00:00 2000 March last Sunday 02:00:00 2000 October last Sunday  01:00:00 CLI commands to set respectively your Timezone and summertime.

    After that check your local time with the display clock command again to see if it matches with your local time in France.



  • 9.  RE: NTP and time change

    Posted Apr 24, 2017 06:13 AM

    Thanks for your answers.

    Our models of switches are 5500 and 3600 series, so 3com.

    If i understand, i must change the year with the commande "clock summer-time..." each year ?



  • 10.  RE: NTP and time change

    Posted Apr 24, 2017 08:37 AM

    No, this is not something that you need to do every year.  If the clock is way out of sync with real time, you need to manually set the clock so that it is much closer to the real time and then restart ntp.  Once you do that, ntp should be able to sync the time with your time server and you should be good going forward.

    Regards,

    David



  • 11.  RE: NTP and time change

    Posted Apr 26, 2017 03:39 AM

    I tried your method : disable ntp, set manually the clock then restart the ntp but it didn't work



  • 12.  RE: NTP and time change

    Posted Apr 26, 2017 09:30 AM

    Ricou,

    What about setting the timezone?

    Can you send the output from the previous display ntp commands so that we can see what is going on.  If the display ntp shows that the switches are sync'd to the configured timesource then the issue is a misconfigured timezone.

    David



  • 13.  RE: NTP and time change

    Posted Apr 27, 2017 03:41 AM

    VoIP-Buddy,

    With "display ntp-service status" i have this information : Reference time: 07:22:54.435 UTC Apr 27 2017(DCAC1ACE.6F6683C2).

    Is it what you wanted to see ?



  • 14.  RE: NTP and time change

    Posted Apr 27, 2017 04:11 AM

    Hi,

    Do a "display clock".

    and post output.

    Regards



  • 15.  RE: NTP and time change

    Posted Apr 27, 2017 04:39 AM

    sdide,

    Here : 08:38:01 UTC Thu 04/27/2017

    It's actually 10:38...



  • 16.  RE: NTP and time change

    Posted Apr 27, 2017 04:19 AM

    Hello @Ricou69,

    I don't want to be too harsh but, looking this thread, I noticed that @sdide (Yesterday) and I (two Weeks ago) - not to speak about replies from @VoIP-Buddy and @16again too - already suggested you to test some Comware CLI's NTP and Time Zone related commands (especially regarding configuring your correct Time Zone which, IMHO, is the culprit of your reported issue).

    Why don't you simply try them and report back here (by doing a Copy and Paste of results)?

    What @sdide wrote you yesteday (@VoIP-Buddy suggested that too) is basically the same I wrote you at very beginning (correctly @sdide pointed out the CLI difference between working with Comware 7 versus 5 but the line of reasoning is the same) but you provided us, as of today, *no* answers or just provided fragmented ones adding very few details to fix your problem...isn't it?

    Help us to help you.



  • 17.  RE: NTP and time change

    Posted Apr 27, 2017 05:15 AM

    parnassus,

    I already tried the commands with summer-time, timezone, etc. It's ok but at the beggining of each year i will must type the same command with the new year. We have more than 200 switches, so i will must use a script with IMC to do it on all switches, it's not pratical.

     

    sdide,

    It's the version 5 :

    Comware Software, Version 5.20.99, Release 2220P11
    Copyright (c) 2010-2013 Hewlett-Packard Development Company, L.P.
    HP A5500-48G-PoE+ EI Switch with 2 Interface Slots uptime is 5 weeks, 6 days, 0 hour, 25 minutes
    
    HP A5500-48G-PoE+ EI Switch with 2 Interface Slots with 1 Processor
    256M    bytes SDRAM
    32768K  bytes Flash Memory
    
    Hardware Version is REV.C
    CPLD Version is 002
    Bootrom Version is 721
    [SubSlot 0] 48GE+4SFP+POE Plus Hardware Version is REV.C

    But i see in your previous reply that with the version 7, you haven't to specify the year, it would be the best ! Unfortunately we have version 5.



  • 18.  RE: NTP and time change

    Posted Apr 27, 2017 05:47 AM

    Ricou69 wrote: I already tried the commands with summer-time, timezone, etc. It's ok but at the beggining of each year i will must type the same command with the new year.

    Are you sure about that?

    Time Zone daylight savings commands provided by me and @sdide should set a Daylight savings configuration which repeat itself each Year since an initial Year (year 2000), forever.


    Ricou69 wrote: But i see in your previous reply that with the version 7, you haven't to specify the year, it would be the best ! Unfortunately we have version 5.

    A Comware 5 version which is, to be clear, about four years old (R2220P11), reference here.

    As of today there is R2222P05. It could be a good idea to stay updated...maybe there were NTP related bugs discovered and fixed during this long time interval between R2220Pxx and R2222P05, never say never about that.



  • 19.  RE: NTP and time change

    Posted Apr 27, 2017 08:33 AM

    I know the version is old, i will upgrad the switches soon.

    I will use the commands that you told me and i will see in 2018.

    Thanks for all for your helps.

    Best regards.



  • 20.  RE: NTP and time change

    Posted Oct 10, 2017 06:11 AM

    We're close to 2018, it's just around the corner...so have you solved?



  • 21.  RE: NTP and time change

    Posted Aug 24, 2020 09:09 AM

    Hi there,

     

    Any help on my issue. New 5510 switch installed and configured NTP etc, however it is still 1 hour off even though its sync with NTP server. What is the possible issue. Someone mentioned about having to do it via the GUI first, surely this cannot be true.
    I look forwrd to hearing from you.



  • 22.  RE: NTP and time change

    Posted Apr 27, 2017 02:56 AM

    Hi,

    you need to set the timezone and daylight savings period if your use that in your country. The syntax differs a bit from Comware 5 to 7. (I'm not sure what exact 5500 platform you run and what 3600, but you can see wether its comware 5 or 7 by doing a "display version" and it will give you some version that starts either with "7. " or "5."

    For Comware 5. the syntax, if you live in Denmark as an example is:

     clock timezone CET add 01:00:00
     clock summer-time CEST repeating 02:00:00 2000 March last Sunday 02:00:00 2000 October last Sunday  01:00:00

    and for Comware 7. the syntaxis:

    clock timezone CET add 01:00:00
     clock summer-time CEST 02:00:00 March last Sunday 02:00:00 October last Sunday 01:00:00

     you need to adjust timezone and maybe dates as well.
    I think maybe France Paris has the same offset from GMT as Copenhagen does, and in fact uses the same daylightsaving dates. So you should be able to just copy the above for the relevant software version. Then enable NTP and be happy :)

    Regards.