I want to disable the on-board wlan on my RPI3 (Raspbian) upon startup using:

ifconfig wlan0 down

It works on the command line, but when I put it in /etc/rc.local, as it was suggested here, it has no effect.

I checked that rc.local is indeed executed and wlan0 is reported as present.

Why is it not working and what would be the correct place to do it?

3 Answers 3


You can actually set up a cronjob to do it.

sudo crontab -e

add this:

@reboot ifconfig wlan0 down

This cronjob will run every time the system boot.

This is not the most optimal solution, but it does what it is supposed to do. It is also very easy to remove :)

  • 2
    Indeed it works. But it leaves the question open, why the operation in rc.local has no effect.
    – MiB_Coder
    Dec 11, 2016 at 12:12
  • Do you know of any better solution? This solution is 7 years old. Aug 2 at 23:42
  • You can use rfkill to disable it - rfkill block wifi
    – Orphans
    Aug 17 at 7:26


One request we have had in the past is to be able to shut off WiFi and/or Bluetooth completely, particularly on Pi 3. There are now options in the WiFi and Bluetooth menus to turn off the relevant devices. These work on the Pi 3’s onboard wireless hardware; they should also work on most external WiFi and Bluetooth dongles.


You should execute ifconfig wlan0 down with delay.

For example with delay 10 seconds:

/bin/sleep 10 && ifconfig wlan0 down

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.