[ntp:questions] NTPD not associating

Martin Beynon mebeyn at gmail.com
Wed Oct 8 11:32:52 UTC 2014


Hi All,

I am running ntpd version:
$ ntpd --version
ntpd 4.2.6p5
ntpd 4.2.6p5 at 1.2349 Mon Sep  1 10:44:08 UTC 2014 (1)

The computer has an Ethernet interface and a WiFi interface. NTP works fine
when connected to the internet via the Ethernet interface, but when the
system boots without Ethernet and uses WiFi ntpd does not sync the time (no
matter how long I wait) - note everything else works, just ntpd:

$ ntpq -p
     remote           refid      st t when poll reach   delay   offset
jitter
==============================================================================
 0.pool.ntp.org  .INIT.          16 -    -   64    0    0.000    0.000
0.000
 lafkor.de       .INIT.          16 -    -   64    0    0.000    0.000
0.000
 2.pool.ntp.org  .INIT.          16 -    -   64    0    0.000    0.000
0.000
 3.pool.ntp.org  .INIT.          16 -    -   64    0    0.000    0.000
0.000


Starting the daemon in debug mode (ntpd -D 4) produces the following output:
ntpd 4.2.6p5 at 1.2349 Mon Sep  1 10:44:08 UTC 2014 (1)
filegen_register(peerstats, 0x8a400)
filegen_register(loopstats, 0x8a3c4)
filegen_register(clockstats, 0x8a3ec)
filegen_register(rawstats, 0x8a3d8)
filegen_register(sysstats, 0x8a420)
filegen_register(protostats, 0x8a3b0)
sntp[316]: Started sntp
 8 Oct 11:15:29 ntpd[294]: set_process_priority: Leave priority alone:
priority_done is <2>
 8 Oct 11:15:29 ntpd[294]: proto: precision = 7.250 usec
loop_config: item 1 freq 0.000000
event at 0 0.0.0.0 c01d 0d kern kernel time sync enabled
yylex: lexeme 'driftfile' -> T_Driftfile
yylex: lexeme '/etc/ntp.drift' -> T_String
        <end of command>
yylex: lexeme 'server' -> T_Server
yylex: lexeme '0.pool.ntp.org' -> T_String
        <end of command>
yylex: lexeme 'server' -> T_Server
yylex: lexeme '1.pool.ntp.org' -> T_String
        <end of command>
yylex: lexeme 'server' -> T_Server
yylex: lexeme '2.pool.ntp.org' -> T_String
        <end of command>
yylex: lexeme 'server' -> T_Server
yylex: lexeme '3.pool.ntp.org' -> T_String
        <end of command>
Finished Parsing!!
create_sockets(123)
interface_action: wildcard 0.0.0.0 default wildcard drop
 8 Oct 11:15:29 ntpd[294]: ntp_io: estimated max descriptors: 1024, initial
socket boundary: 16
setsockopt SO_TIMESTAMP enabled on fd 16 address 0.0.0.0
bind(16) AF_INET, addr 0.0.0.0%0#123, flags 0x89
flags for fd 16: 0x802
Searching for addr 0.0.0.0 in list of addresses - NOT FOUND
Added addr 0.0.0.0 to list of addresses
 8 Oct 11:15:29 ntpd[294]: Listen and drop on 0 v4wildcard 0.0.0.0 UDP 123
