You are not logged in.

#1 2017-01-20 16:06:00

AnorexicWhale
Member
Registered: 2017-01-20
Posts: 4

[SOLVED]Trouble connecting to WPA2 WiFi

I've been working on learning Linux and trying to install Arch Linux onto my laptop to do so. I ran into some problems booting it from my flash drive and had to run "nomodeset" at boot. I've been following the Installation Wiki and trying to get it to work. I'm able to find my wireless LAN card, and it looks like the drivers that work for it load. I can scan, and set the link state to up on it.

When it comes to connecting to my SSID, I type in:

wpa_supplicant -D nl80211,wext -i wlp3s0 -c <(wpa_passphrase "Corey, don\'t reset me again'!'" "genericpassword30")

This makes it so it says something along the lines of "successfully initialized wpa_supplicant", but then only gives me a blank line and no root terminal, where I need to Ctrl+C out of it.. I then tried running it with the -B switch and am able to get my terminal line back(I'm not quite sure what the proper way to word this is). From there, I try running "dhcpcd wlp3s0" and it says waiting for carrier and then it times out. I've also tried assigning a static IP address via dhcpcd but that didn't work. I have also tried running dhclient but that didn't work. I've been trying to Google as much as I can, but I'm simply stuck. Could it be a problem with my SSID? I have no problem changing it if it is the problem. It took me awhile to figure out how to escape the characters, so that was fun, but if it's causing me more troubles then it's just not worth it.

I'm not sure if it's relevant, but I've changed my router's gateway to the 172.xxx.xxx.xxx private range in an attempt to make it more secure.

Any help is appreciated!

Last edited by AnorexicWhale (2017-01-21 04:27:09)

Offline

#2 2017-01-20 20:12:45

BlahBlahBlase
Member
From: Tucson, AZ
Registered: 2015-09-15
Posts: 35

Re: [SOLVED]Trouble connecting to WPA2 WiFi

I've had similar issues with wpa_supplicant's initialization that could be resolved running it as superuser ('sudo su') then dropping out of superuser and running 'sudo dhcpcd <interface>'.

Last edited by BlahBlahBlase (2017-01-20 20:13:10)


"Full disclosure, I'm drunk right now. And if you can't handle that, you can't handle science."

Offline

#3 2017-01-20 20:19:37

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,914
Website

Re: [SOLVED]Trouble connecting to WPA2 WiFi

First, drop the -D flag.  That almost never helps anything, and very frequently causes problems.  Second, don't pipe the output of wpa_passphrase.  If you are not in a proper root shell, that will fail, but even if you are in a proper root shell it may do what it is supposed to, but you have no way to diagnose what has gone wrong.  Instead, use wpa_passphrase first, then pass the generated config file to wpa_supplicant:

wpa_passphrase "My Network" "My passphrase" > wpa.conf
wpa_supplicant -i wlp3s0 -c wpa.conf

If this fails, you can inspect the wpa.conf file to make sure it looks right.  I'm particularly suspicious of a problem at this stage as you have a lot of single quotes in your SSID.  Are you sure there are single quotes around the exclaimation point?


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Online

#4 2017-01-21 01:54:04

AnorexicWhale
Member
Registered: 2017-01-20
Posts: 4

Re: [SOLVED]Trouble connecting to WPA2 WiFi

BlahBlahBlase wrote:

I've had similar issues with wpa_supplicant's initialization that could be resolved running it as superuser ('sudo su') then dropping out of superuser and running 'sudo dhcpcd <interface>'.

I'm already in root@archiso because I'm trying to install it. Isn't it pretty much the same thing?

Trilby wrote:

First, drop the -D flag.  That almost never helps anything, and very frequently causes problems.  Second, don't pipe the output of wpa_passphrase.  If you are not in a proper root shell, that will fail, but even if you are in a proper root shell it may do what it is supposed to, but you have no way to diagnose what has gone wrong.  Instead, use wpa_passphrase first, then pass the generated config file to wpa_supplicant:

wpa_passphrase "My Network" "My passphrase" > wpa.conf
wpa_supplicant -i wlp3s0 -c wpa.conf

If this fails, you can inspect the wpa.conf file to make sure it looks right.  I'm particularly suspicious of a problem at this stage as you have a lot of single quotes in your SSID.  Are you sure there are single quotes around the exclaimation point?

Okay, so my network name is just "Corey, don't reset me again!". When I was originally typing in the commands it kept bringing me to some sort of \'dquote command line that makes me finish off the quote in order to run the command. I had to look up how to break quotes in the root terminal. I put single quotes around the exclamation point because when I typed in !", it would just end up erasing both of them for some reason, and I found on Google that single and double quotes do separate things when it comes to special characters. And if I found a way around trying to break up the special characters, it would just bring me back to the \'dquote command line to finish off the so called unfinished quotes. I'm also being brought back to the same \'dquote command line when I type in

wpa_passphrase "Corey, don\'t reset me again!" "genericpasswordhere" > wpa.conf

.

I would enjoy being able to figure this out, but I can always rename my AP to something simpler if this is indeed the issue. I've spent a good 3-4 hours just trying to connect to the WiFi at my house. It's been great for learning, but I'm feeling a little stumped. I'll keep messing around with your method though. I was only calling -D in the command because that's the way the Installation Wiki was doing it. I don't even know what the modifier does! Thank you for your response though.

Last edited by AnorexicWhale (2017-01-21 01:56:36)

Offline

#5 2017-01-21 02:30:02

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,914
Website

Re: [SOLVED]Trouble connecting to WPA2 WiFi

After you generate the wpa.conf file you can then edit the file in a text editor and make sure the SSID name is correct without having to worry about escaping or command line issues.  That's one of the reasons I recommend the separate steps: you can actually SEE what is in the configuration directly rather than having to play guess-and-check with quoting.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Online

#6 2017-01-21 04:02:18

AnorexicWhale
Member
Registered: 2017-01-20
Posts: 4

Re: [SOLVED]Trouble connecting to WPA2 WiFi

Trilby wrote:

After you generate the wpa.conf file you can then edit the file in a text editor and make sure the SSID name is correct without having to worry about escaping or command line issues.  That's one of the reasons I recommend the separate steps: you can actually SEE what is in the configuration directly rather than having to play guess-and-check with quoting.

You're amazing! I had to figure out the basics of vim, but it's attempting to connect after editing the SSID entry. Thank you so much! I'm running into a problem where it's saying the PSK may be incorrect and the 4 way handshake is failing, but that sounds like something I can Google!

EDIT: Got it! wpa_passphrase generated a PSK out of the password, so I just needed to comment out the PSK and uncomment my actual key and it worked. Thank you again!

Last edited by AnorexicWhale (2017-01-21 04:16:39)

Offline

#7 2017-01-21 04:10:21

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,433

Re: [SOLVED]Trouble connecting to WPA2 WiFi

As you are just starting with linux, I would suggest you to begin by installing netctl & dialog followed by

 # wifi-menu 

or use sudo if you are not root. This will be much more easy to connect wifi, and you can try messing with wpa_supplicant, wpa_passphrase, etc,. later on at your convenience.

Offline

#8 2017-01-21 04:21:04

AnorexicWhale
Member
Registered: 2017-01-20
Posts: 4

Re: [SOLVED]Trouble connecting to WPA2 WiFi

Docbroke wrote:

As you are just starting with linux, I would suggest you to begin by installing netctl & dialog followed by

 # wifi-menu 

or use sudo if you are not root. This will be much more easy to connect wifi, and you can try messing with wpa_supplicant, wpa_passphrase, etc,. later on at your convenience.

That sounds like the easy way out. What's the fun in that? tongue I may have struggled for hours, but I learned new things!

Offline

#9 2017-01-21 07:20:32

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,433

Re: [SOLVED]Trouble connecting to WPA2 WiFi

AnorexicWhale wrote:

EDIT: Got it! wpa_passphrase generated a PSK out of the password, so I just needed to comment out the PSK and uncomment my actual key and it worked. Thank you again!

you can use either of your actual password or the key generated by wpa_passphrase. Purpose is to hide your wifi-password so that no one else can find it out by accesing your wpa_supplicant configuration.
I really admire that you are willing to give efforts. Welcome to arch.

Offline

Board footer

Powered by FluxBB