NTP server x.x.x.x prefer

Hi All,

In the network where I am currently working we have configured the following:

ntp server x.x.x.x prefer


ntp server y.y.y.y

I thought the prefer keyword made us choose the configured server as the time source.

The y.y.y.y server is a GPS clock (stratum 1) and the x.x.x.x server is a 2811 router (stratum 2). The local router (the ntp client) will only synchronize with the superior stratum device regardless of the prefer keyword. Is this normal behaviour.

Also, I know that this is a strange thing to do but it was an interesting result that I wasn't expecting.

Does the prefer keyword only work if the sources have an equal stratum and one of the sources is not a GPS clock? I tried labbing this by configuring my 2811 router that is an NTP server as a stratum 1. The local NTP client still chose the GPS source even with the prefer keyword pointed to the 2811. (The GPS clock had a "ref clock" of .GPS. instead of an IP address and the stratums were the same) 




  • A quick search on Google led me to this article : http://oreilly.com/catalog/hardcisco/chapter/ch10.html

    " A router can be configured to prefer an NTP source over another. A preferred server's responses are discarded only if they vary dramatically from the other time sources. Otherwise, the preferred server is used for synchronization without consideration of the other time sources(...)"

    Don't have time to look more into this right but it is a good start.

    But that would make sense to prefer the lowest stratum server even if not preferred

  • Firstly, Thanks for the link. Secondly, I know this config doesn't make sense. Its not my idea :-) .

    I think I was reading the output on my NTP CLIENT incorrectly. We have a GPS clock with the IP address and we have a router that is an NTP Server with the IP address (which we prefer). The router (NTP server) gets its time from the GPS clock. When I did a "show ntp status" on my NTP CLIENT I thought it was showing me that it was receiving time from the GPS clock instead of the router (NTP server). When I do the "show ntp association" it shows me that the router (NTP SERVER) has been selected. This is correct as we prefer this in the config. What was confusing me is the output of "show ntp status"

    The "show ntp status" shows the GPS as the reference clock. I thought that this meant that the GPS clock was the direct source but I think it is just showing me what the router (NTP Server) which is my direct time source is using for its time source.

    NTP CLIENT#sh ntp assoc


          address         ref clock     st  when  poll reach  delay  offset    disp

    *~    .PPS.             1   120   512  377     1.3    0.04     0.0

    +~     2    16   512  377     1.2    0.41     0.0

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


    NTP CLIENT#sh ntp status

    Clock is synchronized, stratum 2, reference is

    nominal freq is 127.1572 Hz, actual freq is 127.1555 Hz, precision is 2**18

    reference time is D4DA629B.256C9304 (09:11:23.146 AEST Fri Mar 1 2013)

    clock offset is 0.0351 msec, root delay is 1.30 msec

    root dispersion is 0.76 msec, peer dispersion is 0.32 msec


    NTP CLIENT#sh run | i ntp

    ntp authentication-key 11 md5 ITS A SECRET 7

    ntp authenticate

    ntp trusted-key 11

    ntp clock-period 33777275

    ntp source Loopback0

    ntp access-group peer 30

    ntp server key 11

    ntp server key 11 prefer

  • There is a guy on youtube that did a 7 part video series on NTP between theory and lab and it was pretty great.  I learned a few things about NTP that I've never learned before and could never seem to get a straight answer on when researching.


    Like for example if your device is taking too long to sync time you can issue no ntp which will wipe ALL ntp commands and turn off the service so you can set your local time to something closer to what the real time is so when you then reapply your ntp configuration it will finally sync.


  • Thanks Ben1978. I'll check them out.

Sign In or Register to comment.