Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[Solved] Network-manager wifi issue

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
Jerome
Posts: 54
Joined: 2011-07-18 20:57
Location: France

[Solved] Network-manager wifi issue

#1 Post by Jerome »

Hi.

I'm trying to connect to my local Wi-Fi network. Network manager fails while wicd succeeds. I can live with this, as I'll receive a cable in a few days anyway, but I would like to understand and perhaps help fixing Network manager by providing a useful bug report.

Hardware

The computer is a desktop (it makes no difference except from a practical perspective : I can't move it around for the tests). Debian Stretch. Same behavior on another Debian Stretch desktop.

Code: Select all

Linux 4.9.0-4-amd64 #1 SMP Debian 4.9.51-1 (2017-09-28) x86_64 GNU/Linux
I tried with 4 different USB wifi dongles. Here are the lines from dmesg indicating the driver used:

Edimax nano USB EW-7811Un

Code: Select all

usb 1-8: firmware: direct-loading firmware rtlwifi/rtl8192cufw_TMSC.bin
Unknown brand, same chip apparently

Code: Select all

usb 1-8: firmware: direct-loading firmware rtlwifi/rtl8192cufw_TMSC.bin
D-Link DWL-G122 C1 F/W 3.10

Code: Select all

rt73usb 1-8:1.0: firmware: direct-loading firmware rt73.bin
Cisco Linksys WUSB 600n v2

Code: Select all

rt2800usb 1-8:1.0: firmware: direct-loading firmware rt2870.bin
Most of my tests were with the Edimax. I tried both with rtl8192cufw from the kernel and from the non-free firmware-realtek package (but mostly the non-free).

Error messages

I also tried both with (WPA2) and without authentication.

With WPA authentication, I get this kind of things:

Code: Select all

[  404.892587] wlx001cf09d49d5: authenticate with 65:7d:31:c8:ea:7a
[  404.951583] wlx001cf09d49d5: send auth to 65:7d:31:c8:ea:7a (try 1/3)
[  404.960094] wlx001cf09d49d5: authenticated
[  409.956093] wlx001cf09d49d5: aborting authentication with 65:7d:31:c8:ea:7a by local choice (Reason: 3=DEAUTH_LEAVING)
[  429.131873] IPv6: ADDRCONF(NETDEV_UP): wlx001cf09d49d5: link is not ready
[  429.333318] IPv6: ADDRCONF(NETDEV_UP): wlx001cf09d49d5: link is not ready
With no authentication, I get only this:

Code: Select all

[  364.175223] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[  364.208738] rtl8192cu: MAC auto ON okay!
[  364.241483] rtl8192cu: Tx queue select: 0x05
[  364.649647] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
What I checked/tried

I searched on the web using keywords from dmesg output, but I believe those are not specific enough and most of what I found was pretty old and unrelated.

1/ From https://unix.stackexchange.com/a/386938 (and https://lists.debian.org/debian-user/20 ... 01045.html):
Somehow, my firmware got trouble with long interface name. So I ran this command to prevent it:

Code: Select all

ln -s /dev/null /etc/systemd/network/99-default.link
and it worked.
No difference here, which is no surprise as /etc/systemd/network/ was empty: /lib/systemd/network/99-default.link did not exist.

2/ https://unix.stackexchange.com/a/243354
I changed the "Auto channel" option to a fixed channel and the "Channel width" option to 20 MHz in my AP and it solved my problem.
I tried to do more or less the same (fixed channel + 40 MHz). No difference.

3/ Very old bug report: https://bugs.debian.org/cgi-bin/bugrepo ... bug=683407

I have only one wpa_supplicant instance. I killed wpa_supplicant. It wouldn't recreate by itself (or by network-manager) so I restarted it using systemd start wpa_supplicant. It made no difference.

I picked "ignore" in the IPv6 tab of my wifi connexion in Network manager. (dmesg reported IPv6 stuff so I figured let's deactivate IPv6. Not sure this "ignore" choice does that.) No difference.

4/ https://blogs.gnome.org/thaller/2016/08 ... ger-1-4-0/
Randomization during Wi-Fi scanning

During Wi-Fi scanning, NetworkManager resets the MAC address frequently to a randomly generated address. This was already enabled by default in 1.2.0, but as said, users likely didn’t have the required support from wpa_supplicant.

This default behavior can be disabled with a global configuration option in NetworkManager.conf:

Code: Select all

[device]
wifi.scan-rand-mac-address=no
Tried that. No difference.

Any hint appreciated.

Thanks.
Last edited by Jerome on 2017-11-19 20:28, edited 1 time in total.

User avatar
bw123
Posts: 4015
Joined: 2011-05-09 06:02
Has thanked: 1 time
Been thanked: 28 times

Re: Network-manager wifi issue

#2 Post by bw123 »

Cisco Linksys WUSB 600n v2 rt2800usb 1-8:1.0: firmware: direct-loading firmware rt2870.bin
I have one of these just plugged it in to a new stretch box, it works fine. In fact, Network Mangler has been pretty reliable for five days now so I'm okay. Sometimes it used to be a pain, but it seems to be a lot nicer now. It is still a little slow I guess, I'll probably stop using it on the desktop, but for a mobile notebook it does a good job.

If you can't get along with NM, I really recommend trying wpa_cli. It is installed along with wpa_supplicant so you can use it anytime. Then if you grok that way of doing things, it has a wpa_gui to go with it.

Code: Select all

] usb 1-6: new high-speed USB device number 4 using ehci-pci
] usb 1-6: New USB device found, idVendor=1737, idProduct=0071
] usb 1-6: New USB device strings: Mfr=1, Product=2, SerialNumber=3
] usb 1-6: Product: Dual-Band Wireless-N USB Network Adapter
] usb 1-6: Manufacturer: Cisco-Linksys LLC
] usb 1-6: reset high-speed USB device number 4 using ehci-pci
] ieee80211 phy1: rt2x00_set_rt: Info - RT chipset 2872, rev 0202 detected
] ieee80211 phy1: rt2x00_set_rf: Info - RF chipset 0002 detected
] ieee80211 phy1: Selected rate control algorithm 'minstrel_ht'
] usbcore: registered new interface driver rt2800usb
] ieee80211 phy1: rt2x00lib_request_firmware: Info - Loading firmware file 'rt2870.bin'
] rt2800usb 1-6:1.0: firmware: direct-loading firmware rt2870.bin
] ieee80211 phy1: rt2x00lib_request_firmware: Info - Firmware detected - version: 0.29
resigned by AI ChatGPT

