How to Enable and Disable Wireless Device in Linux via Command Line

Posted on

This article shows how to display and manage wireless device. Specifically in the manual page, it is actually a tool which is used for enabling and disabling wireless device. It is done by executing a specific command which is executed in the command line interface furthermore in the operating system with the Linux flavored.

But before on to that, in the context of enabling or disabling wireless device, just check the status of the wireless device as shown below :

rfkill list

Below is the command executed in the real situation as follows :

user@hostname:~# rfkill list
0: hci0: Bluetooth
Soft blocked: no
Hard blocked: no
1: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no
user@hostname:~#

Above output generated after executing the command ‘rfkill list’ actually is displaying the list of available wireless device exist in the workstation, either it is a PC or a laptop or any device installed with Linux operating system. The available wireless device is a bluetooth device and also the wireless LAN device.

Based on the output itself, it can be summarized that those devices are not blocked or it is currently active. So, those devices can be utilized further. For enabling or disabling those devices, the term of it are more like blocking or unblocking those devices in the context of this command usage, the ‘rfkill’ command. Below is the sequence of command execution of ‘rfkill’ for demonstrating on how to block and unblock the available wireless device listed :

user@hostname:~# rfkill block 0
user@hostname:~# rfkill list
0: hci0: Bluetooth
        Soft blocked: yes
        Hard blocked: no
1: phy0: Wireless LAN
        Soft blocked: no
        Hard blocked: no
user@hostname:~#

The above output generated is the command for blocking the wireless device. The wireless device blocked above is the one listed in the first represented with the index of 0.

user@hostname:~# rfkill block 0
user@hostname:~# rfkill list
0: hci0: Bluetooth
        Soft blocked: yes
        Hard blocked: no
1: phy0: Wireless LAN
        Soft blocked: no
        Hard blocked: no
user@hostname:~#

So, to enable it back, the following is the actual command :

user@hostname:~# rfkill unblock 0
user@hostname:~# rfkill list
0: hci0: Bluetooth
        Soft blocked: no
        Hard blocked: no
1: phy0: Wireless LAN
        Soft blocked: no                                                                                                                                                                     
        Hard blocked: no                                                                                                                                                                     
user@hostname:~# 

The above output generated is actually for unblocking the wireless device.

 

Leave a Reply