Fix Ubuntu Wifi On but unable to connect

Ubuntu can have a WiFi connection issue on some computers that can’t handle MAC address randomization while Wifi scanning. Wifi MAC randomization gives some additional privacy by helping avoid casual passive tracking of a device within physical radio range (perhaps 100+ meters).

Workarounds Ubuntu Wifi dropouts

The telltale sign of this problem is seen by

dmesg -w

as messages like

mwifiex_pcie wlan0: already connected
ieee80211 phy0: mwifiex_cfg80211_sched_scan_start : Invalid Sched_scan parameters

Disable NetworkManager MAC randomization

Note: Ubuntu may have this already set from the factory install.

  1. add to /etc/NetworkManager/NetworkManager.conf

  2. restart NetworkManager

    sudo service network-manager restart

Disable Wifi power management

  1. edit /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf

    wifi.powersave = 2
  2. reboot

Wifi module reset

This technique works for Microsoft Surface Pro 3 for Wifi on Ubuntu. It removes / reinserts the Wifi kernel module and restarts Network Manager.

See “Notes” below to find your laptop WiFi kernel module name.

  1. create a script ~/

    modprobe -r mwifiex_pcie
    modprobe mwifiex_pcie
    service network-manager restart
  2. make the script executable

    chmod +x ~/
  3. Every time your Wifi disconnects due to the dmesg -w messages noted above, use

    sudo ~/

Bluetooth tether

When all else fails, I Bluetooth tether to my Wifi-connected smartphone.

  • Bluetooth WPAN (tethering) in general is limited to 1.6 Mbps upload/download.
  • VPN works over Bluetooth WPAN.


Which Wifi kernel module am I using?

This is useful to know for the script involving modprobe above:

  1. find wireless device PCI address:

    lspci | grep -i wireless

    The number at the front is the PCI address.

  2. Assuming the PCI address is 00:0b.0:

    lspci -vv -s 00:0b.0

    look for “Kernel driver in use” and “Kernel modules”. It might be iwlwifi or mwifiex_pcie etc.