Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
ntp won't work (address family not supported by protocol)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
bitpicker
Apprentice
Apprentice


Joined: 28 Dec 2005
Posts: 163
Location: Germany

PostPosted: Sun Jan 01, 2006 9:28 am    Post subject: ntp won't work (address family not supported by protocol) Reply with quote

Following the wiki HowTo for ntp I got stuck pretty early in the process. Ntpdate won't work properly. Using

Code:

netselect -s 3 de.pool.ntp.org


I found the IP addresses of three German ntp servers to use; my /etc/conf.d/ntp-client now looks like this (comments removed):

Code:

NTPCLIENT_CMD="ntpdate"
NTPCLIENT_OPTS=" -b -u 62.206.253.10 80.190.252.238 81.169.136.18"
NTPCLIENT_TIMEOUT=30


The -u parameter was in there by default, it is not in the Wiki article and I have tried both versions with the same result. When trying to run the client I get:

Code:

/etc/init.d/ntpd-client start

* Setting clock via the NTP client 'ntpdate' ...
/etc/init.d/ntp-client: line 34:  5854 Getötet                ${NTPCLIENT_CMD} ${NTPCLIENT_OPTS} >/dev/null
 * Failed to set clock 


('Getötet' means 'killed')

If I run ntpdate with the above parameters or for instance de.pool.ntp.org instead of the IPs, I get

Code:

ntpdate -b de.pool.ntp.org
 1 Jan 10:20:54 ntpdate[5911]: poll(): nfound = 0, error: Address family not supported by protocol


I am using a router to connect to the internet, and it has an in-built firewall, but I have set it to forward port 123, both UDP and TCP, to my internal IP.

Does anyone have an idea what I could try next?

Robin
Back to top
View user's profile Send private message
adaptr
Watchman
Watchman


Joined: 06 Oct 2002
Posts: 6730
Location: Rotterdam, Netherlands

PostPosted: Sun Jan 01, 2006 2:13 pm    Post subject: Reply with quote

Quote:
I am using a router to connect to the internet, and it has an in-built firewall, but I have set it to forward port 123, both UDP and TCP, to my internal IP.

Not needed as long as you use -u.

I would check whether ntpdate (package ntp) was compiled with the right protocol(s).
As a first test, run it with the -4 option to force ipv4 addresses.

Why ever use IP addesses anyhow ?
Just use de.pool.ntp.org as your server; that picks a random one from that pool (as it is intended to be used).
There are over a dozen servers in the pool.
_________________
>>> emerge (3 of 7) mcse/70-293 to /
Essential tools: gentoolkit eix profuse screen
Back to top
View user's profile Send private message
bitpicker
Apprentice
Apprentice


Joined: 28 Dec 2005
Posts: 163
Location: Germany

PostPosted: Sun Jan 01, 2006 4:33 pm    Post subject: Reply with quote

Using de.pool.ntp.org doesn't change the problem. I've tried -4, too, and it still doesn't work; moreover, when I use -6 just to check I get an immediate error:

Code:

Error : No address associated with hostname
 1 Jan 17:29:21 ntpdate[5944]: can't find host de.pool.ntp.org

 1 Jan 17:29:21 ntpdate[5944]: no servers can be used, exiting


The original error appears after timeout only.

Robin
Back to top
View user's profile Send private message
mmbrothers
Apprentice
Apprentice


Joined: 24 Dec 2005
Posts: 224
Location: Boston

PostPosted: Sun Jan 01, 2006 4:44 pm    Post subject: Reply with quote

Does your machine resolve any DNS addresses correctly? Can you ping a remote hostname or use dig to get a dns record

Code:

dig www.google.com


Last edited by mmbrothers on Sun Jan 01, 2006 5:01 pm; edited 1 time in total
Back to top
View user's profile Send private message
bitpicker
Apprentice
Apprentice


Joined: 28 Dec 2005
Posts: 163
Location: Germany

PostPosted: Sun Jan 01, 2006 4:56 pm    Post subject: Reply with quote

I can ping de.pool.ntp.org ok, and other DNS resolutions work, too - I can use a browser, emerge etc.; though I do have problems with the ftp servers for emerge occasionally and emerge sometimes tries its way through a number of them with timing out. I put that down to holiday traffic ... (?) I've only been on Gentoo for a week, so I don't know whether that's going to be a constant problem. There might be something wrong with my net setup, but not in a way that it is completely broken.

Code:

ping de.pool.ntp.org
PING de.pool.ntp.org (84.16.227.206) 56(84) bytes of data.
64 bytes from de.pool.ntp.org (84.16.227.206): icmp_seq=1 ttl=52 time=82.0 ms
64 bytes from de.pool.ntp.org (84.16.227.206): icmp_seq=2 ttl=52 time=80.4 ms
64 bytes from de.pool.ntp.org (84.16.227.206): icmp_seq=3 ttl=52 time=95.4 ms
64 bytes from de.pool.ntp.org (84.16.227.206): icmp_seq=4 ttl=52 time=96.5 ms

--- de.pool.ntp.org ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3013ms
rtt min/avg/max/mdev = 80.467/88.609/96.507/7.381 ms


Robin
Back to top
View user's profile Send private message
magic919
Advocate
Advocate


