Re: NetworkManager behavior answers not found in docs



On 10/18/2018 11:30 PM, Thomas Haller wrote:
Btw, note that if you configure the device as unmanaged via
NM_CONTROLLED=no in ifcfg, then the device cannot be set to managed.
This way of unmanaging a device is definite,

Hello again, another use case I'm still wrapping my head around (even with the precious knowledge acquired thanks to your help!)

Let's say I've got this setup :

- eth0 NM_CONTROLLED=no
- eth1 NM_UNMANAGED=1 via udev
(and suppose eth1 in no-auto-default.state)

here's what I'm testing

- about NM_CONTROLLED=no :

# nmcli connection show
NAME  UUID  TYPE  DEVICE

# nmcli -f GENERAL.DEVICE,GENERAL.STATE device show
GENERAL.DEVICE:                         eth0
GENERAL.STATE:                          10 (unmanaged)

GENERAL.DEVICE:                         eth1
GENERAL.STATE:                          10 (unmanaged)

GENERAL.DEVICE:                         lo
GENERAL.STATE:                          10 (unmanaged)

# nmcli device set eth0 managed yes
# echo $?
0
# nmcli -f GENERAL.DEVICE,GENERAL.STATE device show
GENERAL.DEVICE:                         eth0
GENERAL.STATE:                          10 (unmanaged)

-> as you explained, unmanaging a device this way is definite, but is the 0 return value legit here ?


- about the following sentence in man regarding NM_UNMANAGED :

"You will still be able to attach a connection to the
device manually or observe externally added configuration such as addresses or routes."

# nmcli device set eth1 managed yes
# echo $?
0
# nmcli -f GENERAL.DEVICE,GENERAL.STATE device show
GENERAL.DEVICE:                         eth1
GENERAL.STATE:                          20 (unavailable)

-> it's not unmanaged anymore, so it's managed

# nmcli connection show
NAME  UUID  TYPE  DEVICE

-> still no connection, seems normal to me

# nmcli device connect eth1
Error: Failed to add/activate new connection: Connection 'eth1' is not available on the device eth1 at this time.

-> ok, seems normal to as well since auto profile creation must not work under NM_UNMANAGED conditions

# nmcli connection add type ethernet con-name managed-eth1 ifname eth1
Connection 'managed-eth1' (41727fca-d424-40d9-91e7-55197ff9a962) successfully added.

# nmcli connection show
NAME          UUID                                  TYPE      DEVICE
managed-eth1  41727fca-d424-40d9-91e7-55197ff9a962  ethernet  --

-> ok I managed to create a connection somehow linked to eth1 device. It's not active which also seems normal to me

But then I cannon neither connect the eth1 device nor activate the newly created profile

-> what's happening here ?

Thanks

--
Thomas H.






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