1

I have the following /etc/ntp.conf on CentOS 7.4:

# /etc/ntp.conf: Ansible managed

# drift file
driftfile /var/lib/ntp/drift

# restrictions
restrict default nomodify notrap nopeer noquery
restrict 127.0.0.1
restrict ::1

# preferred servers
server 0.centos.pool.ntp.org iburst prefer
server 1.centos.pool.ntp.org iburst prefer
server 2.centos.pool.ntp.org iburst prefer
server 3.centos.pool.ntp.org iburst prefer

# fallback servers
server 0.pool.ntp.org iburst
server 1.pool.ntp.org iburst
server 2.pool.ntp.org iburst
server 3.pool.ntp.org iburst

# listen only on local interfaces
interface ignore wildcard
interface listen 127.0.0.1
interface listen ::1

# Disable the monitoring facility to prevent amplification attacks; see CVE-2013-5211
disable monitor

However, I'm only seeing it bind on IPv4:

[root@0c6790c4704c /]# netstat -tulpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
udp        0      0 127.0.0.1:123           0.0.0.0:*                           918/ntpd

Here are the logs:

Jan 08 01:34:05 0c6790c4704c systemd[1]: Starting Network Time Service...
Jan 08 01:34:05 0c6790c4704c ntpd[918]: proto: precision = 0.064 usec
Jan 08 01:34:05 0c6790c4704c ntpd[918]: 0.0.0.0 c01d 0d kern kernel time sync enabled
Jan 08 01:34:05 0c6790c4704c systemd[1]: Started Network Time Service.
Jan 08 01:34:05 0c6790c4704c ntpd[918]: ntp_io: estimated max descriptors: 65536, initial socket boundary: 16
Jan 08 01:34:05 0c6790c4704c ntpd[918]: Listen normally on 0 lo 127.0.0.1 UDP 123
Jan 08 01:34:05 0c6790c4704c ntpd[918]: Listening on routing socket on fd #17 for interface updates
Jan 08 01:34:07 0c6790c4704c ntpd[918]: 0.0.0.0 c016 06 restart
Jan 08 01:34:07 0c6790c4704c ntpd[918]: 0.0.0.0 c012 02 freq_set kernel 0.000 PPM
Jan 08 01:34:07 0c6790c4704c ntpd[918]: 0.0.0.0 c011 01 freq_not_set

Is there something I'm overlooking?

1

check if /etc/default/ntp contains NTPD_OPTS='-4 -g'

the option -4 says to the ntpd to only listen to ipv4 .

0

I had a special use-case: I was running VMs (read: regular systemd init process) in Docker (c.f. naftulikay/centos-vm) and the host system did not have IPv6 support enabled.

I found documentation that passing --ipv6 to the Docker daemon process would enable IPv6 support, so I tried this and got the following:

Error starting daemon: Error initializing network controller: Error creating default "bridge" network: could not find an available, non-overlapping IPv6 address pool among the defaults to assign to the network

Within the container, ifconfig shows no IPv6 address:

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 172.17.0.2  netmask 255.255.0.0  broadcast 172.17.255.255
        ether 02:42:ac:11:00:02  txqueuelen 0  (Ethernet)
        RX packets 7923  bytes 51083816 (48.7 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 6941  bytes 400410 (391.0 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

So, unsurprisingly, if there is no CIDR block associated, IPv6 isn't going to work. I guess read the docs for more info on how to set things up.

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.