In a recent tutorial, I showed you how to use Wi-Fi on your Raspberry Pi (with 5 different solutions)
Here, I will show you the opposite 🙂
That’s to say, how to disable your Wi-Fi adapter to use only the Ethernet cable
How to disable Wi-Fi on Raspberry Pi?
Wi-Fi is not necessary when you always use your Raspberry Pi connected with an Ethernet cable
The easiest way is to turn it off manually with
sudo ifconfig wlan0 down
But it’s not permanent, and there are many other solutions to do this
In this post, I will show you 7 ways to disable your Wi-Fi forever (until you reverse your changes)
Most of them will work on any operating system, but I only tested on Raspbian
By the way, if you are really interested in improving your skills on Raspberry Pi, I highly recommend to check out my e-book here. It’s a 30-days challenge from beginner to master, with step-by-step tutorials and many projects to practice along the way.
1 : Crontab
If you are lost in all these new words and abbreviations, request my free Raspberry Pi glossary here (PDF format)!
As I already showed you half of the first solution, I will start with this one
In introduction, I gave you one command to disable temporarily your Wi-Fi interface
Here is one way to disable it automatically at each reboot:
- If you are on Raspbian Desktop, start by opening a terminal
(or jump to the next solution, easier for you)
- Then open the crontab in edit mode:
sudo crontab -e
Crontab is something like a tool to configure scheduled tasks, you can learn more here about Linux crons
When you use
sudo crontabinstead of
crontab, you are scheduling the tasks for the root user
- If it’s the first time you do this, select your favorite text editor
Press enter to stay with nano
- In the crontab file, add the following line at the end:
@reboot ifconfig wlan0 down
- Save and exit (CTRL+O and CTRL+X with nano)
Your Wi-Fi adapter will now stop directly at each boot, so you are sure to use the Ethernet cable all the time
To bring the Wi-Fi up again (temporarily), use:
sudo ifconfig wlan0 up
Or remove the line in the crontab to enable it at each boot
A bit lost in the Linux command line? Check this article first, which will give you the most important commands to remember, and a free cheat sheet you can download to have the commands at your fingertips.
2 : Raspbian Desktop
Most of my solutions here are for Raspbian Lite
If you are on Raspbian Desktop, there is an easy way to disable the Wi-Fi adapter:
- On the right top bar (near the clock), find the Wi-Fi icon
- Click on it (left click)
- A menu like this shows up:
- Click on “Turn Off WiFi” to disable it
You need to do this after each reboot, but it’s as easy as this
I didn’t find any permanent way on Raspbian Desktop
If you need help getting started on Raspberry Pi, I have an entire course to guide you through your first steps. I’ll help you use the perfect hardware, plug everything in and install your first system. You’ll also do your first project with me, just to make sure you are ready for the next level. Get all the information on this page if you are interested.
3 : Raspi blacklist
The third way to disable Wi-Fi on your Raspberry Pi is more extreme
On Debian, as on many other distributions, modprobe is a program that load kernel modules on boot
You can choose to disable some modules, like the Wi-Fi drivers for your Raspberry Pi:
- In a terminal, open the following file:
sudo nano /etc/modprobe.d/raspi-blacklist.conf
- Paste these two lines in it (the file is probably empty):
- Save and exit (CTRL+O, CTRL+X)
Then reboot your Raspberry Pi (with an Ethernet cable plugged), and you will not see the Wi-Fi adapter on the next boot
Remove the two lines from the file to reactivate it
4 : Config.txt
Another method you can try, is to edit the Raspbian configuration file
The good news is that you can even do this on a fresh Raspbian SD card, to disable the Wi-Fi directly
Here is how to do this:
- You can open a terminal, connect via SSH, or edit the file directly on the SD card from your computer
- Open the config.txt file with nano:
sudo nano /boot/config.txt
- Find the following line:
# Additional overlays and parameters are documented /boot/overlays/README
- And add these two lines under it:
The second line is for the Bluetooth module
- Save and exit (CTRL+O, CTRL+X)
- Reboot your Raspberry Pi to check if everything work as expected
Note: on older Raspbian versions, you need to add pi3 at the beginning, like this:
5 : Modprobe
This one is almost the same as the blacklist solution, but it’s a temporary one
You can use modprobe as a command instead of editing the configuration file
Here is the command (use this in a terminal if you are on Raspbian Desktop):
sudo modprobe -rv brcmfmac
This command will also remove brcmutil and cfg80211 automatically
To bring back the Wi-Fi adapter, use this one:
sudo modprobe brcmfmac
If the first solution didn’t work for you, you can also use this command in a crontab to do it automatically on boot
6 : RFKill
RFKill is command line tool to query, enable or disable radio transmitters on a system
That’s exactly what we want to do, so we can use RFKill to disable our Wi-Fi adapter
RFKill is available directly on any Raspbian version
Here is how to do this:
- Open a terminal and enter the following commands:
sudo rfkill block wifi
sudo rfkill block bluetooth
- This should disable your Wi-Fi and Bluetooth cards directly
The block command is persistent after a reboot
To enable Wi-Fi or Bluetooth, use the
unblock command like this:
sudo rfkill unblock wifi
sudo rfkill unblock bluetooth
7 : Systemctl
Finally, the last solution I want to show you, is to use
systemctl to stop the wireless services
Systemd is the service manager on many Linux distributions, and you can use
systemctl to see and control each service state
Here are the three commands to do to disable all services:
systemctl disable wpa_supplicant
systemctl disable bluetooth
systemctl disable hciuart
Then reboot your Pi to apply the changes
Use the “enable” command to use the Wi-Fi again
Note: This is not working on my Pi 4 with Raspbian Buster, but I have seen these commands many times, and I’m sure to have used them in the past, so it’s probably working on Stretch or other Raspberry Pi models
I give it to you as a last chance if everything else is not working for you 🙂
Tips to improve your network speed
One of the reasons you might be reading this tutorial, is if you have network issues, like disconnections or low speed.
Here are a few other things you can try to solve this:
- Use a Raspberry Pi 4 : The previous Raspberry Pi models didn’t include a gigabit Ethernet port (even the Raspberry Pi 3B+ is limited to 300MB max). By using a recent model, you can really improve your network speed for projects where it’s essential.
- Use a better switch : If you have an old router that provides the Internet connection, it may not be the best solution for a fast network between your computer and your Raspberry Pi. Adding a faster switch, with 1GB Ethernet ports on it will improve your transfer rates.
- Replace the Ethernet cables : Maybe not the more efficient solution, but definitely the cheapest one. I’m using the same Ethernet cables for years, but new ones are better and better, and if you have a 20 years old cable that you replace by a new one, it may be enough to improve the network speed (and solve most of the disconnections by the way).
Grab your free PDF file with all the commands you need to know on Raspberry Pi!
That’s it! I think we have seen most of the solutions available
I hope you found one that works for you, and that this post was helpful
If you have any other idea to do the same thing, feel free to leave a comment below.
And to conclude, here are a few related tutorials that might be useful next:
- 15 Easy Projects for Raspberry Pi Beginners (With Links)
- Install Webmin and configure your system without any command
- How to Login as Root on Raspberry Pi OS?
If you have any comment, suggestion or just want to chat with us about this tutorial,
you can post your messages in the community on Patreon. See you there!
Raspberry Pi Resources
Not sure where to start?
Understand everything about the Raspberry Pi, stop searching for help all the time, and finally enjoy completing your projects.
Watch the Raspberry Pi Bootcamp course now
Master your Raspberry Pi in 30 days
Don’t want the basic stuff only? If you are looking for the best tips to become an expert on Raspberry Pi, this book is for you. Learn useful Linux skills and practice multiples projects with step-by-step guides.
Download the e-book
If you just want to hang out with me and show your support, you can also join the Patreon community. I share behind-the-scenes content there and give you early access to my content. You’ll also get a shoutout when you join.
More details here
Need help to build something with Python?
Create, understand and improve any Python script for your Raspberry Pi.
Learn the essentials, step-by-step, without losing time understanding useless concepts.
Get the e-book now
You can also find all my recommendations for tools and hardware on this page.