[ntp:questions] Ntpd and changing IP addresses

Frank Kardel kardel at ntp.org
Sat Oct 20 05:54:47 UTC 2007

Juliusz Chroboczek wrote:
>>>> Is there a way to tickle the ntp daemon so that it notices that
>>>> the set of IP addresses has changed?  Even better, is it possible
>>>> to have ntpd daemon deal automatically with address changes?
>>> What version of ntpd are you running?
> 4.2.4.  (It labels itself as ``4.2.4-1'', it's an OpenWRT package.)
>>> The stable release 4.2.4 supports dynamic address changes of the
>>> interfaces. I believe that the default check interval is currently
>>> every 10 minutes but can be changed on the command line.
>> It is 5 minutes.
> Hmm, that doesn't fit what I've observed.  I guess I should look at it
> again, but I had come to the conclusion that once a server is
> discarded, it never comes back.
You should be able to see the interface management by looking into
the syslog messages. Look for messages like "Listening" and "Deleting".
You shouldn't lose any connectivity (except may one exchange) upon 
interface address changes (that is: Linux is known to work).

> Still, none of this changes my initial query.  I can easily send
> a signal to the NTP daemon when IPs change to speed things up; but
> there's nothing in NTP's docs that indicates that such functionality
> is supported.
I beg to differ here: See html/ntpd.html and look for "interface update"
It is descripbed right there. Also ntpd -? give the help output:
  -U Num updateinterval interval in seconds between scans for new or 
dropped interfaces

If you do not get this output you max not have the real thing.

>> And it is 2 seconds after the change if the platform supports
>> routing sockets.
> Does that include Linux's rt_netlink?  (Which is roughly equivalent to
> BSD routing sockets, but even more messy.)
No rt_netlink functionality was added to ntpd up to now. Thanks for the
hint. {Sigh, another way of doing the same thing]
After looking at linux/rtnetlink.h I do agree that it is messier.

Maybe some Linux enthusiast will write the netlink releated code.

>> If you run 4.2.4(pX) you can add the keyword "dynamic" to the server and
>> peer configuration lines.
> Thanks, I'll look into that.
>                                         Juliusz


More information about the questions mailing list