Re: NetworkManager behavior answers not found in docs



On Fri, 2018-10-26 at 12:01 +0200, Thomas HUMMEL wrote:
On 10/26/2018 10:05 AM, Thomas Haller wrote:



Ah, there is also `nmcli -f GENERAL.NM-MANAGED device show eth0 `,
but
this just returns (state != "unmanaged").

Wait : what's the diffence (if any) between GENERAL.NM-MANAGED == no
and 
GENERAL.STATE == 10 (unmanaged) ?


There is none:

https://cgit.freedesktop.org/NetworkManager/NetworkManager/tree/src/devices/nm-device.c?id=085b769729e9c623cc60bb0f88df36d1843cd22b#n16346





Optimally, there would be a nother flag which is the opposite of
`nmcli
device set $DEV managed $VALUE`. So, when you issue device-set, it
would succeed and would toggle this flag, but that alone may not be
sufficient to make the device (fully) GENERAL.NM-MANAGED yet.

I don't see what you mean here by "the opposite" : maybe just a flag
to 
reflect the request (and its ack) of the desire to manage the device
?

 I mean, a flag (in NetworkManager public API) that exposes the user's
intent of managing the device. That is, what `nmcli device set $DEV
managed yes` sets.
... which may be slighly different than whether the device is actually
"state != unmanaged".





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

state "unavailable", looks like the device has no cable plugged in
(no
carrier). You'd also see that with `ip link show eth1` saying "NO-
CARRIER".

Well, it's a VMWare virtual interface but 'connected' in VMWare and 
iproute shows :

3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode 
DEFAULT group default qlen 1000
     link/ether 00:50:56:8a:42:bf brd ff:ff:ff:ff:ff:ff

It seems normal to me the device is down since no one as configured
it. 
But it seems I'm in a different case than no carrier'...
Maybe I'm supposed to see a LOWER_DOWN ?

Activation of the created profile then probably fails, because the
device has no carrier (which is required for successful DHCP).

Obviously the reason here is that the device is still unavailable
but 
the question is why ? ;-)

hm, good question. I don't know, I would need to see the level=TRACE
syslog (journal) of NM.

Btw, for hints for getting the logfile see 
https://cgit.freedesktop.org/NetworkManager/NetworkManager/tree/contrib/fedora/rpm/NetworkManager.conf

Generally, there are the device states "unmanaged" -> "unavailable" ->
and "disconnected". For ethernet devices, a device is usually
"unavailable" because it has no carrier.


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]