Joined: 17 Jun 2005
Posts: 2182
Location: Berkshire, UK

PostPosted: Mon Jan 02, 2006 8:43 am    Post subject: Reply with quote

Have you turned off the port forwarding on your router?

Are you able to run the ntpdate command directly with -d to see if it gives any more data.
Back to top
View user's profile Send private message
bitpicker
Apprentice
Apprentice


Joined: 28 Dec 2005
Posts: 163
Location: Germany

PostPosted: Mon Jan 02, 2006 6:47 pm    Post subject: Reply with quote

The router does not have an option for turning off port forwarding altogether; you can only open individual ports. The -d parameter doesn't change anything, the error output is still the same.

Robin
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Mon Jan 02, 2006 8:20 pm    Post subject: Reply with quote

Try emerging a masked version of bind (I've happily used both 9.2.5-r6 and 9.3.1-r8 ), and ensure it's emerged with safe CFLAGS.
Back to top
View user's profile Send private message
bitpicker
Apprentice
Apprentice


Joined: 28 Dec 2005
Posts: 163
Location: Germany

PostPosted: Tue Jan 03, 2006 9:01 am    Post subject: Reply with quote

I have emerged 9.3.1-r8; no change. :(

Robin
Back to top
View user's profile Send private message
bitpicker
Apprentice
Apprentice


Joined: 28 Dec 2005
Posts: 163
Location: Germany

PostPosted: Fri Jan 13, 2006 8:44 am    Post subject: Reply with quote

Can't really put 'solved' in the topic line, but using chrony works for me. That's good enough.

Robin
Back to top
View user's profile Send private message
lim_on
n00b
n00b


Joined: 24 Nov 2005
Posts: 4

PostPosted: Wed Mar 29, 2006 6:47 pm    Post subject: Reply with quote

hm i have the same problem..and i don`t know where is the problem ;o(
Code:

ntpdate -v pool.ntp.org
29 Mar 20:33:25 ntpdate[19899]: ntpdate 4.2.0a@1.1190-r Wed Mar 29 20:11:04 CEST 2006 (1)
29 Mar 20:34:25 ntpdate[19899]: poll(): nfound = 0, error: Address family not supported by protocol
ntpdate -4 -v pool.ntp.org
29 Mar 20:35:16 ntpdate[20040]: ntpdate 4.2.0a@1.1190-r Wed Mar 29 20:11:04 CEST 2006 (1)
29 Mar 20:36:16 ntpdate[20040]: poll(): nfound = 0, error: Address family not supported by protocol
 ntpdate -4 -v -b pool.ntp.org
29 Mar 20:36:21 ntpdate[20122]: ntpdate 4.2.0a@1.1190-r Wed Mar 29 20:11:04 CEST 2006 (1)
29 Mar 20:37:21 ntpdate[20122]: poll(): nfound = 0, error: Address family not supported by protocol


Code:

socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 3
connect(3, {sa_family=AF_INET, sin_port=htons(123), sin_addr=inet_addr("81.169.171.179")}, 16) = 0
close(3)                                = 0
open("/etc/services", O_RDONLY)         = 3
fcntl64(3, F_GETFD)                     = 0
fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0
fstat64(3, {st_mode=S_IFREG|0644, st_size=35832, ...}) = 0
mmap2(NULL, 131072, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7e55000
read(3, "# /etc/services\n#\n# Network serv"..., 131072) = 35832
close(3)                                = 0
munmap(0xb7e55000, 131072)              = 0
socket(PF_INET6, SOCK_DGRAM, IPPROTO_IP) = -1 EAFNOSUPPORT (Address family not supported by protocol)
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 3
connect(3, {sa_family=AF_INET, sin_port=htons(123), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
getsockname(3, {sa_family=AF_INET, sin_port=htons(36183), sin_addr=inet_addr("127.0.0.1")}, [16]) = 0
close(3)                                = 0
socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP) = 3
setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
bind(3, {sa_family=AF_INET, sin_port=htons(123), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
fcntl64(3, F_SETFL, O_RDONLY|O_NONBLOCK) = 0
socket(PF_INET6, SOCK_DGRAM, IPPROTO_UDP) = -1 EAFNOSUPPORT (Address family not supported by protocol)
rt_sigaction(SIGALRM, {0x8049300, [], 0}, {SIG_DFL}, 8) = 0
setitimer(ITIMER_REAL, {it_interval={0, 200000}, it_value={0, 100000}}, NULL) = 0
setpriority(PRIO_PROCESS, 0, -12)       = 0
poll(

[{fd=3, events=POLLIN}], 1, 60000) = 0
time(NULL)                              = 1143657531
write(1, "29 Mar 20:38:51 ntpdate[20241]: "..., 10029 Mar 20:38:51 ntpdate[20241]: poll(): nfound = 0, error: Address family not supported by protocol
) = 100
poll(
Back to top
View user's profile Send private message
guid0
Guru
Guru


Joined: 06 Jul 2003
Posts: 370
Location: The Netherlands / Nederland

PostPosted: Mon Jul 07, 2014 8:58 am    Post subject: Reply with quote

ancient thread but i just ran into this issue. in case someone else hits this i had a incomplete /etc/shadow.

running "pwconf" and /etc/init.d/ntpd restart fixed it for me.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum