Re: ntpd confusion

2014-11-28 Thread Rick Thomas

On Nov 27, 2014, at 11:00 AM, mad  wrote:

> I found it. It was DHCP. The NTP init scripts checks if there is a file
> /var/lib/ntp/ntp.conf.dhcp in which the local router is configured as
> only ntp source.

The DHCP client package in Debian tries to get as much information as possible 
out of the DHCP transaction.  It then makes it available to as many other 
packages as it can.  I think this is a conscious decision on the part of the 
Debian Developers, and overall, I support it.  But it sometimes leads to 
surprises, such as we have seen here.

Specifically, for NTP, when a new NIC comes online and it’s configured for 
DHCP, the DHCP client checks to see if there is an NTP server provided in the 
DHCP response packet.  If there is, it copies /etc/ntp.conf to 
/var/lib/ntp/ntp.conf then strips out *all* lines beginning with “server”.  It 
then puts at the top of the file a single new “server” line directing ntpd to 
use the DHCP provided server.

When the ntp init.d script runs, it checks to see if there is a 
/var/lib/ntp/ntp.conf.dhcp file, and uses it in place of the conventional 
/etc/ntp.conf.

The result is what you saw.

If you don’t like that behavior, there is a workaround.  With the ntp version 
distributed in Wheezy (and, possibly,  also Lenny) the ntp.conf file can have a 
“pool” directive, which is *not* messed with by the DHCP scripts.  So, in 
/etc/ntp.conf replace the four lines

> server 0.debian.pool.ntp.org iburst
> server 1.debian.pool.ntp.org iburst
> server 2.debian.pool.ntp.org iburst
> server 3.debian.pool.ntp.org iburst

with the one line

> pool us.pool.ntp.org iburst preempt

If you aren’t in the US, try using your own country code in place of “us” as 
long as

> host .pool.ntp.org

indicates it exists.  If not, try some nearby countries.   Or, as a complete 
last resort, you can use just plain “pool.ntp.org” without a country code.

So, assuming you are in Germany, you would use

> pool de.pool.ntp.org iburst preempt


The mechanism behind the “pool” directive is described in more detail at
http://www.eecis.udel.edu/~mills/ntp/html/discover.html#pool

Enjoy!

Rick


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/93bda098-cd18-4cbe-9456-2828663a9...@pobox.com



Re: ntpd confusion

2014-11-27 Thread Bob Proulx
mad wrote:
> I found it. It was DHCP. The NTP init scripts checks if there is a file
> /var/lib/ntp/ntp.conf.dhcp in which the local router is configured as
> only ntp source.

Thank you for posting the resolution of the problem!

Bob


signature.asc
Description: Digital signature


Re: ntpd confusion

2014-11-27 Thread mad
I found it. It was DHCP. The NTP init scripts checks if there is a file
/var/lib/ntp/ntp.conf.dhcp in which the local router is configured as
only ntp source.

Am 11/24/14 16:11, schrieb Chen Wei:
> On Mon, Nov 24, 2014 at 10:58:29AM +0100, mad wrote:
>> mentioned, other Debian installations not on my home network, with the
>> same configuration show as expected four clock sources. Even starting
>> ntpd on the command line doesn't show any more data and ntpd is compiled
>> without debugging. Probably that is what I will do, recompile ntpd with
>> debug enabled and then see what ntpd is actually doing.
>>
> 
> Besides recompile with debug level option, I would also suggest try the
> NTP mailing list.
> 
>> Could it have something to do with upnp, zeroconf or something like that?
>>
> 
> No idea.
> 
> 


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/547774ca.8070...@sharktooth.de



Re: ntpd confusion

2014-11-24 Thread Chen Wei
On Mon, Nov 24, 2014 at 10:58:29AM +0100, mad wrote:
> mentioned, other Debian installations not on my home network, with the
> same configuration show as expected four clock sources. Even starting
> ntpd on the command line doesn't show any more data and ntpd is compiled
> without debugging. Probably that is what I will do, recompile ntpd with
> debug enabled and then see what ntpd is actually doing.
> 

Besides recompile with debug level option, I would also suggest try the
NTP mailing list.

> Could it have something to do with upnp, zeroconf or something like that?
> 

No idea.


-- 
Chen Wei


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/20141124151104.GA16480@localhost



Re: ntpd confusion

