Ubuntu turn off wifi

EnismanY / linux_wifi.md

This provides details including, frequency of WiFi, BSSID, SSID, encryption (for WPA2-PSK, should see pairwise_cipher and group_cipher are CCMP ) MAC address and IP address.

There are several options for turning off WiFi, what works will be dependent on how the system is configured. Assuming the WiFi interface is wlan0 , options are:

sudo ip link set wlan0 down 

    First list all devices using:

0: phy0: Wireless LAN Soft blocked: no Hard blocked: no 1: hci0: Bluetooth Soft blocked: no Hard blocked: no 

Again, there are multiple options:

sudo ip link set wlan0 up 

Alternatively, assuming the number of the device has been ascertained using rfkill list ( 0 in the example below) execute:

Display information about the WiFi interface

Assuming WiFi interface is wlan0 :

Finding WiFi link quality & signal level

iwconfig wlan0 | grep -i --color "Quality\|Signal" 

The numbers reported for quality will be WiFi driver dependent.

Continous update of link quality

The file /proc/net/wireless contains information about the WiFi signal. This can be viewed continually using a combination of the cat and watch commands.

watch -n 1 cat /proc/net/wireless 

Alternatively, the ncurses-based monitoring application wavemon can be used. This will likely need installing, which in Debian based distributions can be achieved using:

To use the application simply run:

Setting a prefered WiFi band

It is possible to set a preferred WiFi band, ie 2.5 or 5 GHz. This may be desirable to avoid interference from other devices or to improve range/speed. Remember, 2.5 GHz has the better range and 5 GHz the better speed.

First check the network interface is capable of using both bands. There are at least two methods to determine this.

sudo iwlist wlan0 scan | grep -i "Frequency\|Address\|ESSID" 

THe output will be similar to:

Cell 01 - Address: ab:12:cd:34:ef:56 Frequency:2.412 GHz ESSID:"DESIRED SSID" Cell 02 - Address: gh:78:ij:90:kl:12 Frequency:5.70 GHz ESSID:"DESIRED SSID" . 
iw list | grep -i "Frequencies\|MHz\|GHz" 

In the output look for the section(s) entitles Frequencies, which will be similar to:

Frequencies: * 5180 MHz [36] (22.0 dBm) (no IR) * 5200 MHz [40] (22.0 dBm) (no IR) * 5220 MHz [44] (22.0 dBm) (no IR) * 5240 MHz [48] (22.0 dBm) (no IR) . 

The frequencies are the centre of the band.

Both the SSID and BSSID are required, the BSSID is the MAC address for a particular band of the access point. To obtain this information, enter the wpa command line interface by running the following, where wlan0 is the name of the wireless network interface:

Once in the iteractive mode, indicated by:

run the following two commands, letting the first command complete execution (indicated by a return of the > prompt) before running the second.

The output will be similar to:

bssid / frequency / signal level / flags / ssid ab:12:cd:34:ef:56 2412 -79 [WPA2-PSK-CCMP][WPA2-PSK-CCMP][ESS] DESIRED SSID gh:78:ij:90:kl:12 5700 -84 [WPA2-PSK-CCMP][WPA2-PSK-CCMP][ESS] DESIRED SSID . 

This shows the desired SSID and the frequencies, 2.5 and 5 GHz, along with their respective BSSIDs.

Quit the interactive mode by entering q .

Читайте также:  Wifi система keenetic extra

To modify the settings

Kill network-manager and wpa_supplicant:

sudo service network-manager stop && sudo killall wpa_supplicant 

On the Raspberry Pi (August 2020) networking this can be achieved using:

sudo service networking stop && sudo killall wpa_supplicant 

If /etc/wpa_supplicant.conf does not exist, create the file using:

sudo wpa_passphrase > /etc/wpa_supplicant 

must be replaced with the SSID of the WiFi network. A blank prompt will be received awaiting the user to enter the password for the WiFi. Once this has been done edit the file using:

sudo nano /etc/wpa_supplicant.conf 

Add the following to the file.

ctrl_interface=/var/run/wpa_supplicant #settings for an AP using preshared keys, PSK network= < ssid=ssid scan_ssid=1 key_mgmt=WPA-PSK #psk==Password psk="Passkey generated by wpa_passphrase" bssid=gh:78:ij:90:kl:12 #the important part >#settings for an open AP. if you use this then don't use the above settings network=

ssid and psk will be those entered when using the wpa_passphrase command.

Delete the commented line containing the password, and ensure the bssid matches that of the access point and the desired band you wish to connect to, ie 2.5 or 5 GHz.

Now start the daemon in the background by running:

sudo wpa_supplicant -B -c /etc/wpa_supplicant/wpa_supplicant.conf -i wlan0 

If this fails, debug problems by running:

sudo wpa_supplicant -c /etc/wpa_supplicant/wpa_supplicant.conf -i wlan0 -d 

Unsure about the dhclient section (next two commands)

After authentication, tell dhclient to release the current lease ie IP address, it has from the server:

Request a dynamic IPv4 address (DHCP):

Finally, reconfigure the interface with:

wpa_cli -i wlan0 reconfigure 

Verify whether WiFi has successfully connected and the correct band is being used by executing:

sudo wpa_cli -i wlan0 status 

If the ip_address is not populated, the device has not connected to the network, check that thr password and ESSID are correct.

Источник

Thread: Turn on / off my WiFi card

Denco1 is offline5 Cups of Ubuntu

Turn on / off my WiFi card

Hello all (new here )
I have notebook Toshiba Satellite L650-1K6 and Ubuntu 10.10 (dualboot with Windows 7).
I have a problem with my WiFi card (BCM4313). I would like to have a chance to turn it on and off everytime I need it. But there is a problem. Till is the WiFi turned on on Windows 7, I can connect to WiFi networks on Ubuntu too. When I disable WiFi on Ubuntu and then enable it again, I can’t see the WiFi networks. I have to restart notebook to see the networks again.
When I turn off WiFi on Windows 7, I can’t connect to WiFi networks on Ubuntu at all (I can’t see them).
I downloaded «Jupiter», but didn’t help. It even doesn’t know about WiFi card.
Is there any chance, that I will be to enable/disable my WiFi everytime I need without any problems?
Thanks for all replies (hope you understand me )

grahammechanical is offlineUbuntu addict and loving it

Join Date Jun 2010 Location London, England Beans 12,356 —> Beans Hidden! Distro Ubuntu Development Release

Re: Turn on / off my WiFi card

It may be possible to turn the WiFi adapter on and off by pressing a combination of keys. Is this possible? If the WiFi is turned off at the keyboard (by hardware) then Ubuntu will not be able to activate it because it is switched off.

As you have found, Windows has the ability to switch off the WiFi adapter. It makes it impossible for Ubuntu to turn it back on. You need to turn WiFi on in Windows before you shutdown. You need to have Wifi switched on at the keyboard before you load Ubuntu.

Читайте также:  Контроллер rain bird esp rzxe6i 6 зон wi fi внутренний

When Ubuntu loads it searches for a working WiFi connection. If the WiFi adapter is switched off it will not find a wireless network to connect to. It is like trying to tune a radio to a certain radio station when the radio is switched off. The wireless adapter is not receiving wireless transmissions from the modem/router and so it does not work under Ubuntu.

How are you disabling WiFi? Are you clicking Enable Wireless? Then try also clicking Enable Networking. This might stimulate network manager to listen for the transmissions from the router.

It is a machine. It is more stupid than we are. It will not stop us from doing stupid things.
Ubuntu user #33,200. Linux user #530,530

Источник

How to disable wireless from command line

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».

8 Answers 8

The command-line equivalent in ubuntu 16.04

nmcli radio help nmcli radio wifi help 

Tried this on Ubuntu 18.10. Not sure if I was too impatient, but looks like I had to throw a «sudo» in there to get it to work: sudo nmcli radio wifi off .

Thanks @Stéphane, on Ubuntu 20.04 this command is silently ignored without sudo . It should fail with an error message.

@Stéphane On Ubuntu 16.04, I had to use sudo because I was connected to the machine through a remote connection (the sudo was needed maybe to prevent a normal user from stopping the wifi). When I logged in locally, it worked fine without using sudo

This does not disable the wireless. It turns it off. Any ideas on how to actually disable it? Do I have to disable the mod for the wifi? cfg80211 710770 3 iwlwifi,mac80211,iwldvm

Enable/disable networking completely

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.

  • Use nm instead of networking . See nmcli man page.
  • Table with differences between nmcli v0.9.8 vs. v0.9.10.
  • The top-level nm object no longer exists, and the equivalent nm wifi options are now provided by a radio object.
  • The nmcli interface changed significantly between v0.9.8 and v0.9.10, and the documentation notes that:

Even if nmcli tries to keep backwards compatibility in general, there were requirements during Networkmanager development that forced some incompatible changes in nmcli. The table bellow list differences between 0.9.8 and 0.9.10.

@MikeSchinkel Right, works well. On the contrast, the nmcli nm wifi off command throws: Error: Object ‘nm’ is unknown, try ‘nmcli help’. Thanks.

. should be enough. Sometimes, wireless card can be shown as

then you need to double check which ethX to disable and you can do it with

Читайте также:  Лучший лазерный принтер wifi

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 devices

rfkill block to (soft) block it

First, 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.

Источник

I want to turn off «Turn off wifi to save power» and «Turn off bluetooth to save power» features in Ubuntu

Okay, so I’m using Ubuntu’s latest LTS version as of 5/Dec/2018, and I have this in the gnome settings app: Settings>Power How do I get these features off, as turning off these buttons just turns off WiFi or Bluetooth, it won’t disable the feature.

  1. How do I keep WiFi and Bluetooth on 24/7?
  2. Also, I would like them to remain on during sleep mode (suspend). How do I do that?

You’re misunderstanding the menu. It’s telling you to turn off WiFi and/or Bluetooth if you want to save power. The gray text is just a hint. The actual label is in black. // In suspend mode, the operating system is not running. Network interfaces are pointless in this state.

The very fact that this question and all comments here exist should be a strong hint that this is just plain terrible UI design. I’ve never once in my life was fooled by the OS like that and that’s coming from a long-time Windows user.

2 Answers 2

These are not «Power saving features» but rather the toggles to disable your WiFi/Bluetooth adapters. The text is simply giving you a tip suggesting that you disable your WiFi/Bluetooth adapters to save power when you are not using them.

There is an answer on Ask Ubuntu in regards to keeping network adapters active during suspend: https://askubuntu.com/questions/1022203/how-to-prevent-wifi-sleep-after-suspend

I had the same misunderstanding as OP. I thought those were power-saving features with a toggle, didn’t realize they want you to manually turn BT/WIFI off there.

The «helpful» explanatory text says «The WiFi can be turned off to save power.» The implication is that the toggle switch enables this characteristic. Nope. The WiFi and Bluetooth toggles just shut off their respective services. This is not at all related to power management over time, so why are these toggles here? It is not helpful to list a general fact unrelated to the function at hand. (Debian 10 Buster; gnome desktop)

Источник

Оцените статью
Adblock
detector