How do I set a network device to be managed?

Solution 1:

This is what I have

$ cat /usr/lib/NetworkManager/conf.d/10-globally-managed-devices.conf 
[keyfile]
unmanaged-devices=*,except:type:wifi,except:type:gsm,except:type:cdma

I have two devices which I am certain they correspond to ProtonVPN, since their modification date are affected by connecting/disconnecting

$ cat /run/NetworkManager/devices/19
[device]
managed=true
connection-uuid=...
nm-owned=false
$ cat /run/NetworkManager/devices/18 
[device]
managed=true
perm-hw-addr-fake=...
connection-uuid=...
nm-owned=true
route-metric-default-effective=550

When I am disconnected, they look like this

$ cat /run/NetworkManager/devices/19
[device]
nm-owned=false
$ cat /run/NetworkManager/devices/18 
[device]
managed=true
perm-hw-addr-fake=...
nm-owned=true

I guess they are not meant to be manually modified, but this may help.

Please post the output of

$ nmcli device show

Also, forcing managed connections as shown in https://developer-old.gnome.org/NetworkManager/unstable/NetworkManager.html may help

Udev Properties

udev(7) device manager is used for the network device discovery. The following property influences how NetworkManager manages the devices:

NM_UNMANAGED If set to "1" or "true", the device is configured as unmanaged by NetworkManager. Note that the user still can explicitly overrule this configuration via means like nmcli device set "$DEVICE" managed yes or "device*.managed=1" in NetworkManager.conf.

So please post the result of using

nmcli device set proton0 managed yes
nmcli device set ipv6leakintrf0 managed yes

as shown e.g. here.

And check with ls -al /etc/udev/rules.d/ if there is any udev rule that may tell Network Manager to stop controlling an interface