[ntp:questions] Ntpd and changing IP addresses

Frank Kardel kardel at ntp.org
Wed Oct 10 17:51:30 UTC 2007


Danny Mayer wrote:
> Juliusz Chroboczek wrote:
>> Hi,
>>
>> I'm currently working on a project in which the set of IP addresses of
>> a host changes a few times after boot.  More precisely, at any time
>> a host can have
>>
>>   - a (global or NATed) IPv4 address;
>>   - a global IPv6 address; or
>>   - both.
>>
>> Most hosts only have IPv6 routing most of the time, and may
>> occasionally have IPv4; such hosts need to have NTP work over IPv6.
>> Others have IPv4 routing only before they establish a VPN to get to
>> the IPv6 Internet; such hosts need to have NTP work over IPv4 (the VPN
>> software requires the time to be accurate).
>>
>> Obviously, I want all the hosts to have the same NTP config, so I've
>> configured two IPv4 and two IPv6 servers.  Unfortunately, if ntpd
>> starts when only IPvx addresses are configured, it discards the IPvy
>> servers (``couldn't find interface for xxxx'').
>>
>> Currently, I'm working around that by restarting the ntp daemon
>> whenever the set of IP addresses changes.  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? 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. And it is 2 seconds after the change if the platform 
supports routing sockets.

 >
 > Danny

If you run 4.2.4(pX) you can add the keyword "dynamic" to the server and
peer configuration lines. This allows addresses to be configured that
cannot be reached at configuration time.

This behaviour will be standard with 4.2.6 and the "dynamic" keyword
will be deprecated then.

Frank




More information about the questions mailing list