Network Manager controlling network interface

Íñigo Huguet ihuguet at redhat.com
Wed Feb 14 07:55:30 UTC 2024


NetworkManager used D-Bus for interprocess communication. If you can
use D-Bus in your application, this is the property that you need to
check, I think:
https://networkmanager.dev/docs/api/latest/gdbus-org.freedesktop.NetworkManager.Device.html#gdbus-property-org-freedesktop-NetworkManager-Device.Managed

A dirtier workaround would be to `exec` this command and check if the
output is "10 (unmanaged)":
    LANG=C nmcli -g GENERAL.STATE d show eth0

On Sat, Feb 10, 2024 at 11:48 AM Usman S. Ansari <usman.ansari at gmail.com> wrote:
>
> Hello,
>
> How can I tell from a C program that the networking manager is controlling the interface?



-- 
Íñigo Huguet



More information about the Networkmanager mailing list