You are not logged in.

#1 2010-12-26 22:11:52

disastrophe
Member
From: pdx
Registered: 2010-10-08
Posts: 91

[SOLVED] noobish question about ntp and ipv6

Hi,
Hi , yesterday I decided to install ntp. And while it appears to be doing its job fine, there is a troublesome message popping up in my /var/log/error.log.

/var/log/errors.log

Dec 26 13:54:18 localhost ntpd[2142]: bind(20) AF_INET6 fe80::21e:8cff:fe76:6287%2#123 flags 0x11 failed: Cannot assign requested address
Dec 26 13:54:18 localhost ntpd[2142]: unable to create socket on eth0 (4) for fe80::21e:8cff:fe76:6287#123

IPv6 is disabled at my router as well as in /etc/ufw/sysctl.conf

net.ipv6.conf.all.disable_ipv6 = 1

hence the ntpd complaint. But I was wondering why is is trying to make that connection in the first place?

Here is my /etc/ntp.conf

restrict default nomodify notrust notrap nopeer noquery  
restrict 127.0.0.1

server ntp.nblug.org
server time.envirahost.com
server ntp1.stsn.net

restrict ntp.nblug.org noquery nomodify
restrict time.envirahost.com noquery nomodify
restrict ntp1.stsn.net noquery nomodify  

driftfile  /var/lib/ntp/ntp.drift 
logfile    /var/log/ntp.log

and my /etc/hosts

127.0.0.1        localhost.localdomain    localhost ceres
208.201.242.2           ntp.nblug.org
67.228.95.34            time.envirahost.com
72.254.0.254            ntp1.stsn.net 

the output of ntpq -p

    remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
+ntp.nblug.org   204.123.2.72     2 u   44   64  377   34.111    8.461  24.394
+time.envirahost 216.218.254.202  2 u   36   64  377   11.180   -0.569  21.762
*ntp1.stsn.net   198.60.22.240    2 u   38   64  377   27.868   14.567  33.831

and finally /var/log/ntp.log

26 Dec 13:54:18 ntpd[2142]: bind(21) AF_INET6 fe80::21e:8cff:fe76:6287%2#123 flags 0x11 failed: Cannot assign requested address
26 Dec 13:54:18 ntpd[2142]: unable to create socket on eth0 (6) for fe80::21e:8cff:fe76:6287#123
26 Dec 13:54:18 ntpd[2142]: failed to init interface for address fe80::21e:8cff:fe76:6287

I am a noob and so I'm sure it's something quite simple but after a considerable amount of time searching and perusing the wiki I'm coming up empty. I would very much appreciate any help. Thanks.

Last edited by disastrophe (2010-12-28 00:18:02)


"If we believe absurdities, we shall commit atrocities." ~ Voltaire

Offline

#2 2010-12-27 01:23:19

thestinger
Package Maintainer (PM)
From: Toronto, Canada
Registered: 2010-01-23
Posts: 478

Re: [SOLVED] noobish question about ntp and ipv6

you can find all the command-line switches you can pass to ntpd in 'man ntpd', there's a -4 option for ipv4 only

the daemon scripts sources /etc/conf.d/ntp-client.conf so you just need to add the switch to NTPD_ARGS

Last edited by thestinger (2010-12-27 01:23:45)

Offline

#3 2010-12-28 00:17:01

disastrophe
Member
From: pdx
Registered: 2010-10-08
Posts: 91

Re: [SOLVED] noobish question about ntp and ipv6

Thank you very much! The daemon config location somehow eluded me. Marking as solved.


"If we believe absurdities, we shall commit atrocities." ~ Voltaire

Offline

#4 2010-12-28 00:24:35

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: [SOLVED] noobish question about ntp and ipv6

Daemon configuration files are located in /etc/conf.d/ on Arch Linux smile.


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#5 2014-09-29 16:22:17

colinkeenan
Member
From: Kansas City, MO USA
Registered: 2013-06-13
Posts: 213
Website

Re: [SOLVED] noobish question about ntp and ipv6

Since this thread comes up high in google searches even now at the end of September 2014, I thought I'd give the proper answer here for Arch with systemd:

First, get the current command being started by systemd:

    cat /usr/lib/systemd/system/ntpd.service

And you should find a line starting with ExecStart, like this:

    ExecStart=/usr/bin/ntpd -g -u ntp:ntp

You should not edit that file directly since it will be overwriting on update. Instead, follow the directions in https://wiki.archlinux.org/index.php/Sy … unit_files, which currently suggests you do something like the following:

Edit a new file (obviously as root) called

    /etc/systemd/system/ntpd.service.d/customexec.conf

(The directory ..../ntpd.service.d/ probably already exists and is empty, but if not, create it.)

Put the following into it:

[Service]
ExecStart=
ExecStart=/usr/bin/ntpd -4 -g -u ntp:ntp

Which first clears the previous ExecStart, and then replaces it with one that includes the -4 flag. I tried just editing the /etc/ntp.conf file first to put the -4 flag in there, but that conf file is basically ignored because the flags to be run are listed in the systemd service file.

Offline

#6 2015-01-19 15:13:16

cedricmc
Member
From: Madrid, Spain
Registered: 2011-11-20
Posts: 51

Re: [SOLVED] noobish question about ntp and ipv6

@colikeenan, nice solution! Only one minor adjustment, I believe it is more systematic to simply through

# systemctl edit ntpd.service

and input what you suggested, that is,

[Service]
ExecStart=
ExecStart=/usr/bin/ntpd -4 -g -u ntp:ntp

Optionally,

# systemctl daemon-reload

My question would be shouldn't systemd take care of this automatically (i.e. detect if IPv6 makes sense and act accordingly)?

Offline

#7 2015-01-19 15:43:55

Alad
Wiki Admin/IRC Op
From: Bagelstan
Registered: 2014-05-04
Posts: 2,418
Website

Re: [SOLVED] noobish question about ntp and ipv6

If the issue is that common, you should add it to the wiki instead of necrobumping a 4-year old thread.

https://wiki.archlinux.org/index.php/IP … r_programs <--- there

My question would be shouldn't systemd take care of this automatically (i.e. detect if IPv6 makes sense and act accordingly)?

systemd doesn't affect all user-space programs automagically. Imagine people's reactions if it did. big_smile

Last edited by Alad (2015-01-19 15:45:54)


Mods are just community members who have the occasionally necessary option to move threads around and edit posts. -- Trilby

Offline

#8 2015-01-19 16:03:00

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] noobish question about ntp and ipv6

Alad wrote:

If the issue is that common, you should add it to the wiki instead of necrobumping a 4-year old thread.

This. https://wiki.archlinux.org/index.php/Fo … Bumping.27


Closing.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

Board footer

Powered by FluxBB