This guide will teach you the various methods you can use to disable your Raspberry Pi’s Wi-Fi connection.
There are various reasons why you might want to disable Wi-Fi on your Raspberry Pi.
One of those reasons is to minimize your system usage. While the Wi-Fi module doesn’t consume to much memory and CPU time, it still uses it.
If you are not making use of the Wi-Fi connection, there is no real need to have it enabled on your Raspberry Pi.
Thanks to various tools, this is a fairly straightforward process using both the desktop or terminal interfaces.
To cover all of our bases, we will show a couple of ways of disabling the Wi-Fi, from using rfkill
to modifying the boot configuration file.
Equipment List
Check out the list of the equipment we used when writing this guide on disabling the Raspberry Pi’s Wi-Fi.
Recommended
- Raspberry Pi ( Amazon )
- Micro SD Card ( Amazon )
- Ethernet Cable ( Amazon ) or Wi-Fi ( Amazon )
- Power Supply ( Amazon )
Optional
- Raspberry Pi Case ( Amazon )
- USB Keyboard ( Amazon )
- USB Mouse ( Amazon )
- HDMI Cable ( Amazon )
- Monitor ( Amazon )
When testing this guide, we used the latest version of Raspberry Pi OS (Buster) running on a Pi 4.
Disabling the Wi-Fi using the Raspberry Pi Desktop
This section will show you how to disable your Wi-Fi connection while using the Raspberry Pi OS desktop.
The desktop interface is the simplest way to disable your Wi-Fi as it involves just a couple of clicks.
1. While on your Raspberry Pi’s desktop, locate the Wi-Fi icon in the top-right corner of your screen.
This icon is represented by two arrows, one pointing up, one pointing down. Click this icon to bring up a sub-menu.
2. With the sub-menu up, all you need to do to disable your Wi-Fi is to click the “Turn Off Wireless Lan
” option.
Clicking this option will immediately disable your Wi-Fi connection.
3. You should now have successfully turned off your Wi-Fi connection.
If it still hasn’t been disabled for some reason, be sure to read on for some of our other methods. At least one of these should work correctly.
Disabling the Wi-Fi Connection using rfkill
This section will show you how you can use the rfkill package to disable your Raspberry Pi’s Wi-Fi.
This package was designed to disable wireless connections running from your device easily. These wireless connections include both Bluetooth and Wi-Fi.
1. Even though rfkill
should be included with your distribution, we should make sure it is installed to our system.
First, we need to update our package list and upgrade any existing packages.
sudo apt update
sudo apt full-upgrade
2. With the update completed, we can ensure rfkill
is installed by running the following command.
sudo apt install rfkill
3. With rfkill
installed, you can easily use it to disable the Wi-Fi interface on your Raspberry Pi.
All you need to do is enter the following command, where we are using rfkill
‘s block command followed by “wifi
“.
sudo rfkill block wifi
You can also use rfkill to disable your Bluetooth connection as well.
sudo rfkill block bluetooth
4. Your Wi-Fi connection on your Raspberry Pi should now be successfully disabled.
If you ever want to restore the functionality to your connection, you can run the following command.
sudo rfkill unblock wifi
Modifying the Boot Config to Disable Wi-Fi
In this section, we will be modifying the Raspberry Pi’s boot configuration file.
By modifying this file, we will be able to disable the Wi-Fi connection during the start-up sequence.
1. If you are editing this file on your Raspberry Pi, you can do so by running the following command.
To edit this file, we will use nano as it is one of the easiest terminal-based text-editors to use.
You can also edit this file when the SD card is plugged into another device. The file will be available on the partition that is named “boot
“.
sudo nano /boot/config.txt
2. Within this section, find the following block of text.
You can use the CTRL + W shortcut to search the text file when using nano.
[all]
3. Below this text, you need to add the following lines.
This line tells the system that it needs to disable the Raspberry Pi’s Wi-Fi module.
dtoverlay=disable-wifi
You can also use this file to disable the Bluetooth module by adding the following line.
dtoverlay=disable-bt
4. You can now save the changes to the configuration file.
If you are doing this on your Raspberry Pi, save the file by pressing CTRL + X, then Y, followed by the ENTER key.
5. For this change to take effect, you will need to restart your Raspberry Pi.
To safely reboot the device, you can use the following command.
sudo reboot
Blocking Wi-Fi using the Modprobe Blacklist
Modprobe is a special piece of software used to load kernel modules into the Linux kernel itself.
We can use a feature of modprobe
to block it from loading in the kernel modules used for the Wi-Fi or Bluetooth connections.
1. On your Raspberry Pi, run the following command to edit the “raspi-blacklist.conf
” file.
The modprobe
software automatically reads in this config file.
sudo nano /etc/modprobe.d/raspi-blacklist.conf
2. Within this file, we can add the following two lines to the bottom of it to disable the Wi-Fi kernel modules from being loaded in.
All this does is tells modprobe
that it can’t load in the kernel modules starting with the specified name.
blacklist brcmfmac
blacklist brcmutil
If you would like to disable the Bluetooth module from loading, you can add the following lines.
blacklist hci_uart
blacklist btbcm
blacklist btintel
blacklist rfcom
blacklist btqca
blacklist btsdio
blacklist bluetooth
3. Once you have the blacklist lines added to the file, you can save it by pressing CTRL + X, then Y, and ENTER.
4. For the changes to take effect, you will need to restart your Raspberry Pi.
To restart your Pi use the following command.
sudo reboot
Hopefully, by the end of this guide, you will have an idea of how to disable the Wi-Fi on your Raspberry Pi.
If you have run into any issues with this guide, feel free to leave a comment below.
Thank you, modprobe blacklist worked when all else failed.
thank u for this.. could not get it to stop showing after a reboot but its working now.