Bulkley
Posts: 6383
Joined: 2006-02-11 18:35
Has thanked: 2 times
Been thanked: 39 times

Re: Network-manager wifi issue

#3 Post by Bulkley »

The computer is a desktop
In that case you don't need either Network-manager or Wicd. They are only needed if you are moving around a lot. Add a few lines to /etc/network/interfaces as shown here. Scroll down to the wpa_supplicant section.

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: Network-manager wifi issue

#4 Post by debiman »

Bulkley wrote:
The computer is a desktop
In that case you don't need either Network-manager or Wicd. They are only needed if you are moving around.
i agree strongly (although i'd use systemd to manage the network).

Jerome
Posts: 54
Joined: 2011-07-18 20:57
Location: France

Re: Network-manager wifi issue

#5 Post by Jerome »

Thank you for your answers.

I'm not really looking for a workaround. (Because I moved to fiber and until I get that fiber cable, the modem is far away from the computer) I'd like to use Wi-Fi for a few days. I managed to get it to work using wicd so it'll do the job. Then back to RJ45.

Now pretend I'm a beginner using my brand hew Debian Stretch / Mate installation. I need Wi-Fi, I plug the dongle in, try to connect... nothing. Same with all dongles. Let me ask my power user partner. He opens that scary terminal and modifies a few files and it works. Well, I don't have that nice network applet in the panel anymore but it seems to work. Oh well. Linux is so complicated. But at least it works. This is pretty much what my partner must be thingking and this is what I'd like to avoid.

This is why I would like to

- understand what is wrong (isn't this what we're all here for ?)

- if a parameter is wrong in my NM config, or even my AP config, set it right and maybe document it somewhere or suggest a better error message

- if there is a bug in NM, signal it to the devs

In other words, I'm not concerned about my own case for the next days to come. I'd like to have it working out of the box for anyone.

(I'd wouldn't like to argue about the choice of Debian Stable for beginners. Besides the same probably also applies to other distros anyway.)

Jerome
Posts: 54
Joined: 2011-07-18 20:57
Location: France

Re: Network-manager wifi issue

#6 Post by Jerome »

bw123 wrote:
Cisco Linksys WUSB 600n v2 rt2800usb 1-8:1.0: firmware: direct-loading firmware rt2870.bin
I have one of these just plugged it in to a new stretch box, it works fine. In fact, Network Mangler has been pretty reliable for five days now so I'm okay. Sometimes it used to be a pain, but it seems to be a lot nicer now.
Interesting. So it could be something specific to my installation. Weird because the install is recent and I'm pretty sure I didn't mess up with config files.

shep
Posts: 423
Joined: 2011-03-15 15:22

Re: Network-manager wifi issue

#7 Post by shep »

Now pretend I'm a beginner using my brand hew Debian Stretch / Mate installation. I need Wi-Fi, I plug the dongle in, try to connect... nothing. Same with all dongles. Let me ask my power user partner. He opens that scary terminal and modifies a few files and it works. Well, I don't have that nice network applet in the panel anymore but it seems to work. Oh well. Linux is so complicated. But at least it works. This is pretty much what my partner must be thingking and this is what I'd like to avoid.
IMHO, the goal of most Open Source operating systems is not to compete with commercial OS's like Windows and OS/X. Open Source projects are viable when they recruit developers and funding for the projects those developers undertake. Key to this is educating new users as to how something like wifi works. Compare Debian's wifi howto use page, referenced above, to a Windows 10 screenshot that says "Click here".

Jerome
Posts: 54
Joined: 2011-07-18 20:57
Location: France

Re: Network-manager wifi issue

#8 Post by Jerome »

I think I got it working.

I added this option to network-manager config file, as mentioned in OP.

Code: Select all

[device]
wifi.scan-rand-mac-address=no
I had done that before, but I guess I screwed up because this time, it did help.

This is known issue. Responsability would be either Network manager or Debian, I can't really tell. I guess there's a tradeoff, here, since having random MAC address is meant to improve security, but on the other hand, it prevents connexion for a lot of users.

Since the connexion was not totally reliable, I did a few things:

- upgraded network-manager to 1.10
- removed non-free firmware-realtek to use kernel driver
- upgraded to kernel 4.13 to hopefully get a more recent driver version (I see mentions of rtl8192 in the changelog)

Can't tell which of those did the trick, but it seems reliable now.

shep
Posts: 423
Joined: 2011-03-15 15:22

Re: Network-manager wifi issue

#9 Post by shep »

This is known issue. Responsability would be either Network manager or Debian, I can't really tell. I guess there's a tradeoff, here, since having random MAC address is meant to improve security, but on the other hand, it prevents connexion for a lot of users
I think it is a little more complex. Some of the more open hardware (Atheros) does well with random MAC. Realtek is not that open and in general, does not do well with random MAC.

User avatar
bw123
Posts: 4015
Joined: 2011-05-09 06:02
Has thanked: 1 time
Been thanked: 28 times

Re: Network-manager wifi issue

#10 Post by bw123 »

Jerome wrote:I think I got it working.

- upgraded network-manager to 1.10
- removed non-free firmware-realtek to use kernel driver
- upgraded to kernel 4.13 to hopefully get a more recent driver version (I see mentions of rtl8192 in the changelog)

Can't tell which of those did the trick, but it seems reliable now.
That's good, all that sounds reasonable but I thought nm was up around 1.6 in stable.

interesting stuff here
https://developer.gnome.org/NetworkMana ... .conf.html
resigned by AI ChatGPT

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: Network-manager wifi issue

#11 Post by debiman »

shep wrote:IMHO, it is not the goal of most Open Source operating systems to compete with commercial OS's
fixed that for you.

Jerome
Posts: 54
Joined: 2011-07-18 20:57
Location: France

Re: [Solved] Network-manager wifi issue

#12 Post by Jerome »

I believe my issue is solved. Besides, I got a cable so I won't be using Wi-Fi anymore.

I think some of my former tests might have been broken because I screwed up and let wicd and network-manger run at the same time. Not 100% sure.

I wouldn't like to leave wrong or misleading information to users with similar issues, so here is an updated status after a few tests.

Updating latest Network-manager makes no difference. I downgraded to 1.6.2 and it works fine.

My connection was not totally reliable. It would work but when deconnecting/reconnecting (for the sake of testing), at some point, it would just stop connecting (only tested on Edimax nano USB EW-7811Un) until I unplug the dongle then plug it back. I reinstalled the non-free firmwares (firmware-realtek) and it seems totally reliable now. I don't mind the performance that much, but I expect a reliable connection. It would take more tests to be absolutely certain that this is a proprietary vs. free firmware issue. I also have firmware-ralink installed. It provides rt2870.bin for the Cisco and D-Link dongles. I did not try those dongles without the proprietary firmwares.

Kernel 4.9 vs. 4.13 does not seem to make a difference. AFAIU, a newer kernel would bring a more recent firmware version, but since I'm using the proprietary firmware, this does not matter. Yet, I did my final tests on 4.13.

No need to modify AP settings (I tried to set it to 802.11b/g instead of 802.11b/g/n but it made no difference).

Bottom line : using kernel 4.13, network-manager 16.2 with random MAC address disabled, and proprietary firmwares, all dongles work reliably.

User avatar
bw123
Posts: 4015
Joined: 2011-05-09 06:02
Has thanked: 1 time
Been thanked: 28 times

Re: [Solved] Network-manager wifi issue

#13 Post by bw123 »

I did manage to get rand-scan working on my broadcom, but still haven't figure out any realtek devices. The broadcom hates it when you try to replacee the first adddress, so the mask FE:00:00:00:00:00 was the trick.

Code: Select all

/etc/NetworkManager/conf.d/10-scan-rand-mac.conf
[device]
match-device=interface-name:wlan0
;wifi.scan-rand-mac-address=0
wifi.scan-generate-mac-address-mask=FE:00:00:00:00:00

Code: Select all

# lspci |grep -i bcm
Network controller: Broadcom Limited BCM4312 802.11b/g LP-PHY (rev 01)
resigned by AI ChatGPT

Post Reply