Linux Disable Wireless Networking ( Wi-Fi )

We have over 20+ Dell Precision M6400 laptops pre installed with Red Hat Enterprise Linux version 5.x. I was asked to disable Wi-Fi on all laptops as it poses a serious security risk to our sensitive (classified) systems and networks. How do I disable wireless networking (802.11) under Linux?

You can easily disable Wi-Fi under Linux using the following techniques.

Remove Wireless Hardware

This is the best solution. Find out wireless hardware and if possible remove it. Refer to your laptops’s hardware manual which should contain information on its wireless capabilities. A mini-PCI card is typically accessible via a removable slot of the laptop. Some laptop comes with USB wireless device. Use the following commands to list installed devices (list PCI devices):
# lspci
List usb devices:
# lsusb

Disable Wireless in BIOS

Many laptops includes wireless support via BIOS. You can go to your BIOS setup and disable wireless. Again, read your laptops manual.

Disable Wireless Drivers

cd to /lib/modules/$(uname -r)/kernel/drivers/net/wireless and remove wireless driver. A simple solution as follows should work:
# mkdir -p /root/backup/
# mv /lib/modules/$(uname -r)/kernel/drivers/net/wireless /root/backup/
# reboot

Above will remove the kernel drivers that provide support for wireless devices and it will prevent users from easily activating the devices. Please note that you need to repeat above commands every time the kernel is upgraded.

Deactivate Wireless Interfaces ( Remove Config Files)

You can also deactive the wireless interfaces as normal user can not touch config file without root level access. Open terminal and type the following command to list the wireless interface:
# ifconfig -a
Usually, wireless interfaces may have names like wlan0, ath0, wifi0, or eth0:
Sample Outputs:

eth0      Link encap:Ethernet  HWaddr 00:19:d1:2a:ba:a8  
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback  
          inet addr:  Mask:
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:2475 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2475 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:330752 (330.7 KB)  TX bytes:330752 (330.7 KB)

ppp0      Link encap:Point-to-Point Protocol  
          inet addr:  P-t-P:  Mask:
          RX packets:230 errors:0 dropped:0 overruns:0 frame:0
          TX packets:496 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3 
          RX bytes:37976 (37.9 KB)  TX bytes:47460 (47.4 KB)

wlan0     Link encap:Ethernet  HWaddr 00:1e:2a:47:42:8d  
          inet addr:  Bcast:  Mask:
          inet6 addr: fe80::21e:2aff:fe47:428d/64 Scope:Link
          RX packets:908222 errors:0 dropped:0 overruns:0 frame:0
          TX packets:837085 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:787222721 (787.2 MB)  TX bytes:322049568 (322.0 MB)
          Interrupt:18 Memory:e3000000-e3010000 

Turn of wireless interfaces after identifying the same with ifdown command:
# ifdown interface
# ifdown wlan0

Finally, remove wireless configuration file /etc/sysconfig/network-scripts/ifcfg-interfaceName. In above example you should use interface config file /etc/sysconfig/network-scripts/ifcfg-wlan0:
# mv /etc/sysconfig/network-scripts/ifcfg-wlan0 /root/backup
OR just remove config file, enter:
# rm /etc/sysconfig/network-scripts/ifcfg-wlan0
Above will make sure wlan0 will not return after the next reboot.

How Do I Restore Wi-Fi Again?

Just copy back all files and reboot the system:
# mv /root/backup/ifcfg-wlan0 /etc/sysconfig/network-scripts/ifcfg-wlan0
# mv /root/backup/wireless /lib/modules/$(uname -r)/kernel/drivers/net/wireless
# reboot

A Note About Debian / Ubuntu Systems

You need to edit /etc/network/interfaces file to remove wireless configuration.

You need to remove /lib/modules/$(uname -r)/kernel/drivers/net/wireless directory.

See also:

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 11 comments so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersdf duf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Modern utilitiesbat exa
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg glances gtop jobs killall kill pidof pstree pwdx time vtop
Searchingag grep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
11 comments… add one
  • Peko Jul 10, 2009 @ 10:29

    Hi, Vivek,

    Good topic.

    Would you consider this as a typo? (a copy-paste typo ;-) )
    # rm /etc/sysconfig/network-scripts/ifcfg-wlan0 __/root/backup__

    (you don’t want to have backup here IMNSHO)


  • 🐧 nixCraft Jul 10, 2009 @ 11:05


    Yes, it was a typo from mv command.

    Appreciate your feedback.

  • Rob Haag Jul 10, 2009 @ 14:17

    1st of all: I love the posts…I look forward to them hitting my in-box!

    I like your answer to the problem here, it is useful to know how to disable through the OS and I like the module solution as it would really do the trick…But if I had charge of classified/sensitive devices that had wireless then I would feel compelled to remove the wireless cards from the laptops, as you pointed out, and then one should click the ‘see also’ link above as to deal w/ the possibility of someone trying a USB wireless device.

    What about a firewall solution though? iptables would probably be willing to block everything on a particular interface…or even better, only allow the one interface ( e.g. eth0) to do anything at all.

    Just asking because I’m moving in a direction where I will have to deal w/ these issues too…

    Thanks for all the insight

  • Humberto Massa Jul 10, 2009 @ 14:24

    One more suggestion: blacklist ( /etc/modprobe.d/blacklist ) all wifi hardware. This is better than erasing the drivers because next time you update the kernel (and you _do_ update the kernel from time to time, don’t you? :-D) the drivers will be back.

  • Leslie Satenstein Jul 10, 2009 @ 14:31

    If the user really wants to circumvent all your blockages, I believe that he will be able to.

    He will just use a USB wireless adapter, and voila.

    But if he knows doing so will result in dismissal, you would have more success.

  • Rana Jul 10, 2009 @ 14:40

    @Leslie: there is a link at the bottom of post about disabling USB, RTFM.

  • Go Appa Jul 10, 2009 @ 15:11

    What about Bluetooth ? It does serves a different purpose and possesses a much shorter range, but it still presents serious security risks.

  • 🐧 nixCraft Jul 10, 2009 @ 15:36

    @Go Appa: I’ve update the faq.

    @Humberto, good suggestion or you can write protect wireless directory so that no one can write it including root ;) [hint: chattr command]

    @Rob, Yes, firewall will make it pretty hard, if installed on each laptop. iptables has support option to enable or disable traffic based upon user ID. So user foo can access wifi but not anyone else. Personally, I recommend avoiding the purchase of equipment (wireless add-on modules) that will be used in sensitive spaces and including bluetooth.


  • pramod Jul 12, 2009 @ 1:35

    friends, its working, i have tried it, nice forum. nagpur india

  • Andrew Jun 7, 2012 @ 2:13

    There is also rfkill.

  • Tyler Jun 15, 2016 @ 2:10

    I moved the wlan0 kernel to /root/backup/ like you said. The problem is my mkdir /root/backup/ never got created, despite running the command. Now I’m stuck unable to use with adapter, neither interal or external will show up. Please help me.

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum