7

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:

  1. Turning it off using Ubntu’s network menu – does not remain OFF after boot.
  2. 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 )screencapture

Problem solved: After applying @pa4080 answer- device not managed screenshot

3

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 use ifconfig -a to list all interfaces. Let's assume the interface name is wlx99wifi.


First method. Edit /etc/rc.local with root privileges (use sudo nano /etc/rc.local or sudo -i gedit /etc/rc.local) and add the following line before the last line in that file, which is exit 0:

/sbin/ifconfig wlx99wifi down

On the next reboot the device will be disabled.


Second method. This method should be more correct. Edit /etc/network/interfaces with root privileges (use sudo nano /etc/network/interfaces or sudo -i gedit ...) and add the following line to the bottom of this file:

iface wlx99wifi inet manual

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:

sudo systemctl restart network-manager.service

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:

sudo apt install gksu

Then go to System SettingsKeyboardShortcutsCustom Shortcuts and:

  • Create Interface UP shortcut: Click + to add a new keyboard shortcut.

    For Name fill wlx99wifi UP, and for Command fill:

    gksu ifconfig wlx99wifi up  
    

    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:

    gksu ifconfig wlx99wifi down  
    

    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:

  • 1
    thank you- second method was applied successfully. screen shot added to witness that "device not managed" – Guy . D Oct 12 '17 at 16:07
3

Use ifconfig to control the interfaces. You can type ifconfig into terminal.

Both your WiFi cards would pop up as "wlan0" or "wlan1" or other names. Shut down the interface using ifconfig wlan0 down. If you found that you shut down the wrong one, use ifconfig wlan0 up to enable it. You need root privilege to do this, so use sudo ifconfig ...

  • Your suggestion indeed turned off on board wifi, BUT after reboot it came back on- and I seek for a solution ( if any ) without script at boot – Guy . D Oct 12 '17 at 6:49
  • @Guy.D: It's not exactly scripting, you can edit /etc/rc.local to add ifconfig INTERFACE-NAME down, before the last line, which is exit 0. – pa4080 Oct 12 '17 at 7:42
  • 1
    Have you tried to disable the WiFi in the bios, that won't affect an external device! It may shut down your Bluetooth too - if they are on the same radio. – Ken Mollerup Oct 12 '17 at 8:55
  • @KenMollerup - There is no disable wifi at bios :( – Guy . D Oct 12 '17 at 13:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.