I've brought down a network interface with ifconfig wlan0 down, but every few hours or so, the wlan0 interface comes back up and I can't figure out why.

I don't restart the machine, never changed /etc/network/interface. I guess my question is, how would I go about just "permanently" disabling wlan0. Do I use /etc/network/interface? I already have ifconfig wlan0 down in my rc.local.

3 Answers 3


Method #1 - from NetworkManager's Applet

Try disabling the wireless networking under the Network Applet that's accessible from under the icons in the upper right of your desktop.

                                                    ss #!

NOTE: The networking applet's icon looks like a triangle wedge. The image above is pointing to is as arrow #1. If you click it you should see a menu slide out from where you can disable wireless permanently, arrow #2.

Method #2 - /etc/network/interfaces

From the file /etc/network/interfaces you can specify that NetworkManager shouldn't control the wlan0 interface. To do so simply add this line to the above mentioned file:

iface wlan0 inet manual

Then restart NetworkManager:

$ sudo service network-manager restart


  • 2
    Method 1 only works if you have only one wifi card...
    – xuhdev
    Jan 8, 2015 at 22:55

I had to do something similar to this but wanted the device to not come up at all. We have physically covered up an ethernet port in a linux based device and so it shouldn't appear at all.

I did this with udev rules.

This udev rule will tell linux to remove the pci device when a network device which has the ID_NET_NAME_ONBOARD of eno2 is added. Add it to e.g. /etc/udev/rules.d/90-disable-eno2.rules.

ACTION=="add", SUBSYSTEM=="net", ENV{ID_NET_NAME_ONBOARD}=="eno2", RUN+="/bin/sh -c 'echo 1 > /sys$DEVPATH/device/remove'"

The magic environment variables like ID_NET_NAME_ONBOARD are set by udev here. I have copied some examples from the comment in that file below.

PCI Ethernet card with firmware index "1":

PCI Ethernet card in hotplug slot with firmware index number:

PCI Ethernet multi-function card with 2 ports:

PCI wlan card:

USB built-in 3G modem:

USB Android phone:

s390 grouped CCW interface:

When testing your rules you will need to run a command like the following to make sure everything is matching and syntax is correct.

# Find the path marked "P" with this command.
udevadm info --path=/sys/class/net/eno2

# Test with this command with the path from above
udevadm test --action="add" /devices/pci0000:00/0000:00:1c.4/0000:03:00.0/net/eno2 2>&1 | less

You can permanently disable a network interface using systemd. For example if you want to disable wlan0:

$ systemctl | grep wlan0
sys-devices-platform-soc-XXX.auto-net-wlan0.device loaded active plugged   /sys/devices/platform/soc/XXX.auto/net/wlan0
sys-subsystem-net-devices-wlan0.device             loaded active plugged   /sys/subsystem/net/devices/wlan0                                                                     
wpa_supplicant@wlan0.service                       loaded active running   WPA supplicant daemon (interface-specific version)                                                   

Next take them one by one, check out what they do:

$ systemctl status wpa_supplicant@wlan0.service
● wpa_supplicant@wlan0.service - WPA supplicant daemon (interface-specific version)
   Loaded: loaded (/lib/systemd/system/wpa_supplicant@.service; disabled; vendor preset: enabled)
   Active: active

Stop and disable them:

$ sudo systemctl stop wpa_supplicant@wlan0.service
$ sudo systemctl disable wpa_supplicant@wlan0.service

Disabling wpa_supplicant@wlan0.service for example will have the effect that the wlan0 interface will not attempt to connect to the wireless network.

  • I think this is the most up to date answer. That is if systemd init is used.
    – 71GA
    Dec 6, 2021 at 10:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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