Skip to content

Automatically Turn Off Internal WiFi if USB WiFi is connected?

I have a ThinkPad T420 with it's own internal WiFi, but when I'm at home I connect to my docking station, which has an ASUS USB-AC56 WiFi adapter connected to it, which is faster than the internal WiFi.

Is there a quick/easy way to make it so that when the ASUS USB WiFi is connected, the internal WiFi turns off, and then turns back on once the USB WiFi is disconnected?

It seems to work fine if they're both enabled and connected, but I don't know which one is actually being used at any given time. Obviously using only the faster one would be ideal.

Using GNOME with NetworkManager if it matters

Sorry if this is an FAQ or something obvious in the Wiki

Edited 27 Jul 2019. We only hold this version.

7 points12 comments
Open on Reddit
About this post
Posted
Archived
Edited
Score
7 · 100% up
Kind
Text
ID
cin1lp

Author

42
posts
324
comments
6
media
View profile

12 comments

You are looking for a custom udev rule, just read the wiki about udev and make your own rule to do this.

8 points

NetworkManager allows you to set “priority”, and you can give your USB WiFi higher priority than built-in WiFi.

4 points

If by docking station you mean it is just a usb connection to this dongle then you should have 2 separate interfaces for wifi, and an ethernet port as well too. So ifconfig would so 4, lo, eth, wl...1, wl....2

Use the above command with ifconfig to put down the one you don't want working.

2 points
1 points

It is a simple reliable tool that works 100%

ifconfig --> shows you the current status of all interfaces and active connections

ifconfig <if name> up --> makes interface active

ifconfig <if name> down --> deactivates interface

Simple

1 points

AFAIK the docking station's connection to your machine is through ethernet, the station itself is connected through wifi. Your router should see both your internal wifi and the docking station's wifi.

If on terminal you use # ifconfig it should show you lo, wl..... (wifi interface) and en..... (ethernet interface). As root if you say

# ifconfig wl.... down

(wl_____ whatever name it has, switch down for up to raise the interface up again)

If ifconfig is not working # pacman -S net-tools

I don't know if nm-tui or whatever nm gui you have uses a priority of ethernet over wifi, to select automatically that if ethernet is present wifi is not used, maybe someone else will comment. I think wicd and connman have such an option.

I am sure there are other ways to do it but this is mine.

2 points

they both appear as WiFi, there's no Ethernet plugged into my dock. But I'll see what I can find as far as ifconfig goes

1 points

Why not just upgrade the wireless chip in the machine?

1 points

Because it requires a bios mod and it's a hassle

Also the adapter was for my gaming desktop which is currently dead so I wanted to see if it would work in Linux

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.