Re: NetworkManager behavior answers not found in docs



On Wed, 2018-10-24 at 19:58 +0200, Thomas HUMMEL wrote:
On 10/24/2018 06:22 PM, Thomas Haller wrote:

Let's call this "externally managed". Not sure that's helpful, but
in
NetworkManager source code it's called like that.

In nmcli output, you cannot really distinguish a regular activated
profile from such an externally managed one. Except, that in the
latter
case the profiles was autocreated and its name is the device name
(eth1).

Understood.

Now if I edit this connection matching an externally managed device
(for 
instance using nmcli connection edit), would that turn it into a 
normally managed one ?

Hi,

Optimally yes.

the profile for the externally managed device is at first in a way,
that when the device disconnects (for example, because you remove the
IP address again), that it gets automatically removed again.

If you modify the profile, then the generated profile will no longer be
automatically removed when the device disconnects later. It will
continue to exist until you delete it (or until NetworkManager
restarts, in case of `nmcli connection modify --temporary`).


If you interact with such an externally managed device, then NM is
supposed to fully take over... that in particular is the case with
  - nmcli device disconnect ...
  - nmcli device connect ...
  - nmcli connection up $ANY_PROFILE # on the device in question
  - nmcli connection down $THE_GENERATED_PROFILE
  - nmcli connection delete $THE_GENERATED_PROFILE
where NM disconnects the device (and possibly fully activates a profile
afterwards).

optimally, the following would fully take over the device too, however
in a graceful manner that does not affect your connectivity:
  - nmcli device reapply $DEVICE
  - nmcli connection modify $THE_GENERATED_PROFILE
  - nmcli device set "$DEVICE" managed yes
after such an operation, the device should no longer be externally
managed. But likely there are issues with this. They should be fixed,
but to be safe, you should just fully re-connect the device with one of
the above.

also, optimally
  - nmcli device set $DEV managed no
marks the device directly as unmanaged (including removing the
generated profile), without interfering with the external configuration
at all. There might be issues with this as well (meaning: it might
touch the device and destroy some external configuration).


best,
Thomas

Attachment: signature.asc
Description: This is a digitally signed message part



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