I’m using a clean install of Ubuntu 16.04, on an LG laptop which is quite old.
In order to get a faster wifi connection I use an external USB wifi dongle.
Since I do not need both wifis- I wish to turn off on board wifi.
Tries:
- Turning it off using Ubntu’s network menu – does not remain OFF after boot.
- Using Laptop physical wifi’s On/Off button, shuts down BOTH wifis.
Is there a more elegant way making this work, other than running a bash script at boot to disable it using nmcli
?
at can see upper wifi network disabled(on board ) and lower, connected ( via USB adapter )
Problem solved: After applying @pa4080 answer- device not managed
Best Answer
There are at least two possible ways to disable any network adaptor/interface at system startup. First, as @TunanGuo says, use the command
ifconfig
to find the name of your interface. When the interface is disabled you can useifconfig -a
to list all interfaces. Let's assume the interface name iswlx99wifi
.First method. Edit
/etc/rc.local
with root privileges (usesudo nano /etc/rc.local
orsudo -i gedit /etc/rc.local
) and add the following line before the last line in that file, which isexit 0
:On the next reboot the device will be disabled.
Second method. This method should be more correct. Edit
/etc/network/interfaces
with root privileges (usesudo nano /etc/network/interfaces
orsudo -i gedit ...
) and add the following line to the bottom of this file:On the next reboot the device will be disabled. You can run the next command to restart
network-manager
and reload the settings without reboot:Create custom shortcuts to up/down the interface. First install
gksu
package to get a GUI prompt to enter your password when you need to gain root privileges:Then go to
System Settings
→Keyboard
→Shortcuts
→Custom Shortcuts
and:Create Interface UP shortcut: Click + to add a new keyboard shortcut.
For Name fill wlx99wifi UP, and for Command fill:
Click Apply and then click on the Disabled label to assign shortcut key combination. For example, use the combination Crtl+Shift+↑ Arrow Up
Create Interface DOWN shortcut: Click + to add a new keyboard shortcut.
For Name fill wlx99wifi DOWN, and for Command fill:
Click Apply and then click on the Disabled label to assign shortcut key combination. For example, use the combination Crtl+Shift+↓ Arrow Down
References and sources:
Remove network interface permanently
How do I set a custom keyboard shortcut to control volume?
How do I add sudo commands to a keyboard shortcut?
Author's notes: Configure WiFi Connections | GnomeDev nmcli