Coder Social home page Coder Social logo

Comments (12)

kcdtv avatar kcdtv commented on July 30, 2024 2

😺 It is not something that is not documented...

  1. turn off network manager
    sudo systemctl stop network-mamnager
  2. kill any potentially conflictive process
    sudo kill wpa_supplicant
    sudo kill dhclient
  3. generate the configuration file to be used with wpa_supplicant
    wpa_passphrase <eSSID> <Wireless_key> >> /tmp/test.conf
    (eSSID is the name of your network and you have to put the wifi key you have configured.)
    It will generate something like that

network={
ssid="WiFi_XXXX"
#psk="WiFilibr3!"
psk=3af35a94a429490ea2ae3e5fa6fd970516c45566255e0bd5c2094b93f3cfac0a
}

  1. Launch wpa_supplicant with the configuration file
    sudo wpa_supplicant -i<interface> -c /tmp/test.conf
    Instead of interface put the identifier of your wifi device
  2. Open another shell (do not close the one you've just used right now; the process with wpa_suplicant is running) and get an IP
    sudo dhclient <interface>
  3. You should be connected. Check it (ping google for example)
    Once you checked you can close the first shell (or press ctrl+c to kill the process) and to restart network-manager simply do
    sudo systemctl restart network-manager

from rtl8812au.

astsam avatar astsam commented on July 30, 2024 2

NM tries to change MAC on every connect but something goes wrong.
Add the following lines
[device]
wifi.scan-rand-mac-address=no
at the end of the /etc/NetworkManager/NetworkManager.conf
and restart NetworkManager
sudo service NetworkManager restart

from rtl8812au.

kcdtv avatar kcdtv commented on July 30, 2024 1

I tried in ubuntu tonight with the trick
[device] wifi.scan-rand-mac-address=no
and it worked!
I can connect.
I won't try to understand why it affects the USB devices only.... 😺
I guess this issue could be closed as the problem with ubuntu is clearly this.
Cheers

from rtl8812au.

kcdtv avatar kcdtv commented on July 30, 2024

I observed this kind of issue with some drivers and releases.
I could connect using wpa_supplicant directly so I would say this is more a network manager thing.
Can you connect in command line to your wpa network?

from rtl8812au.

paspro avatar paspro commented on July 30, 2024

@kcdtv I don't know how to do that. Could you please give me detailed instructions?

from rtl8812au.

paspro avatar paspro commented on July 30, 2024

Thank you for the instructions. I can confirm that this process does indeed work so there must be some problem with the Network Manager in Ubuntu 17.04 which causes the authentication process to fail. I also noticed that I need to keep the terminal with the wpa_supplicant command up and running for the network to work. If I terminate this process the network stops working. The following are the messages I see when the wpa_supplicant command is executed:

Successfully initialized wpa_supplicant
wlx2c4d54032d38: Trying to associate with 38:10:d5:9b:b9:53 (SSID='Cerberus-HF' freq=5240 MHz)
wlx2c4d54032d38: Associated with 38:10:d5:9b:b9:53
wlx2c4d54032d38: WPA: Key negotiation completed with 38:10:d5:9b:b9:53 [PTK=CCMP GTK=CCMP]
wlx2c4d54032d38: CTRL-EVENT-CONNECTED - Connection to 38:10:d5:9b:b9:53 completed [id=0 id_str=]

Now, if I then restart the network manager as you suggest wpa_supplicant attempts to authenticate again but it fails:

wlx2c4d54032d38: CTRL-EVENT-DISCONNECTED bssid=38:10:d5:9b:b9:53 reason=0 locally_generated=1           
wlx2c4d54032d38: CTRL-EVENT-ASSOC-REJECT status_code=1
wlx2c4d54032d38: CTRL-EVENT-REGDOM-CHANGE init=CORE type=WORLD
wlx2c4d54032d38: CTRL-EVENT-REGDOM-CHANGE init=BEACON_HINT type=UNKNOWN
wlx2c4d54032d38: CTRL-EVENT-REGDOM-CHANGE init=BEACON_HINT type=UNKNOWN
wlx2c4d54032d38: CTRL-EVENT-REGDOM-CHANGE init=BEACON_HINT type=UNKNOWN
wlx2c4d54032d38: CTRL-EVENT-REGDOM-CHANGE init=BEACON_HINT type=UNKNOWN
wlx2c4d54032d38: Trying to associate with c8:0e:14:a7:e9:db (SSID='Cerberus-HF' freq=5220 MHz)
wlx2c4d54032d38: Associated with c8:0e:14:a7:e9:db
wlx2c4d54032d38: CTRL-EVENT-DISCONNECTED bssid=c8:0e:14:a7:e9:db reason=0 locally_generated=1
wlx2c4d54032d38: WPA: 4-Way Handshake failed - pre-shared key may be incorrect
wlx2c4d54032d38: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="Cerberus-HF" auth_failures=1 duration=10 reason=WRONG_KEY
wlx2c4d54032d38: CTRL-EVENT-REGDOM-CHANGE init=CORE type=WORLD
wlx2c4d54032d38: CTRL-EVENT-REGDOM-CHANGE init=BEACON_HINT type=UNKNOWN
wlx2c4d54032d38: CTRL-EVENT-REGDOM-CHANGE init=BEACON_HINT type=UNKNOWN
wlx2c4d54032d38: CTRL-EVENT-REGDOM-CHANGE init=BEACON_HINT type=UNKNOWN
wlx2c4d54032d38: CTRL-EVENT-REGDOM-CHANGE init=BEACON_HINT type=UNKNOWN
wlx2c4d54032d38: CTRL-EVENT-SSID-REENABLED id=0 ssid="Cerberus-HF"
wlx2c4d54032d38: Trying to associate with 38:10:d5:9b:b9:53 (SSID='Cerberus-HF' freq=5240 MHz)
wlx2c4d54032d38: Associated with 38:10:d5:9b:b9:53
wlx2c4d54032d38: CTRL-EVENT-DISCONNECTED bssid=38:10:d5:9b:b9:53 reason=0 locally_generated=1
wlx2c4d54032d38: WPA: 4-Way Handshake failed - pre-shared key may be incorrect
wlx2c4d54032d38: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="Cerberus-HF" auth_failures=2 duration=23 reason=WRONG_KEY

and the error message says that the key is wrong.

from rtl8812au.

kcdtv avatar kcdtv commented on July 30, 2024

Sorry for the delay, I bearly use ubuntu.
I had exactly the same issue than you when i tried with ubuntu 17.01.
Network manager see perfectly my PA, the connexion process start.... and fail.
I can see that it is not able to negotiate the handshake (the PA dot is not green, as if the key was incorrect and dmesg confirms it )
The thing is that the failure happens with... all my USB device! (tried with old ralink and atheros too)
It seems that ubuntu network manager has a big instability problems (I got many crashes when i manipulate interfaces and drivers) and does not handle properly the USB wifi interfaz (the internal card: no problems)
It is definitely something that has to do with network manager and Ubuntu.

from rtl8812au.

kimocoder avatar kimocoder commented on July 30, 2024
  • NetworkManager just got updated in Kali, btw

from rtl8812au.

kcdtv avatar kcdtv commented on July 30, 2024

The automatic mac change done by network manager (for scanning and connecting) goes well in Kali. since quite a while:
seleccion_405
I added random here too

[connection]
wifi.cloned-mac-address=random

Real mac is never used.
If that would be the reason of the fail in Ubuntu I guess we could not connect with the internal interface neither... But yeah, weird things can happens too, there is nothig to loose for trying.

from rtl8812au.

astsam avatar astsam commented on July 30, 2024

There is a race condition between wpa_supplicant and the NetworkManager for hotplugged devices. It has no relations to the driver.

from rtl8812au.

tdaitx avatar tdaitx commented on July 30, 2024

@astsam do you have more information on this issue? I would appreciate any pointers on other bugs/discussions about this race condition - when I searched google this bug report was the only reference that made any sense at all, I couldn't find any other reports about the race condition.

from rtl8812au.

astsam avatar astsam commented on July 30, 2024

After inserting an USB WIFI:

  1. Driver is loaded, interface is created.
  2. The NetworkManager set a random MAC for the interface to scan APs.
  3. The wpa_supplicant detect the new interface and got its MAC. At this point the interface already has the random MAC assigned by the NetworkManager. For the following operations the wpa_supplicant will use this (randomly assigned) MAC.
  4. The NwtworkManager complete scan an restore the orignal MAC.
  5. During the WPA handshake the wpa_suplicant use the random MAC instead of the original one.

For an internal WIFI adapter p.2 and 3 are swapped, the wpa_supplicant get the original MAC and all works smoothly.

from rtl8812au.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.