Use rfkill to Enable/Disable Wireless on your Linux Laptop

This notebook computer is connected to a wirel…

Imagine a situation when you have to book an air/train ticket in a jiffy, or check an important mail quickly and the only option you have is a wi-fi connection from either your smart phone or surroundings, and you have only some Linux variant installed on your system. And even after installing all the necessary drivers, you are unable to get the wi-fi on your laptop working? Frustrating right? If yes, then you might want to read on about this useful utility called rfkill which you can keep in handy for those weary situations.

I own a Dell Studio XPS 1645 and have always found it cumbersome to get the wi-fi working on my system, mainly during those geek/hacker meetups, the only times I have to use wireless Internet. I remember randomly switching wireless on and off through the hardware switch and rebooting my system multiple times in order to get it working. Well, this was the situation until I discovered rfkill - a tool for enabling and disabling wireless devices including Wireless LAN, Bluetooth, etc. Here follows a tutorial on how to use it (fire up the Terminal before proceeding):

rfkill’s_ list_ command lets you see all the available devices, if you don’t find any of your devices, make sure you have turned the hardware switch ON and have installed the drivers for each. Here is what I get on my system after enabling the hardware switch:

kartik@PlatiniumLight ~ $ rfkill list
0: brcmwl-0: Wireless LAN
Soft blocked: yes
Hard blocked: no
1: dell-wifi: Wireless LAN
Soft blocked: yes
Hard blocked: no
2: dell-wwan: Wireless WAN
Soft blocked: yes
Hard blocked: yes
3: hci0: Bluetooth
Soft blocked: no
Hard blocked: no
kartik@PlatiniumLight ~ $

Apart from Bluetooth, I usually find all other devices to be in a random state of yes or no. To enable them, issue the unblock command as shown:

kartik@PlatiniumLight ~ $ rfkill unblock 0
kartik@PlatiniumLight ~ $ rfkill unblock 1
kartik@PlatiniumLight ~ $ rfkill unblock 2
kartik@PlatiniumLight ~ $ rfkill list
0: brcmwl-0: Wireless LAN
Soft blocked: no
Hard blocked: yes
1: dell-wifi: Wireless LAN
Soft blocked: no
Hard blocked: no
2: dell-wwan: Wireless WAN
Soft blocked: no
Hard blocked: no
3: hci0: Bluetooth
Soft blocked: no
Hard blocked: no
kartik@PlatiniumLight ~ $

You can also try using the unblock all command for enabling all the devices together:

kartik@PlatiniumLight ~ $ rfkill unblock all

Sometimes it happens that even after unblocking once, some device(s) may show up as blocked (see the 0th device above, which shows hard blocked as yes). To correct this just issue the unblock command again for that particular device:

kartik@PlatiniumLight ~ $ rfkill unblock 0
kartik@PlatiniumLight ~ $ rfkill list
0: brcmwl-0: Wireless LAN
Soft blocked: no
Hard blocked: no
1: dell-wifi: Wireless LAN
Soft blocked: no
Hard blocked: no
2: dell-wwan: Wireless WAN
Soft blocked: no
Hard blocked: no
3: hci0: Bluetooth
Soft blocked: no
Hard blocked: no
kartik@PlatiniumLight ~ $

When you get all the devices unblocked, you will not face any trouble connecting to wi-fi devices around. :-)

Bonus Tip: If you have a common hardware switch for wireless radios, you can turn off additional devices like Bluetooth (or vice versa) to save some battery life using the block command of rfkill:

kartik@PlatiniumLight ~ $ rfkill block 3
kartik@PlatiniumLight ~ $ rfkill list
0: dell-wifi: Wireless LAN
Soft blocked: no
Hard blocked: no
1: dell-wwan: Wireless WAN
Soft blocked: no
Hard blocked: no
2: brcmwl-0: Wireless LAN
Soft blocked: no
Hard blocked: no
3: hci0: Bluetooth
Soft blocked: yes
Hard blocked: no
kartik@PlatiniumLight ~ $

Stay Dignified!

  • Kartik

Originally published at http://www.digimantra.com/linux/rfkill-enabledisable-wireless-linux-laptop/

Posted with tags Bluetooth commands Data Communications dell gnu/linux Hardware Informative laptop Linux Smartphone terminal ubuntu Wi-Fi Wireless Wireless LAN xps