created interface #0: fd=16, bfd=-1, name=v4wildcard, flags=0x89,
ifindex=0, sin=0.0.0.0, bcast=0.0.0.0, mask=255.255.255.255, Disabled:
update_interfaces(123)
interface_action: lo 127.0.0.1 IPv4 loopback - listen
examining interface #0: fd=-1, bfd=-1, name=lo, flags=0x5, ifindex=0,
sin=127.0.0.1, mask=255.0.0.0, Enabled:
Searching for addr 127.0.0.1 in list of addresses - NOT FOUND
create_interface(127.0.0.1#123)
set SO_REUSEADDR to on on 0.0.0.0
set SO_REUSEADDR to off on 0.0.0.0
setsockopt SO_TIMESTAMP enabled on fd 17 address 127.0.0.1
bind(17) AF_INET, addr 127.0.0.1%0#123, flags 0x5
flags for fd 17: 0x802
 8 Oct 11:15:29 ntpd[294]: Listen normally on 1 lo 127.0.0.1 UDP 123
restrict: op 1 addr 127.0.0.1 mask 255.255.255.255 mflags 00003000 flags
00000001
Searching for addr 127.0.0.1 in list of addresses - NOT FOUND
Added addr 127.0.0.1 to list of addresses
created interface #1: fd=17, bfd=-1, name=lo, flags=0x5, ifindex=0,
sin=127.0.0.1, mask=255.0.0.0, Enabled:
refreshing peers due to new addr 127.0.0.1
updating interface #1: fd=17, bfd=-1, name=lo, flags=0x5, ifindex=0,
sin=127.0.0.1, mask=255.0.0.0, Enabled: new - created
interface_action: wlan0 192.168.1.28 default listen
examining interface #0: fd=-1, bfd=-1, name=wlan0, flags=0x19, ifindex=0,
sin=192.168.1.28, bcast=0.0.0.0, mask=255.255.255.0, Enabled:
Searching for addr 192.168.1.28 in list of addresses - NOT FOUND
create_interface(192.168.1.28#123)
set SO_REUSEADDR to on on 0.0.0.0
set SO_REUSEADDR to off on 0.0.0.0
setsockopt SO_TIMESTAMP enabled on fd 18 address 192.168.1.28
bind(18) AF_INET, addr 192.168.1.28%0#123, flags 0x19
flags for fd 18: 0x802
 8 Oct 11:15:29 ntpd[294]: Listen normally on 2 wlan0 192.168.1.28 UDP 123
restrict: op 1 addr 192.168.1.28 mask 255.255.255.255 mflags 00003000 flags
00000001
Searching for addr 192.168.1.28 in list of addresses - NOT FOUND
Added addr 192.168.1.28 to list of addresses
add_interface mcast-capable 192.168.1.28
added 192.168.1.28 to head of IPv4 multicast-capable unicast local address
list
created interface #2: fd=18, bfd=-1, name=wlan0, flags=0x19, ifindex=0,
sin=192.168.1.28, bcast=0.0.0.0, mask=255.255.255.0, Enabled:
refreshing peers due to new addr 192.168.1.28
updating interface #2: fd=18, bfd=-1, name=wlan0, flags=0x19, ifindex=0,
sin=192.168.1.28, bcast=0.0.0.0, mask=255.255.255.0, Enabled: new - created
 8 Oct 11:15:29 ntpd[294]: peers refreshed
setting SO_REUSEADDR on wlan0 at 192.168.1.28 to off
setting SO_REUSEADDR on lo at 127.0.0.1 to off
create_sockets: Total interfaces = 3
 8 Oct 11:15:29 ntpd[294]: Listening on routing socket on fd #19 for
interface updates
io_open_sockets: maxactivefd 19
auth_setkey: key 65535 type 4 len 4 54f2d421
getaddrinfo v4 0.pool.ntp.org
newpeer: cast flags: 0x1 for address: 178.23.121.164
Finding interface for addr 178.23.121.164 in list of addresses
Found no interface for address 178.23.121.164 - returning wildcard
newpeer: local interface currently not bound
peer_clear: at 0 next 1 associd 40240 refid INIT
event at 0 178.23.121.164 8011 81 mobilize assoc 40240
newpeer: <null>->178.23.121.164 mode 3 vers 4 poll 6 10 flags 0x1 0x1 ttl 0
key 00000000
getaddrinfo v4 1.pool.ntp.org
newpeer: cast flags: 0x1 for address: 131.211.8.244
Finding interface for addr 131.211.8.244 in list of addresses
Found no interface for address 131.211.8.244 - returning wildcard
newpeer: local interface currently not bound
peer_clear: at 0 next 2 associd 40241 refid INIT
event at 0 131.211.8.244 8011 81 mobilize assoc 40241
newpeer: <null>->131.211.8.244 mode 3 vers 4 poll 6 10 flags 0x1 0x1 ttl 0
key 00000000
getaddrinfo v4 2.pool.ntp.org
newpeer: cast flags: 0x1 for address: 193.227.197.2
Finding interface for addr 193.227.197.2 in list of addresses
Found no interface for address 193.227.197.2 - returning wildcard
newpeer: local interface currently not bound
peer_clear: at 0 next 3 associd 40242 refid INIT
event at 0 193.227.197.2 8011 81 mobilize assoc 40242
newpeer: <null>->193.227.197.2 mode 3 vers 4 poll 6 10 flags 0x1 0x1 ttl 0
key 00000000
getaddrinfo v4 3.pool.ntp.org
newpeer: cast flags: 0x1 for address: 37.139.41.250
Finding interface for addr 37.139.41.250 in list of addresses
Found no interface for address 37.139.41.250 - returning wildcard
newpeer: local interface currently not bound
peer_clear: at 0 next 4 associd 40243 refid INIT
event at 0 37.139.41.250 8011 81 mobilize assoc 40243
newpeer: <null>->37.139.41.250 mode 3 vers 4 poll 6 10 flags 0x1 0x1 ttl 0
key 00000000
event at 0 0.0.0.0 c016 06 restart
loop_config: item 2 freq -0.000139
event at 0 0.0.0.0 c012 02 freq_set kernel -138.594 PPM
local_clock: mu 0 state 2 poll 3 count 0
Finding interface for addr 193.227.197.2 in list of addresses
Found no interface for address 193.227.197.2 - returning wildcard
Finding interface for addr 131.211.8.244 in list of addresses
Found no interface for address 131.211.8.244 - returning wildcard
Finding interface for addr 37.139.41.250 in list of addresses
Found no interface for address 37.139.41.250 - returning wildcard
Finding interface for addr 178.23.121.164 in list of addresses
Found no interface for address 178.23.121.164 - returning wildcard
poll_update: at 1 178.23.121.164 poll 6 burst 0 retry 0 head 0 early 2 next
67
timer: interface update
update_interfaces(123)
interface_action: lo 127.0.0.1 IPv4 loopback - listen
examining interface #0: fd=-1, bfd=-1, name=lo, flags=0x5, ifindex=0,
sin=127.0.0.1, mask=255.0.0.0, Enabled:
Searching for addr 127.0.0.1 in list of addresses - FOUND
updating interface #1: fd=17, bfd=-1, name=lo, flags=0x5, ifindex=0,
sin=127.0.0.1, mask=255.0.0.0, Enabled: present
interface_action: wlan0 192.168.1.28 default listen
examining interface #0: fd=-1, bfd=-1, name=wlan0, flags=0x19, ifindex=0,
sin=192.168.1.28, bcast=0.0.0.0, mask=255.255.255.0, Enabled:
Searching for addr 192.168.1.28 in list of addresses - FOUND
updating interface #2: fd=18, bfd=-1, name=wlan0, flags=0x19, ifindex=0,
sin=192.168.1.28, bcast=0.0.0.0, mask=255.255.255.0, Enabled: present
Finding interface for addr 193.227.197.2 in list of addresses
Found no interface for address 193.227.197.2 - returning wildcard
Finding interface for addr 131.211.8.244 in list of addresses
Found no interface for address 131.211.8.244 - returning wildcard
Finding interface for addr 37.139.41.250 in list of addresses
Found no interface for address 37.139.41.250 - returning wildcard
Finding interface for addr 178.23.121.164 in list of addresses
Found no interface for address 178.23.121.164 - returning wildcard
poll_update: at 2 131.211.8.244 poll 6 burst 0 retry 0 head 0 early 2 next
67
Finding interface for addr 193.227.197.2 in list of addresses
Found no interface for address 193.227.197.2 - returning wildcard
Finding interface for addr 131.211.8.244 in list of addresses
Found no interface for address 131.211.8.244 - returning wildcard
Finding interface for addr 37.139.41.250 in list of addresses
Found no interface for address 37.139.41.250 - returning wildcard
Finding interface for addr 178.23.121.164 in list of addresses
Found no interface for address 178.23.121.164 - returning wildcard
poll_update: at 3 193.227.197.2 poll 6 burst 0 retry 0 head 0 early 2 next
66
Finding interface for addr 193.227.197.2 in list of addresses
Found no interface for address 193.227.197.2 - returning wildcard
Finding interface for addr 131.211.8.244 in list of addresses
Found no interface for address 131.211.8.244 - returning wildcard
Finding interface for addr 37.139.41.250 in list of addresses
Found no interface for address 37.139.41.250 - returning wildcard
Finding interface for addr 178.23.121.164 in list of addresses
Found no interface for address 178.23.121.164 - returning wildcard
poll_update: at 4 37.139.41.250 poll 6 burst 0 retry 0 head 0 early 2 next
64
routing message op = 24: scheduling interface update
timer: interface update
update_interfaces(123)
interface_action: lo 127.0.0.1 IPv4 loopback - listen
examining interface #0: fd=-1, bfd=-1, name=lo, flags=0x5, ifindex=0,
sin=127.0.0.1, mask=255.0.0.0, Enabled:
Searching for addr 127.0.0.1 in list of addresses - FOUND
updating interface #1: fd=17, bfd=-1, name=lo, flags=0x5, ifindex=0,
sin=127.0.0.1, mask=255.0.0.0, Enabled: present
interface_action: wlan0 192.168.1.28 default listen
examining interface #0: fd=-1, bfd=-1, name=wlan0, flags=0x19, ifindex=0,
sin=192.168.1.28, bcast=0.0.0.0, mask=255.255.255.0, Enabled:
Searching for addr 192.168.1.28 in list of addresses - FOUND
updating interface #2: fd=18, bfd=-1, name=wlan0, flags=0x19, ifindex=0,
sin=192.168.1.28, bcast=0.0.0.0, mask=255.255.255.0, Enabled: present
routing message op = 16: scheduling interface update
routing message op = 16: scheduling interface update
routing message op = 16: scheduling interface update
routing message op = 16: scheduling interface update
routing message op = 16: scheduling interface update
timer: interface update
update_interfaces(123)
interface_action: lo 127.0.0.1 IPv4 loopback - listen
examining interface #0: fd=-1, bfd=-1, name=lo, flags=0x5, ifindex=0,
sin=127.0.0.1, mask=255.0.0.0, Enabled:
Searching for addr 127.0.0.1 in list of addresses - FOUND
updating interface #1: fd=17, bfd=-1, name=lo, flags=0x5, ifindex=0,
sin=127.0.0.1, mask=255.0.0.0, Enabled: present
interface_action: wlan0 192.168.1.28 default listen
examining interface #0: fd=-1, bfd=-1, name=wlan0, flags=0x19, ifindex=0,
sin=192.168.1.28, bcast=0.0.0.0, mask=255.255.255.0, Enabled:
Searching for addr 192.168.1.28 in list of addresses - FOUND
updating interface #2: fd=18, bfd=-1, name=wlan0, flags=0x19, ifindex=0,
sin=192.168.1.28, bcast=0.0.0.0, mask=255.255.255.0, Enabled: present
Finding interface for addr 193.227.197.2 in list of addresses
findlocalinterface: kernel maps 193.227.197.2 to 192.168.1.28
Searching for addr 192.168.1.28 in list of addresses - FOUND
Found interface #2 wlan0 for address 193.227.197.2
Finding interface for addr 131.211.8.244 in list of addresses
findlocalinterface: kernel maps 131.211.8.244 to 192.168.1.28
Searching for addr 192.168.1.28 in list of addresses - FOUND
Found interface #2 wlan0 for address 131.211.8.244
Finding interface for addr 37.139.41.250 in list of addresses
findlocalinterface: kernel maps 37.139.41.250 to 192.168.1.28
Searching for addr 192.168.1.28 in list of addresses - FOUND
Found interface #2 wlan0 for address 37.139.41.250
Finding interface for addr 178.23.121.164 in list of addresses
findlocalinterface: kernel maps 178.23.121.164 to 192.168.1.28
Searching for addr 192.168.1.28 in list of addresses - FOUND
Found interface #2 wlan0 for address 178.23.121.164
poll_update: at 68 37.139.41.250 poll 6 burst 0 retry 0 head 0 early 2 next
64
Finding interface for addr 193.227.197.2 in list of addresses
findlocalinterface: kernel maps 193.227.197.2 to 192.168.1.28
Searching for addr 192.168.1.28 in list of addresses - FOUND
Found interface #2 wlan0 for address 193.227.197.2
Finding interface for addr 131.211.8.244 in list of addresses
findlocalinterface: kernel maps 131.211.8.244 to 192.168.1.28
Searching for addr 192.168.1.28 in list of addresses - FOUND
Found interface #2 wlan0 for address 131.211.8.244
Finding interface for addr 37.139.41.250 in list of addresses
findlocalinterface: kernel maps 37.139.41.250 to 192.168.1.28
Searching for addr 192.168.1.28 in list of addresses - FOUND
Found interface #2 wlan0 for address 37.139.41.250
Finding interface for addr 178.23.121.164 in list of addresses
findlocalinterface: kernel maps 178.23.121.164 to 192.168.1.28
Searching for addr 192.168.1.28 in list of addresses - FOUND
Found interface #2 wlan0 for address 178.23.121.164
poll_update: at 68 178.23.121.164 poll 6 burst 0 retry 0 head 0 early 2
next 64
Finding interface for addr 193.227.197.2 in list of addresses
findlocalinterface: kernel maps 193.227.197.2 to 192.168.1.28
Searching for addr 192.168.1.28 in list of addresses - FOUND
Found interface #2 wlan0 for address 193.227.197.2
Finding interface for addr 131.211.8.244 in list of addresses
findlocalinterface: kernel maps 131.211.8.244 to 192.168.1.28
Searching for addr 192.168.1.28 in list of addresses - FOUND
Found interface #2 wlan0 for address 131.211.8.244
Finding interface for addr 37.139.41.250 in list of addresses
findlocalinterface: kernel maps 37.139.41.250 to 192.168.1.28
Searching for addr 192.168.1.28 in list of addresses - FOUND
Found interface #2 wlan0 for address 37.139.41.250
Finding interface for addr 178.23.121.164 in list of addresses
findlocalinterface: kernel maps 178.23.121.164 to 192.168.1.28
Searching for addr 192.168.1.28 in list of addresses - FOUND
Found interface #2 wlan0 for address 178.23.121.164
poll_update: at 69 193.227.197.2 poll 6 burst 0 retry 0 head 0 early 2 next
67
Finding interface for addr 193.227.197.2 in list of addresses
findlocalinterface: kernel maps 193.227.197.2 to 192.168.1.28
Searching for addr 192.168.1.28 in list of addresses - FOUND
Found interface #2 wlan0 for address 193.227.197.2
Finding interface for addr 131.211.8.244 in list of addresses
findlocalinterface: kernel maps 131.211.8.244 to 192.168.1.28
Searching for addr 192.168.1.28 in list of addresses - FOUND
Found interface #2 wlan0 for address 131.211.8.244
Finding interface for addr 37.139.41.250 in list of addresses
findlocalinterface: kernel maps 37.139.41.250 to 192.168.1.28
Searching for addr 192.168.1.28 in list of addresses - FOUND
Found interface #2 wlan0 for address 37.139.41.250
Finding interface for addr 178.23.121.164 in list of addresses
findlocalinterface: kernel maps 178.23.121.164 to 192.168.1.28
Searching for addr 192.168.1.28 in list of addresses - FOUND
Found interface #2 wlan0 for address 178.23.121.164
poll_update: at 69 131.211.8.244 poll 6 burst 0 retry 0 head 0 early 2 next
67
read_network_packet: fd=17 length 12 from 127.0.0.1
fetch_timestamp: system network time stamp: 1412767003.416895
receive: at 69 127.0.0.1<-127.0.0.1 flags 5 restrict 000
in process_control()
opcode 1, found command handler
read_status: ID 0
sendpkt(17, dst=127.0.0.1, src=127.0.0.1, ttl=-6, len=28)
read_network_packet: fd=17 length 12 from 127.0.0.1
fetch_timestamp: system network time stamp: 1412767003.472306
receive: at 69 127.0.0.1<-127.0.0.1 flags 5 restrict 000

ifconfig:
$ ifconfig
eth0      Link encap:Ethernet  HWaddr ****
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:24 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:14160 (13.8 KiB)
          Interrupt:52 Base address:0x7000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:84 errors:0 dropped:0 overruns:0 frame:0
          TX packets:84 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:16632 (16.2 KiB)  TX bytes:16632 (16.2 KiB)

wlan0     Link encap:Ethernet  HWaddr ***
          inet addr:192.168.1.28  Bcast:0.0.0.0  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:486 errors:0 dropped:0 overruns:0 frame:0
          TX packets:167 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:87235 (85.1 KiB)  TX bytes:27882 (27.2 KiB)

Routing table:
$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use
Iface
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0
wlan0
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0
wlan0

Netstat output:
$ netstat -antup
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address
State       PID/Program name
tcp        0      0 0.0.0.0:22              0.0.0.0:*
LISTEN      284/sshd
tcp        0      0 192.168.1.28:22         192.168.1.64:52038
ESTABLISHED 684/0
tcp        0      0 192.168.1.28:46469      54.76.238.101:443
TIME_WAIT   -
netstat: /proc/net/tcp6: No such file or directory
udp        0      0 192.168.1.28:123        0.0.0.0:*
294/ntpd
udp        0      0 127.0.0.1:123           0.0.0.0:*
294/ntpd
udp        0      0 0.0.0.0:123             0.0.0.0:*
294/ntpd


If I restart ntpd then it all works nicely, or if I plug the Ethernet cable
in:
$ killall ntpd
$ ntpd
$ ntpq -p
     remote           refid      st t when poll reach   delay   offset
jitter
==============================================================================
 0.pool.ntp.org  195.222.39.11    2 u    1   64    1   58.044  57608.0
0.008
 1.pool.ntp.org  193.67.79.202    2 u    1   64    1   30.252  57607.6
0.008
 2.pool.ntp.org  178.62.62.106    3 u    -   64    1   26.080  57609.7
0.008
 3.pool.ntp.org  .INIT.          16 u    -   64    0    0.000    0.000
0.008


I am little confused by the whole thing really... Any ideas?

Best Regards,

Martin


More information about the questions mailing list