This question already has an answer here:

I tried to disable the wireless functions at boottime like Lekensteyn described here: How can I keep a wireless card's radio powered off by default?

But it keeps starting enabled after a reboot!

I added the command to /etc/rc.local by running

sudo nano /etc/rc.local

Used the arrow keys / page up/down keys to navigate to the line before exit 0 and add rfkill block wifi, so that the file end like this:

# By default, this script does nothing

rfkill block wifi
# for debugging:
rfkill list > /tmp/wifi-state.txt

exit 0

Now in /tmp/wifi-state.txt I can see that it was blocked right after the call in rc.local But if I call

rfkill list

on the console, it shows that WiFi is enabled again:

0: phy0: Wireless LAN
    Soft blocked: no
    Hard blocked: no
1: hci0: Bluetooth
    Soft blocked: yes
    Hard blocked: no

Additional info: I added this to disable bluetooth it works fine:

rfkill block bluetooth


sudo rfkill block wifi

works fine on the console

marked as duplicate by Lekensteyn, Eric Carvalho, karel, Panther, LnxSlck Jul 2 '14 at 17:03

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • @Lekensteyn that question is referred to in this question and the solutions given don't work for this user so it's not a duplicate. – Warren Hill Jul 2 '14 at 13:00
  • 1
    @WarrenHill The accepted solution worked for older versions, but not for newer ones. The answer is being improved and at the end of day, the question is still a duplicate even if the answer did not work. If you want to, you can join the chat to discuss it further: chat.stackexchange.com/rooms/15479/… – Lekensteyn Jul 2 '14 at 13:07
  • @Lekensteyn - I have added the solution that works on newer versions with systemd. Check it - askubuntu.com/questions/24171/… – Manoj Sawai Feb 10 '17 at 21:25

You can try to use ifconfig instead...

Add the following to rc.local

$> ifconfig wlan0 down

If you suspend/hibernate your computer the you will have to add the same to the suspend process as well.

Create a file by

$> sudo nano /etc/pm/sleep.d/20_custom_wlan0

add the following to the file.

# Script to disable wlan0 before suspend and restart after wake.
case "${1}" in
                echo suspending wlan0
               echo Resuming wlan0 - shutting down wlan0
               ifconfig wlan0 down

save the file and make sure is executable by

$> sudo nano /etc/pm/sleep.d/20_custom_wlan0

That should do the trick.

By the way the name of the filename doesn't matter so much except it must start with something below 60 as number decide where in the process the file is run. And some system have 60 staring the network card after suspend. Look in the /etc/pm-suspend.log file.

  • I think that circumvents to inform the network manager applet about the state of wlan0 (at least, if i try that on the console now: sudo ifconfig wlan0 down), so the nm-applet will still show, that you are connected, although you are not – rubo77 Jul 1 '14 at 19:27
  • lets discuss this in chat: chat.stackexchange.com/rooms/15479/… – rubo77 Jul 1 '14 at 19:35

I solved it with this quite "hacky" solution: a sleep 10 delay: It seems like in Ubuntu 14.04 you need to wait some seconds before you disable wifi in /etc/rc.local.

Use this instead:

sudo nano /etc/rc.local

Use the arrow keys / page up/down keys to navigate to the line before exit 0 and add /bin/sleep 10 && rfkill block wifi, so that the file will look like this:

# By default, this script does nothing

/bin/sleep 10 && rfkill block wifi

exit 0

The other solution above suppose to be the cleaner one, but that one doesn't always work...


I solved it (on my Lenovo Yoga 2 Pro) with this solution instead: edit the file

sudo nano /etc/rc.local

and add two lines, so that the file will look like this:

# By default, this script does nothing

# disable wifi:
sed s/^WirelessEnabled=true/WirelessEnabled=false/ -i /var/lib/NetworkManager/NetworkManager.state
rfkill block wifi

exit 0

Note: If you only add the first sed line, it doesn't always work: every now and then my laptop unexpectedly booted with wifi enabled agian, but with both commands it works.

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