I have two Wifi adapters connected to my desktop: a PCI express TP-Link adapter, which is crap, and a USB Netgear adapter. I don't feel like manually taking out the PCI-E adapter, so how can I set the USB one as the default, and disable the internal one?
1 Answer
You can use rfkill
First, do rfkill list
This will show you the names of your interfaces. Then you can do rfkill block <adapterindex>
and that interface will be blocked. You can unblock again with rfkill unblock <adapterindex>
For example, my rfkill list
gives:
my-lat wilhelm # rfkill list
0: dell-wifi: Wireless LAN
Soft blocked: no
Hard blocked: no
1: dell-bluetooth: Bluetooth
Soft blocked: no
Hard blocked: no
So I could run rfkill block 0
or rfkill block 1
You can add these commands to /etc/rc.local
so they will be run on every boot.
For more information see man rfkill
-
1How do I know which one is which? When I run rfkill list, I get this: 0: phy0: Wireless LAN Soft blocked: no Hard blocked: no 7: phy7: Wireless LAN Soft blocked: no Hard blocked: no Dec 9, 2015 at 23:34
-
-
That's okay. for future reference you can enclose such things in `. You could try removing the USB dongle and running it again. The index shouldn't change. Dec 9, 2015 at 23:36
-
@WilhelmErasmus This question being marked as duplicate and your answer not being on the linked question, please add your answer here. Sep 9, 2017 at 12:03
-
Note that in my case blocking
phy0
blocked both the internal wifi card and the USB dongle, though. Sep 9, 2017 at 12:39
lshw -c net