2014-11-24 Thread mad
Am 24.11.2014 um 06:13 schrieb Chen Wei:
> On Sat, Nov 22, 2014 at 09:57:50PM +0100, mad wrote:
>> # ntpq -p
>> remote  refidst t when poll reach   delay   offset  jitter
>> 
>> fritz.box   X.Y.Z.A   3 u-   6411.8740.153   0.052
>>
>> I use the default ntp configuration and other Debian installations
>> "directly on the internet" use all four clock sources
>> (0.debian.pool, 1.debian.pool...).
>>
> 
> Why not
> 
> 1) double check /etc/ntp.conf, make sure lines such as
> server 0.debian.pool.ntp.org exist.

Already done that multiple times.

> 2) verify remote ntp server is reachable,
> # nmap -sU -p123 0.debian.pool.ntp.org

# nmap -sU -p123 0.debian.pool.ntp.org
Host is up (0.027s latency).
Other addresses for 0.debian.pool.ntp.org (not scanned): 85.10.246.226
141.30.228.4 192.53.103.108
rDNS record for 37.120.166.3: olymp.auf-feindgebiet.de
PORTSTATE SERVICE
123/udp open  ntp

Nmap done: 1 IP address (1 host up) scanned in 1.70 seconds

> On my system, even the unreachable server shows in "ntpq -p" output.

That is my problem! Not on my internal home network systems. As
mentioned, other Debian installations not on my home network, with the
same configuration show as expected four clock sources. Even starting
ntpd on the command line doesn't show any more data and ntpd is compiled
without debugging. Probably that is what I will do, recompile ntpd with
debug enabled and then see what ntpd is actually doing.

Could it have something to do with upnp, zeroconf or something like that?

mad


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/54730145.8020...@sharktooth.de



Re: ntpd confusion

2014-11-23 Thread Chen Wei
On Sat, Nov 22, 2014 at 09:57:50PM +0100, mad wrote:
> # ntpq -p
> remote  refidst t when poll reach   delay   offset  jitter
> 
> fritz.box   X.Y.Z.A   3 u-   6411.8740.153   0.052
> 
> I use the default ntp configuration and other Debian installations
> "directly on the internet" use all four clock sources
> (0.debian.pool, 1.debian.pool...).
> 

Why not

1) double check /etc/ntp.conf, make sure lines such as
server 0.debian.pool.ntp.org exist.

2) verify remote ntp server is reachable,
# nmap -sU -p123 0.debian.pool.ntp.org

On my system, even the unreachable server shows in "ntpq -p" output.





-- 
Chen Wei


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/20141124051325.GA6657@localhost



Re: ntpd confusion

2014-11-23 Thread Bob Proulx
mad wrote:
> I use the default ntp configuration and other Debian installations
> "directly on the internet" use all four clock sources
> (0.debian.pool, 1.debian.pool...).

Should see some remapped names from the pool in the list then.

> Why is that? It seems to have something to do with IPv4 and IPv6. If I
> start ntpd with '-4 -n' ntpq exists with 'Connection refused'. If I
> start it with '-6 -n' ntpq says 'No association ID's returned'.
> 
> I'm thoroughly confused.
> 
> Does anyone knows what's happening?

No idea.  Works for me.  Is your router blocking ntp port 123 and
preventing them from connecting?

Bob

Example from a machine here using the pool.

  # ntpq -p
   remote   refid  st t when poll reach   delay   offset  jitter
  ==
  +time.tritn.com  66.220.9.122 2 u  651 1024  377   68.8241.508  22.071
  *pool-test.ntp.o 204.123.2.72 2 u  439 1024  377   69.1641.546   1.088
  -ntp2.pcloud.com 43.77.130.2542 u  568 1024  377   74.165  -12.416  17.309
  +tssnet1.tss.net 204.123.2.5  2 u  940 1024  377   74.379   -0.202   0.965


signature.asc
Description: Digital signature


Re: ntpd confusion

