After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 660719 - nmcli con down gets immediately reverted on automatic connections
nmcli con down gets immediately reverted on automatic connections
Status: RESOLVED NOTABUG
Product: NetworkManager
Classification: Platform
Component: nmcli
0.8.x
Other Linux
: Normal normal
: ---
Assigned To: Dan Williams
Dan Williams
Depends on:
Blocks:
 
 
Reported: 2011-10-02 21:12 UTC by Forest
Modified: 2013-05-02 15:59 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Forest 2011-10-02 21:12:49 UTC
Running nmcli con down id my-connection-name doesn't work properly when a connection is configured to "connect automatically".  The connection comes down for only a second, then goes back up again.

Bringing the same connection down via nm-applet works as expected.
Comment 1 Jiri Klimes 2011-10-12 10:33:06 UTC
That's expected behaviour.
There are two ways how to disconnect via NM D-Bus API [1]:
* DeactivateConnection() method on org.freedesktop.NetworkManager
* Disconnect()           method on org.freedesktop.NetworkManager.Device

DeactivateConnection() doesn't prevent from auto-connecting again
Disconnect()           prevents from auto-activation  

'nmcli con down id "blah"' makes use of DeactivateConnection()

'nmcli dev disconnect iface wlan0'  make use of Disconnect() and thus do what you want

[1] http://projects.gnome.org/NetworkManager/developers/migrating-to-09/spec.html
Comment 2 Forest 2011-10-12 15:44:27 UTC
> 'nmcli dev disconnect iface wlan0'  make use of Disconnect() and thus do what
> you want

Thanks for the clarification.  Is there a symmetrical "connect" command that works with an iface argument?
Comment 3 Jiri Klimes 2011-10-13 06:40:55 UTC
(In reply to comment #2)
> > 'nmcli dev disconnect iface wlan0'  make use of Disconnect() and thus do what
> > you want
> 
> Thanks for the clarification.  Is there a symmetrical "connect" command that
> works with an iface argument?

No. And there's no need for it. You have to say what connection (parameters) you want to use. However, you *can* specify interface to 'con up' command:
nmcli con up id <id> | uuid <id> [iface <iface>] [ap <BSSID>] [--nowait] [--timeout <timeout>]

See 'man nmcli'
Comment 4 Andrew Pimlott 2012-08-03 00:17:58 UTC
This still leaves a gap in functionality.  If a device is disconnected, NetworkManager still listens for events (eg. carrier sense) on the device, and when it gets one it deactivates the device.  If I have configured an IP address for the device, NetworkManager clears it.  So I have no way to get NetworkManager to leave the interface entirely alone.  (Unless I delete the connection; but then there is no easy way to get it back.)
Comment 5 Dan Winship 2013-05-02 15:59:30 UTC
NM bugzilla reorganization... sorry for the bug spam.