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.

4 Answers 4


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
    Commented 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
  • Used lshw to determine the network interface logical name as ens32 and from udevadm info --path=/sys/class/net/ens32 determined ID_NET_NAME_SLOT environment variable and used that as in your answer. Worked. +1
    – rusty
    Commented Jan 13, 2023 at 6:10

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                                                                     
[email protected]                       loaded active running   WPA supplicant daemon (interface-specific version)                                                   

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

$ systemctl status [email protected][email protected] - WPA supplicant daemon (interface-specific version)
   Loaded: loaded (/lib/systemd/system/[email protected]; disabled; vendor preset: enabled)
   Active: active

Stop and disable them:

$ sudo systemctl stop [email protected]
$ sudo systemctl disable [email protected]

Disabling [email protected] 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
    Commented Dec 6, 2021 at 10:02
  • even on the pi, where systemd is used, this doesn't work :-(
    – Sam
    Commented Oct 29, 2022 at 5:54

You could also consider blacklisting the network controller from loading:

  1. Find the ethernet controller: lspci -k
  2. Note the module name and append to the blacklist file: echo blacklist [module-name] >> /etc/modprobe.d/blacklist.conf
  3. Run update-initramfs -u
  4. Reboot to apply changes.

This will stop the system from loading the network card, but please keep in mind that it will disable all network controllers that use the same driver.

To undo this, simply comment or remove the entries and run step 3 and 4 again.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .