Chrony IPv6 sources offline after resume - dispatcher script runs before IPv6 is up

Chrony comes with sample NetworkManager dispatcher script that offlines
NTP sources when interface goes down and onlines them when interface
comes up. Technically it runs "chronyc onoffline" which tries to
determine whether each source can be reached. This script is actually
installed by distributions (openSUSE and Ubuntu for sure).

When system goes to suspend NetworkManager offlines interfaces that
causes chrony to offline its sources. On resume chrony is expected to
online them again.

This works well for IPv4 sources but IPv6 sources remain offline. Like

$ chronyc -n sources
210 Number of sources = 8
MS Name/IP address         Stratum Poll Reach LastRx Last sample

^? 2001:67c:1560:8003::c8        0   6     0     -     +0ns[   +0ns] +/-
^? 2001:67c:1560:8003::c7        0   6     0     -     +0ns[   +0ns] +/-
^-                 2   8   377   108  -2030us[-2209us] +/-
^-                   2   8   377    49  -2878us[-3067us] +/-
^+                  1   8   377    51  -2960us[-3149us] +/-
^*                 2   8   377    49  -1819us[-2008us] +/-
^+                   2   8   377   116  -3053us[-3230us] +/-
^+                2   8   377    50  +6182us[+5993us] +/-

The reason is - when ifup dispatcher script runs, IPv6 is not yet
configured. Here are route entries

default via dev wlan0 proto dhcp metric 20600 dev wlan0 scope link metric 1000 dev wlan0 proto kernel scope link src metric 600
::1 dev lo proto kernel metric 256 pref medium
fe80::/64 dev wlan0 proto kernel metric 600 pref medium

So IPv4 is up and has default route but IPv6 still only link-local
address. Couple of seconds later

::1 dev lo proto kernel metric 256 pref medium
2a00:xxxx:yyyy:zzzz::/64 dev wlan0 proto ra metric 600 pref medium
fe80::/64 dev wlan0 proto kernel metric 600 pref medium
default via fe80::1 dev wlan0 proto ra metric 20600 pref medium

Is it possible to run dispatcher script after both IPv4 and IPv6 are
configured on interface? Or only IPv6 for that matter - it does not
matter if "chronyc onoffline" runs multiple times.

Both IPv4 and IPv6 are set to auto.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]