1

I am on Precise.
I used this command (with an alias), to close the network,

dbus-send --system --print-reply --reply-timeout=120000 --type=method_call --dest=org.freedesktop.NetworkManager /org/freedesktop/NetworkManager org.freedesktop.NetworkManager stop

it worked, now I have to use

dbus-send --system --print-reply --reply-timeout=120000 --type=method_call --dest=org.freedesktop.NetworkManager /org/freedesktop/NetworkManager org.freedesktop.NetworkManager.Sleep boolean:true

it work but not so well, sometimes I can't restart the network and NetworkManager is blocked too and strange errors even GUI freeze . What I need is a command line which close the network and don't mess with Network Manager, maybe with the routing table or what else.

1 Answer 1

0

I'd be looking at nmcli for toggling network connectivity. You can do that globally through:

nmcli n enable false  # turns it all off
nmcli n enable true   # turns it all back on
2
  • Big thank, I couldn't dream of a so direct, perfect and simple solution. Jun 9, 2014 at 9:56
  • It learn me that the good command was certainly dbus-send --system --print-reply --reply-timeout=120000 --type=method_call --dest=org.freedesktop.NetworkManager /org/freedesktop/NetworkManager org.freedesktop.NetworkManager.Enable boolean:false .Anyway, nmcli even better. Jun 9, 2014 at 10:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .