[Networkmanager] [CONCHECK] Intercept policy change
Beniamino Galvani
bgalvani at redhat.com
Wed Oct 18 07:21:13 UTC 2023
On Fri, Oct 13, 2023 at 06:36:43PM -0300, Marcos Paulo Serafim wrote:
> Hi,
>
> Is it possible to intercept CONCHECK policy change events via DBUS signals or DISPATCH ?
Hi,
the global connectivity state is exported via D-Bus through the
"Connectivity" property on the Manager object:
https://networkmanager.dev/docs/api/latest/gdbus-org.freedesktop.NetworkManager.html#gdbus-property-org-freedesktop-NetworkManager.Connectivity
This is the state obtained by combining all devices' connectivity
states. When this property changes, the dispatcher event
'connectivity-change' is also triggered; you can intercept it by
using a dispatcher script:
https://networkmanager.dev/docs/api/latest/NetworkManager-dispatcher.html
> It seems to me that the change of default routing metrics is not signaled.
I suppose you are referring to the mechanism that penalizes devices
without connectivity by bumping their route metric. Since the property
and event mentioned above are about the global connectivity state,
they don't change if the global state doesn't change.
So, if you have two devices and one gets the metric penalty while the
other still has connectivity, there will be no change in global state.
If you are interested in the connectivity state of each device, you
can monitor the following D-Bus properties:
https://networkmanager.dev/docs/api/latest/gdbus-org.freedesktop.NetworkManager.Device.html#gdbus-property-org-freedesktop-NetworkManager-Device.Ip4Connectivity
https://networkmanager.dev/docs/api/latest/gdbus-org.freedesktop.NetworkManager.Device.html#gdbus-property-org-freedesktop-NetworkManager-Device.Ip6Connectivity
Beniamino
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/networkmanager/attachments/20231018/80321066/attachment.sig>
More information about the Networkmanager
mailing list