63

My Panda USB wi-fi adapter works just fine on 16.10, but when I try to connect to my wi-fi router in 17.04, GNOME network manager reports "Connection failed." I did some tinkering, and noticed that my MAC address for my wifi adapter, according to GNOME, is DIFFERENT every time I make it forget my wifi settings and try to reconnect. Any leads on a possible fix or work-around?

I'm running Ubuntu GNOME 17.04, kernel 4.10.0-19-generic, GNOME 3.24.0.

Rebel
  • 2,215
  • 8
  • 30
  • 37
  • I also filed a bug for this issue: https://bugs.launchpad.net/ubuntu-gnome/+bug/1681513 – Rebel Apr 13 '17 at 21:07
  • @Jesse when you say " [device] wifi.scan-rand-mac-address=no" does one change [device] to the specific wireless device, or leave it literally "[device]"? Maybe you can let us take a look at your NetworkManager.conf file. – heynnema Apr 13 '17 at 21:53
  • @heynnema, it's left as "[device]", just like that. You don't need to change it to the actual device. Then, on the next line, past the text "wifi.scan-rand-mac-address=no". – Rebel Apr 13 '17 at 21:58
  • 1
    @Jesse I think we will need some further info to get a firm grasp on what your situation is. In most cases everything needed can be obtained via the wireless script available here Thank you for helping us help you! – Elder Geek Apr 13 '17 at 22:19
  • 2
    For those who don't understand the reason behind mac randomisation during scanning, https://arstechnica.com/apple/2014/06/ios8-to-stymie-trackers-and-marketers-with-mac-address-randomization/ might be informative. – unhammer Apr 16 '17 at 19:02
  • On Debian 9.5 (stretch), this issue manifested the following error ieee80211 phy2: rt2x00lib_rxdone: Error - Wrong frame size 0 max 3840. – Serge Stroobandt Jul 21 '18 at 17:40

1 Answers1

112

So Jesse discovered a solution and I'm going to share it here in answer form as clearly as I can muster. This fixed wifi for me using a Panda Wireless USB wifi adapter on Ubuntu 17.04:

For privacy reasons, the default settings for Ubuntu 17.04's network manager (ALL flavours, not just GNOME) cause the MAC address of the Wifi device to change constantly. To fix this, you just have to create a new config file as outlined below and then restart the network-manager service.

Open a terminal and run:

sudo tee /etc/NetworkManager/conf.d/wifi.scan-rand-mac-address.conf > /dev/null <<EOF
[device]
wifi.scan-rand-mac-address=no
EOF
sudo service network-manager restart

and wifi should work again! (unless something else is wrong).

This fix should work even on a live CD/USB session.

Serge Stroobandt
  • 5,268
  • 1
  • 48
  • 59
  • 2
    That is great, man! – heroin Apr 15 '17 at 15:54
  • 3
    Why isn't this ironed out in betas? This is so unprofessional, to release a distro with such high importance bug – Hrvoje T Apr 15 '17 at 22:14
  • 12
    @HrvojeT: Did you help with beta testing? – Gunnar Hjalmarsson Apr 16 '17 at 20:28
  • 3
    I had the same problem. Did what you described but it is not working – Jay Chakra Apr 20 '17 at 00:07
  • @JayChakra Sorry to hear that. Sounds like something else might be wrong with your Wifi rather than this particular bug. Check out this link; maybe you might find your way to a solution for your particular issue. – Mike_IronFist Apr 21 '17 at 06:26
  • Excellent answer, and very helpful :) – Jacob Vlijm Apr 21 '17 at 15:46
  • 3
    After fixing this issue I also had to do what's described here to get online: https://superuser.com/a/1200745/722957 – Matt Apr 28 '17 at 06:01
  • Not working for me. It fails network manager to launch. – Amit Kumar Gupta Jun 04 '17 at 00:41
  • This fix works for other usb wifi dongles. (my is a Trenda). Maybe make the tilte more generic? – E. Timotei Jun 06 '17 at 08:34
  • This solution is not working for me as well, I installed ubuntu 17.04 alongside with windows 10 and after successful installation I am not able to connect to the WiFi network to complete some other activities. I tried all the similar solutions suggested but nothing worked for me. – Harsh Sharma Sep 19 '17 at 09:24
  • WTF - this still is happening in 2017. It fixed my issue right away. Thanks so much! – Isengo Nov 05 '17 at 20:33
  • I couldn't get this to work in linux Mint. It gives me an error when I restart the service... – WitnessTruth Nov 09 '18 at 20:26
  • I bought a TP Link AC1300 USB adapter and was having trouble getting it working with Debian 10 with Gnome. I noticed the MAC kepts changing, turns out it was this issue with NetworkManager randomizing it. It supposed to be a security feature when working with public wi-fi spots. It seems to cause havoc when you're using it with home wifi! This fixed it for me - thank you! I am using this driver https://github.com/jeremyb31/rtl8822bu and about the setting https://fedoramagazine.org/randomize-mac-address-nm/ – Imran-UK May 02 '20 at 08:23