Ntp use only IPv4 and not IPv6 to query timeserver

I'm using 19.07.01.
It use IPv4 only to connect 0/1/2/3.openwrt.pool.ntp.org, why it never use IPv6 also if IPv6 servers latency is often better than IPv4 severs?

trendy@vps:[~]$host 0.openwrt.pool.ntp.org
0.openwrt.pool.ntp.org has address 89.221.214.130
0.openwrt.pool.ntp.org has address 94.124.107.190
0.openwrt.pool.ntp.org has address 162.159.200.123
0.openwrt.pool.ntp.org has address 89.221.210.188
trendy@vps:[~]$host 1.openwrt.pool.ntp.org
1.openwrt.pool.ntp.org has address 147.251.48.140
1.openwrt.pool.ntp.org has address 212.111.30.190
1.openwrt.pool.ntp.org has address 37.187.104.44
1.openwrt.pool.ntp.org has address 89.221.218.101
trendy@vps:[~]$host 2.openwrt.pool.ntp.org
2.openwrt.pool.ntp.org has address 195.113.20.2
2.openwrt.pool.ntp.org has address 37.187.104.44
2.openwrt.pool.ntp.org has address 80.79.25.111
2.openwrt.pool.ntp.org has address 162.159.200.123
2.openwrt.pool.ntp.org has IPv6 address 2a00:e140::123
2.openwrt.pool.ntp.org has IPv6 address 2001:718:801:230::8c
2.openwrt.pool.ntp.org has IPv6 address 2001:718:1e03:801::2
2.openwrt.pool.ntp.org has IPv6 address 2001:41d0:a:382c::1
trendy@vps:[~]$host 3.openwrt.pool.ntp.org
3.openwrt.pool.ntp.org has address 185.131.60.97
3.openwrt.pool.ntp.org has address 31.31.74.35
3.openwrt.pool.ntp.org has address 83.167.252.118
3.openwrt.pool.ntp.org has address 162.159.200.1

One reason would be that only 2. has ipv6 and might never reach that far.

The other reason is that no server replies:

root@koutsomoura:[~]#/usr/sbin/ntpd -d -S /usr/sbin/ntpd-hotplug -l -p 2001:41d0:a:382c::1 -n -p 2001:718:1e03:801::2 -p 2001:718:801:230::8c -p 2a00:e140::123
ntpd: sending query to 2a00:e140::123
ntpd: sending query to 2001:718:801:230::8c
ntpd: sending query to 2001:718:1e03:801::2
ntpd: sending query to 2001:41d0:a:382c::1
ntpd: timed out waiting for 2a00:e140::123, reach 0x00, next query in 1s
ntpd: timed out waiting for 2001:718:801:230::8c, reach 0x00, next query in 2s
ntpd: timed out waiting for 2001:718:1e03:801::2, reach 0x00, next query in 1s
ntpd: timed out waiting for 2001:41d0:a:382c::1, reach 0x00, next query in 2s

To me servers replays

# /usr/sbin/ntpd -n -d -S /usr/sbin/ntpd-hotplug -p 2606:4700:f1::123 -p 2606:4700:f1::1 -p 2a00:dcc0:dead:a5b2::123 -p 2a00:6d40:72:2992:80:211:128:146b
ntpd: sending query to 2a00:6d40:72:2992:80:211:128:146b
ntpd: sending query to 2a00:dcc0:dead:a5b2::123
ntpd: sending query to 2606:4700:f1::1
ntpd: sending query to 2606:4700:f1::123
ntpd: reply from 2a00:dcc0:dead:a5b2::123: offset:-0.006589 delay:0.011478 status:0x24 strat:2 refid:0xe872ccc1 rootdelay:0.002533 reach:0x01
ntpd: reply from 2a00:6d40:72:2992:80:211:128:146b: offset:-0.006743 delay:0.018810 status:0x24 strat:2 refid:0xe972ccc1 rootdelay:0.010849 reach:0x01
ntpd: reply from 2606:4700:f1::1: offset:-0.008766 delay:0.019764 status:0x24 strat:3 refid:0x0808470a rootdelay:0.010758 reach:0x01
ntpd: reply from 2606:4700:f1::123: offset:-0.009038 delay:0.019908 status:0x24 strat:3 refid:0x0808470a rootdelay:0.010758 reach:0x01
......

I also tried to change the order in /etc/config/system to 2/1/0/3.openwrt.pool.ntp.org but only IPv4 is still used.

Then it might have to do with what the OS prefers to query in case both v4 and v6 addresses are available.
If you explicitly set ipv6 addresses in the list, will it work fine?

1 Like