103

The built-in Wi-Fi card in my laptop (Dell XPS M1330) is crap, pretty much. I have an Asus USB Wi-Fi card, which is significantly better and works fine.

What I'd like to do is disable the built-in Wi-Fi card.

Is there a way to do this without having to boot into BIOS each time I want to disable/enable the built-in wireless?

Here is the lsusb output:

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 0b05:179d ASUSTek Computer, Inc. 
Bus 002 Device 004: ID 05a9:2640 OmniVision Technologies, Inc. OV2640 Webcam
Bus 007 Device 002: ID 0483:2016 SGS Thomson Microelectronics Fingerprint Reader

And here is the lspci -nnk | grep -iA2 net output:

09:00.0 Ethernet controller [0200]: Broadcom Corporation NetLink BCM5906M Fast Ethernet PCI Express [14e4:1713] (rev 02)
    Subsystem: Dell XPS M1330 [1028:0209]
    Kernel driver in use: tg3
--
0c:00.0 Network controller [0280]: Broadcom Corporation BCM4312 802.11b/g LP-PHY [14e4:4315] (rev 01)
    Subsystem: Dell Wireless 1395 WLAN Mini-Card [1028:000b]
    Kernel driver in use: wl
2
  • Doesn't your laptop have a button to switch wireless on and off?
    – LnxSlck
    Jul 25, 2012 at 16:47
  • 2
    @LnxSlck: Yes, but it disables all wireless capability including the USB wifi card.
    – Matt
    Jul 25, 2012 at 16:59

13 Answers 13

81

Add the following line to /etc/network/interfaces:

iface wlan0 inet manual

NetworkManager doesn't manage interfaces configured in the interfaces file. Replace wlan0 with the interface you want to disable, if it's not the name of the built-in interface.

Then restart network manager:

sudo service network-manager restart
8
  • 5
    @Matt Edit with sudo nano /etc/network/interfaces, add the line, save and exit (Ctrl+O, ENTER, Ctrl+X). Jul 25, 2012 at 18:05
  • 5
    In my case it was wifi0 instead of wlan0 (Lubuntu 16). Check ifconfig for the right device name.
    – Marian
    Jan 2, 2017 at 14:58
  • 5
    Identifying the logical device name can get confusing. ifconfig is absolutely no help in this. Do a sudo lshw -C network to match the plain english descriptions to logical device name. For example, the builtin on my Dell Lattitude running Mint is wlp3s0 and the external wifi (usb) is wlx9cefd5fcd694. Aug 9, 2020 at 18:58
  • 1
    After i did this, my CloudPath utility for connecting to eduroam wifi network did not see the USB wifi adapter. The built in adapter is wlp3s0 which is one of two, the USB being wlxd45d649ce597 so I added iface wlp3s0 inet manual` and the sudo service network-manager restart, Here is the CloudPath utility I am using on Ubuntu 18.04: it.ubc.ca/services/email-voice-internet/… Sep 19, 2020 at 5:02
  • 3
    FYI to all, this answer hasnt been updated since 2016. I couldnt find 'interfaces' in etc/network/ on Xubuntu 20.04. is it because of slight difference in OS or am i missing something else. Only this answer worked for me: askubuntu.com/a/1320155/327339
    – kosf
    Mar 13, 2021 at 17:52
30

I think the easiest way to do this is with ifconfig.
EDIT 2021-03-02: Apparently, if you're still using ifconfig you're living in the past, so have a look at Gabriel's answer below for an ip solution. Read below for the old ifconfig solution.


ifconfig solution:
Run

ifconfig

then look at which adapter you want to turn off, in my case wlan1 is my internal wifi and wlan2 is my usb wifi. Then run

sudo ifconfig wlan1 down

and it will turn off (type ifconfig to check, note that in the network manager the adapter still shows, but it is turned off). To turn it on again:

sudo ifconfig wlan1 up

and that's it.

11
  • How can I find if the adapter I want to disable/enable is wlan1, wlan2 or something else?
    – mmj
    Nov 6, 2015 at 7:49
  • ifconfig will tell you which adapters are there, most likely the lowest number will be your built-in adapter, but I think you should just try it to be sure. Nov 6, 2015 at 10:23
  • 4
    It seems that sudo lshw -C network give a list of items whose 'logical name's are the ones to be used with sudo ifconfig [logical name] up.
    – mmj
    Nov 6, 2015 at 14:15
  • 2
    For me on 16.04 this causes the interface to disappear from ifconfig for a moment, but then it reappears and reconnects soon.
    – BeeOnRope
    Oct 25, 2019 at 2:07
  • 1
    @GabrielStaples Thanks, very useful, I added a link at the top of my answer! Mar 2, 2021 at 7:35
16

To blacklist the module of your wireless card:

  1. sudo vi /etc/modprobe.d/blacklist.conf (or create a custom one)
  2. Uncomment the module name that has a # in the beginning of the line:

    blacklist eth1394
    
  3. Save, run sudo update-initramfs -u and reboot

To remove a module manually without rebooting:

sudo modprobe -r eth1394

Looses effect after reboot.

To load the module:

sudo modprobe eth1394

To see modules loaded:

sudo lsmod
5
  • 3
    If you wanted to blacklist eth1394 woudln't you uncomment the line or add a new line ? Otherwise this is what I needed thanks!
    – zayquan
    Feb 3, 2015 at 23:35
  • 1
    For me this is the right solution. I'm on MX Linux and was confused, because doing sudo ifconfig wlan0 down sets the interface down only for a few minutes, when checking back with ifconfig the interfaces was up again. So I added blacklist iwlwifi to my /etc/modprobe.d/blacklist.conf and that's it. Btw. I don't need wifi at all.
    – Joey
    Feb 22, 2020 at 22:39
  • @zayquan Thanks, not sure how i missed that
    – LnxSlck
    Feb 24, 2020 at 9:38
  • Did this and they still both appear. Btw, does having the default original wifi card connect to the same wifi network as my superfast usb wifi adapter slow down the overall speed? Sep 23, 2020 at 2:41
  • lsmod command doesn't require sudo. At least in Linux Mint 20. Sep 7, 2021 at 21:17
13

This answer has been tested and works (at a minimum) on Ubuntu 20.04 with my BrosTrend 1200Mbps Wifi adapter. See my BrosTrendWifiAdapterSoftware repo here. See also my other answer here.

How to enable/disable networking (ethernet or wifi) devices, arbitrarily

How to disable built-in wifi and use only USB wifi card?

  1. Unplug your external USB wifi adapter.
  2. Run iwconfig to see what your built-in adapter looks like. Mine shows wlan0. So, that is my built-in wifi adapter!
  3. Now plug in your external USB wifi adapter and run iwconfig again to see which device just showed up. This new device showing up in iwconfig is what you just plugged in, so we can know it is the external USB wifi adapter. Mine shows wlan3.
  4. Run the following to disable the internal wifi adapter, wlan0:
    # recommended (newer cmd)
    sudo ip link set wlan0 down
    # alternative (apparently an older cmd)
    sudo ifconfig wlan0 down
    
  5. Done!
  6. If you ever wanted to re-enable your internal wifi card, wlan0 as we discovered above, run:
    # recommended (newer cmd)
    sudo ip link set wlan0 up
    # alternative (apparently an older cmd)
    sudo ifconfig wlan0 up
    
    

References:

  1. This ifconfig answer by Gerhard Burger
  2. NOTE: Apparently this ip link set command is intended to replace the older (and apparently/supposedly now-deprecated?) ifconfig cmd! See: https://www.redhat.com/sysadmin/ifconfig-vs-ip --> in the sections "What's trending?" and "Enable and disable an interface".

See also:

  1. My other answer here: How to disable built-in wifi and use only USB wifi card?.
  2. [my answer] Unix & Linux Stack Exchange: "How can I create a virtual ethernet interface on a machine without a physical adapter?"
7
7

Connect the USB Wi-Fi dongle and disable the internal Wi-Fi adapter as below:

  1. Identify your adapter's name by:

    ip link | grep wl
    

    or:

    ifconfig | grep wl
    

    The adapter's name should be something similar to wlp2s0 or wlan0, in which the digits in the names could be any number in your case.

  2. Disable the adapter by:

    sudo ip link set wlp2s0 down
    

    or:

    sudo ifconfig wlan0 down
    

    In your case replace the adapter's name respectively.

This will ensure that only the USB Wi-Fi adapter is active even though the internal Wi-Fi driver will still be active.


ALTERNATIVELY

Disable the internal Wi-Fi driver module:

sudo modprobe -r iwlmvm

This will ensure that only the USB Wi-Fi dongle is active.

3
  • sudo modprobe -r iwlmvm worked for me.. but how can I make it persistent after reboot.. please help..
    – Triven
    Jan 19, 2021 at 16:30
  • make it persistent by typing sudo modprobe -b iwlmvm
    – Dohd
    Jan 23, 2021 at 6:30
  • modprobe command is so cool. I was wondering how to identify which driver module my laptop is using for wifi. In my case, I might not have "iwlmvm" as the wifi driver's name. How to identify the real name?
    – Pranav
    Feb 27, 2023 at 8:16
5

Most laptops these days have Intel wireless cards, which you can very easily disable using the command:

sudo modprobe -r iwlwifi

or disable and blacklist permanently using:

sudo modprobe -r iwlwifi; sudo modprobe -b iwlwifi

I do this with my laptop to use my high-gain TP-Link adapter instead of the internal Wi-Fi card.

4

The built in wifi is Broacom's BCM4312, which uses the proprietary STA driver. So, no need to blacklist anything in your particular case, just deactivate the driver, using the Additional Drivers utility.

2

I just found out that Trend-tech, who makes the BrosTrend AC1200 2.4GHz/5GHz WiFi adapter which I document in my repo here, recommends the following.

From: https://deb.trendtechcn.com/advanced/internal-adapters/:

Internal adapters

Normally it should be possible for many wifi adapters to coexist, both internal and external ones. Unfortunately some of our customers have reported that they had connectivity issues that were resolved when they disabled their internal adapter. This may be caused by a bug in the Linux kernel, in wpa_supplicant, in network-manager or elsewhere. It’s probably not caused by our driver, as these problems happen with other USB adapters as well.

To temporarily disable your internal adapter and see if it makes things better, please open a terminal and follow the procedure below. Note that for Raspberry Pi devices, this procedure is recommended instead.

The following command shows the names of the modules (drivers) for your wifi adapters. The module for our adapters is named 8812au, 88x2bu or 8821cu. The module for Intel adapters is named iwlwifi. For Atheros it’s ath9k, etc.

ls -d /sys/module/cfg80211/holders/*/drivers | cut -d/ -f6
# Example output:
88x2bu
iwlwifi

In the following commands, replace iwlwifi with the module that you want to blacklist:

sudo -i
echo "blacklist iwlwifi" > /etc/modprobe.d/local.conf
update-initramfs -u
reboot

After rebooting, the internal adapter should be disabled. Also, if you have more than one USB wifi adapters, remove the additional ones. Check if things work better that way.

If you ever need to remove the blacklist, use the following commands:

sudo -i
rm /etc/modprobe.d/local.conf
update-initramfs -u
reboot

In a personal email to me from their Linux support team (who actually does seem to know what they are talking about, which is awesome!), they also said:

The network manager nm-connection-editor dialog (run that from a terminal to see which one I mean) has a "Device" combo box, where you can set a MAC address in order to limit one wifi connection to a specific adapter, or you can leave it empty if you want it to work with any adapter.

So normally there's no need to disable the internal adapter at all.

That also looks pretty relevant and does seem to work.

See also:

  1. My other answer here: How to disable built-in wifi and use only USB wifi card?.
1
  • 1
    This works flawlessly for me. Thanks a lot.
    – bluelurker
    May 8, 2021 at 16:58
1

I usually physically remove the internal card. this is usually a mini PCI-e card with 1 or 2 antenna connections. the antenna connections can be carefully lifted up and they disconnect without any fuss. there will usually be 1 Phillips screw holding the card in place. once the screw is removed, lift the back of the card and slide it out of it's edge connector. i usually fold electrical (vinyl) tape over the antenna wire connectors and push the screw through the electrical tape. then re-install the screw (thus holding the antenna wires in their former place). this solves the problem of an undesired internal wireless quite nicely.

note that some cards also include Bluetooth and this procedure removes such Bluetooth as well.

also note that with usb radios, the radio must be turned off before unplugging the radio. on some operating systems, the system crashes if the radio is unplugged before being turned off in the operating system (while still booted).

1

Network manager has a little-known command-line interface called nmcli. If all you want is for the network manager not to manage the interface, you can run:

nmcli device set <interface-name> managed no

To list the possible interface names, use:

ip link

If that list doesn't give you enough information to work out which one you want to disable, you can use:

sudo lshw -C network
0

I know the answer was strictly "How to disable" but for most users like me who have searched this and haven't taken a networking course before ( or in my case 10 years ), the easiest way to "Get this thing working on my Ubuntu" is to just click the wifi icon at the top right of the screen and look for your usb wifi-receiver and connect it to a network. Make sure it connects so you know the drivers are working, and then disconnect the old one ( probably connected through pci ).

If you bought your usb wireless card through a third party vendor, there's a 99% chance that the card will not show up under the name of that vendor, ie "Joes Hardware on Amazon" or "Brostrend" or whatever. It will most likely be the name of the actual hardware inside the casing of the thing you bought, and that will probably be Realtek or Intel or something. So look for one of those names in the dropdown wifi menu.

If you need to find the name of your built in wifi, just run:

sudo lshw -C network

and look for: description: Wireless interface and bus info: pci@0000:03:00.0 and product: Centrino Advanced-N 6205 [Taylor Peak]

That's the one you want to disbale in the dropdown menu. Whether or not your system will keep the old crappy wifi disabled after you reboot your machine is another story. Good Luck!

0

I tried all of this on Ubuntu 20.04 and none of it worked. When I tried the modprobe solution network manager simply created a new device! So finally I simply unplugged the tiny little wifi card from the motherboard and that worked. If you can't solve it in software try this hardware solution.

1
  • OK there was an unfortunate side effect: the wifi card is also the Bluetooth card so I have also disabled Bluetooth. Back to the drawing board... Sep 5, 2021 at 17:46
0

I had the same problem. I wanted to connect a USB Wifi card to my home network.

Under Ubuntu 20.04 the solution is to modify the "interface-name" parameter in the network connection file. Under Ubuntu 20.04 all the network connection files containing which network card (WIFI or Ethernet) is assigned to which network are located under /etc/NetworkManager/system-connections/ The parameter "interface-name" is at the top of connection file

As an exemple here are the network connections I have on my laptop

ls -l /etc/NetworkManager/system-connections/
-rw------- 1 root root 350 oct.  15 17:38 wiseDom.nmconnection
-rw------- 1 root root 350 oct.  15 16:44 wiseDom.nmconnection-old
-rw------- 1 root root 364 avril  3  2022 WIZEDOMWIFI.nmconnection
-rw------- 1 root root 350 oct.  13 19:18 WIZEDOMWIFI.nmconnection-old

On my laptop the name of the on-board WIFI adapter (listed with usr/sbin/ifconfig) is: wlp3s0 and the name of the USB WIFI adapter is: wlx54af97552ea2

Following on my exemple here is what was assigned to the "interface-name" parameter in my old connection file:

cat /etc/NetworkManager/system-connections/wiseDom.nmconnection-old |grep "interface-name"
interface-name=wlp3s0

and to use the USB WIFI card (wlx54af97552ea2) I modified it to be:

interface-name=wlx54af97552ea2

You must log in to answer this question.

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