Disable wifi networking services

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

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 
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 

13 Answers 13

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

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 

@Matt Edit with sudo nano /etc/network/interfaces , add the line, save and exit (Ctrl+O, ENTER, Ctrl+X).

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 .

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/…

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

Читайте также:  Нет отправленных пакетов wifi

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

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

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:

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.

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 .

For me on 16.04 this causes the interface to disappear from ifconfig for a moment, but then it reappears and reconnects soon.

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:

To remove a module manually without rebooting:

Looses effect after reboot.

If you wanted to blacklist eth1394 woudln’t you uncomment the line or add a new line ? Otherwise this is what I needed thanks!

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.

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?

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 
# 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:

@jcollum, in that case it probably means you have a driver issue and need to install its driver. For example, here are some of my GitHub repos for various WiFi drivers.

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

    Identify your adapter’s name by:

sudo ip link set wlp2s0 down 

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:

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

sudo modprobe -r iwlmvm worked for me.. but how can I make it persistent after reboot.. please help..

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?

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

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.

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.

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.

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:

Источник

How to disable/enable WiFi Connection

This article shows how to disable/enable Wireless network connection(WiFi) on a windows system from command line. We can also find the status of network connections, check if they are connected or disconnected.

Disable WiFi from command prompt

netsh interface set interface name="Wireless Network Connection" admin=DISABLED

Wifi connection disabled

After running the command, you can immediately see in System tray (Right bottom corner on your windows screen) that WiFi is disconnected. In network connections, it shows it as disabled.

How to enable WiFi connection

netsh interface set interface name="Wireless Network Connection" admin=ENABLED

How to disconnect Wifi connection

If you don’t want to disable WiFi interface on your computer, but only disconnect from a specific WiFi network, then run the below command.

Connect to Wifi network from CMD

netsh wlan connect name="WifiNetWorkName"

Errors

This command needs to be run from elevated command prompt to make any changes to the network connection configuration. Running from normal command prompt throws up error as below.

C:\>netsh interface set interface name="Wireless Network Connection" admin=DISABLED An interface with this name is not registered with the router.

There’s an error in the wording here. It says at one point “elevator command prompt” ironically in the errors section. Shouldn’t this be “elevated command prompt”?

I copied and pasted the first expression and pressed enter and the it comes up as “No more data is available”

Is there a way to disable connecton to ONE specific (open)Wifi network, but not affect connection to any other (private)network ? ( W7/64)

thanks you
netsh interface set interface name, wasnt working for me after going thru multiplie sites
your way netsh wlan works!

I am exploring a way to write powershell(or any other scripting language) script to disconnect all the connected devices to my windows mobile hotspot. Could you guide on how to do it?

Источник

Оцените статью
Adblock
detector