2014-11-23 Thread mad
Am 22.11.2014 um 22:01 schrieb Erwan David:
> Le 22/11/2014 21:57, mad a écrit :
>> Hi!
>>
>> I'm stumped. On my home network all my Debian installations _only_ use
>> the router as clock source.
>>
>> # ntpq -p
>> remote  refidst t when poll reach   delay   offset  jitter
>> 
>> fritz.box   X.Y.Z.A   3 u-   6411.8740.153   0.052
>>
>> I use the default ntp configuration and other Debian installations
>> "directly on the internet" use all four clock sources
>> (0.debian.pool, 1.debian.pool...).
>>
>> Why is that? It seems to have something to do with IPv4 and IPv6. If I
>> start ntpd with '-4 -n' ntpq exists with 'Connection refused'. If I
>> start it with '-6 -n' ntpq says 'No association ID's returned'.
>>
>> I'm thoroughly confused.
>>
>> Does anyone knows what's happening?
>>
>> TIA
>> mad
>>
>>
> 
> Does your router announce itself as ntp server in the dhcp answer ?

No, at least that is what I read from the answer (removed several lines):

# dhcpdump -i eth0
IP: A.B.C.25 > A.B.C.1
OP: 1 (BOOTPREQUEST)
 HTYPE: 1 (Ethernet)
  HLEN: 6
  HOPS: 0
   XID: 4cf07154
  SECS: 0
 FLAGS: 0
CIADDR: 0.0.0.0
YIADDR: 0.0.0.0
SIADDR: 0.0.0.0
GIADDR: 0.0.0.0
 SNAME: .
 FNAME: .
OPTION:  53 (  1) DHCP message type 3 (DHCPREQUEST)
OPTION:  50 (  4) Request IP address0.0.0.0
---

  TIME: 2014-11-23 15:33:49.014
IP: A.B.C.1 > 255.255.255.255
OP: 2 (BOOTPREPLY)
 HTYPE: 1 (Ethernet)
  HLEN: 6
  HOPS: 0
   XID: 4cf07154
  SECS: 0
 FLAGS: 7f80
CIADDR: 0.0.0.0
YIADDR: 0.0.0.0
SIADDR: A.B.C.1
GIADDR: 0.0.0.0
 SNAME: .
 FNAME: .
OPTION:  53 (  1) DHCP message type 6 (DHCPNAK)
---

  TIME: 2014-11-23 15:33:49.014
IP: A.B.C.25 > A.B.C.1
OP: 1 (BOOTPREQUEST)
 HTYPE: 1 (Ethernet)
  HLEN: 6
  HOPS: 0
   XID: 4cf07154
  SECS: 0
 FLAGS: 0
CIADDR: 0.0.0.0
YIADDR: 0.0.0.0
SIADDR: 0.0.0.0
GIADDR: 0.0.0.0
 SNAME: .
 FNAME: .
OPTION:  53 (  1) DHCP message type 7 (DHCPRELEASE)
---


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/5471f19d.4010...@sharktooth.de



Re: ntpd confusion

2014-11-22 Thread Erwan David
Le 22/11/2014 21:57, mad a écrit :
> Hi!
>
> I'm stumped. On my home network all my Debian installations _only_ use
> the router as clock source.
>
> # ntpq -p
> remote  refidst t when poll reach   delay   offset  jitter
> 
> fritz.box   X.Y.Z.A   3 u-   6411.8740.153   0.052
>
> I use the default ntp configuration and other Debian installations
> "directly on the internet" use all four clock sources
> (0.debian.pool, 1.debian.pool...).
>
> Why is that? It seems to have something to do with IPv4 and IPv6. If I
> start ntpd with '-4 -n' ntpq exists with 'Connection refused'. If I
> start it with '-6 -n' ntpq says 'No association ID's returned'.
>
> I'm thoroughly confused.
>
> Does anyone knows what's happening?
>
> TIA
> mad
>
>

DOes your router announce itself as ntp server in the dhcp answer ?


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/5470f9c3@rail.eu.org



ntpd confusion

2014-11-22 Thread mad
Hi!

I'm stumped. On my home network all my Debian installations _only_ use
the router as clock source.

# ntpq -p
remote  refidst t when poll reach   delay   offset  jitter

fritz.box   X.Y.Z.A   3 u-   6411.8740.153   0.052

I use the default ntp configuration and other Debian installations
"directly on the internet" use all four clock sources
(0.debian.pool, 1.debian.pool...).

Why is that? It seems to have something to do with IPv4 and IPv6. If I
start ntpd with '-4 -n' ntpq exists with 'Connection refused'. If I
start it with '-6 -n' ntpq says 'No association ID's returned'.

I'm thoroughly confused.

Does anyone knows what's happening?

TIA
mad


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/5470f8ce.5000...@sharktooth.de