How do you disable the wireless Internet from the command line?
I tried sudo ifconfig eth1 down
but network-manager seems to ignore this and keeps trying to reactivate it. What's worse is the network-manager widget doesn't let you disable it either once it starting "trying to connect". Whenever I'm near a spotty connection, it just keeps trying and trying to connect, failing each time and showing an annoying error message, "sorry, we couldn't connect".
The command-line equivalent in ubuntu 16.04
To re-enable, use
To help
Enable/disable networking completely
Just for WiFi
On both cases
on
to re-enable.If you need to permanently disable a particular device, then you can do that programatically using the
unmanaged-devices
feature in /etc/NetworkManager/NetworkManager.conf or (at a lower level) by blacklisting or removing the corresponding driver.For older versions than v0.9.10
nm
instead ofnetworking
. Seenmcli
man page.nm
object no longer exists, and the equivalentnm wifi
options are now provided by aradio
object.nmcli
interface changed significantly between v0.9.8 and v0.9.10, and the documentation notes that:In general, simple
...should be enough. Sometimes, wireless card can be shown as
instead of
then you need to double check which ethX to disable and you can do it with
and look for your wireless card entry inside which you will find:
I guess you probably know and your problem is bigger then that but at the same time, probably lots fresh of people will find this topic and this should be enough for them.
A method no one mentioned:
rfkill list
to view wireless/bluethoot devicesrfkill block <device number>
to (soft) block itFirst, install the following package:
Now, turning your WiFi connection on or off will be really simple:
Great! Even more, you can also toggle your WiFi connection:
Tip: You can do the same with your bluetooth device using
bluetooth
command.Causion: Although I know this is an Ubuntu forum, however, a caution for Fedora users: If you install TLP package on Fedora, then you might have issues starting RFKill service during boot process. For more information, see what's RFKill and this related problem.
Warning: Not sure about every possible case, but TLP might slow down your system, and could cause you experience lags and/or freezes. The reason is, it's mainly a package for improving battery life and usage, perhaps by making your processor mode to powersave.
For me, on Ubuntu 15.04
nmcli radio wifi off
worked for turning off wifi. To turn off networking in general (including LAN) I usenmcli networking off
.There is a way to toggle the state of the WiFi connection. It might be useful to know.
nmcli networking off
andnmcli radio wifi off
does not work for me in ubuntu 12.04! The following commands works for me: