Check if NetworkManager allows disabling the autoconnect parameter by default
See parent ticket for the rationale.
#1 Updated by BitingBird 2015-01-03 04:12:56
nmcli dev disconnect iface em2
disconnects a connection on interface em2 and marks the device
as unavailable for auto‐connecting. That’s why no connection
will automatically be activated on the device until the device’s
“autoconnect” is set to TRUE or user manually activates a
#2 Updated by geb 2020-05-12 19:14:45
- Status changed from Confirmed to Resolved
Unfortunately the proposed solution do not work is the device is not currently connected :
<code> $ nmcli dev disconnect wlan0 Error: Device 'wlan0' (/org/freedesktop/NetworkManager/Devices/3) disconnecting failed: This device is not active Error: not all devices disconnected. </code>
Setting the device autoconnect property to no, seems a better option.
<code> $ nmcli device set wlan0 autoconnect no </code>
As of Network Manager 1.14.6 (2020 Q2), I did not found any other solution to acheive that. This parameter cannot be set in configuration. More details on Bug #7165.