You are not logged in.

#1 2010-07-03 10:26:12

kr1zmo
Member
Registered: 2010-07-03
Posts: 22

[solved] wpa_supplicant isnt connecting via wp2

Quick Info: 
I got my bcm4306 (revision 3) up and running
When I run "iwlist wlan0" scan Im seeing my wireless listed so I know my card is installed correctly.
The problem is i cant get wpa_supplicant configured correctly with my wireless network secured with wpa2.
I also might add that I have dhcp turned off on my router, so this could be the problem.  I dont want to enable dhcp btw.
I also dont want to install or use gui so please dont recommend something that uses gui

my /etc/wpa_supplicant.conf

ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
ap_scan=1

network={
        ssid="awifi"
        proto=RSN
        key_mgmt=WPA-PSK
        pairwise=CCMP TKIP
        group=CCMP TKIP
        psk=MY KEY WHICH IS CORRECT
}

Resource: http://wiki.archlinux.org/index.php/WPA … icant.conf

I followed all steps, I got the my network name along with the pass phrase.
Followed the special config instructions for wpa .
booted up the card "ifconfig wlan0 up".
Ensured it was working with "iwlist wlan0 scan".
I found my network listed.

Then I ran

wpa_supplicant -B -Dwext -i wlan0 -c /etc/wpa_supplicant.conf

Next I attempted, "dhcpcd wlan0" I knew this wasnting going to work since I have dhcp disabled on my router, it timed out.

I dont kno what to do next to obtain an ip.

Thanks guys.  I have to get this working I have no choice.  Im using this laptop as my server and I can't use a ethernet cable for ever.

smile

Last edited by kr1zmo (2010-07-04 07:01:53)

Offline

#2 2010-07-03 10:38:23

hokasch
Member
Registered: 2007-09-23
Posts: 1,461

Re: [solved] wpa_supplicant isnt connecting via wp2

Emm, this is a bit confusing - is wpa_supplicant "timing out" or dhcpd? In other words, is wpa_supplicant connecting succesfully?

To assign yourself an IP once wpa_supplicant connected, here is an example (for 192.168.0.1 as your router's IP):

#ifconfig wlan0 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255
#route add default gw 192.168.0.1

Offline

#3 2010-07-03 10:53:01

kr1zmo
Member
Registered: 2010-07-03
Posts: 22

Re: [solved] wpa_supplicant isnt connecting via wp2

hokasch wrote:

Emm, this is a bit confusing - is wpa_supplicant "timing out" or dhcpd? In other words, is wpa_supplicant connecting succesfully?

Im asuming its a problem with "dhcpcd wlan0", because im getting this when i run it

dhcpcd[3535]: version 5.2.5 starting
dhcpcd[3535]: wlan0: waiting for carrier
dhcpcd[3535]: timed out

Also I tired this and I dont think it worked.

hokasch wrote:
#ifconfig wlan0 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255
#route add default gw 192.168.0.1

Do you think its because I have dhcp disabled on my router?
Also is there any commands to verify wpa_supplicant is working and doing its job?

Last edited by kr1zmo (2010-07-03 11:04:03)

Offline

#4 2010-07-03 11:03:25

hokasch
Member
Registered: 2007-09-23
Posts: 1,461

Re: [solved] wpa_supplicant isnt connecting via wp2

If you have turned off dhcpd in your router and do not want to use it, what is the point in running dhcpd wlan0? Of course it times out, since their is no running dhcpd server in your network...The example was for assigning yourself a static IP from command line.

wpa_supplicant should not run as a daemon by default, so you can follow what it does on the command line. Please post the output here.

P.S.: [wiki]netcfg[/wiki] might be worth a try too, works great.

Last edited by hokasch (2010-07-03 11:05:50)

Offline

#5 2010-07-03 11:07:18

kr1zmo
Member
Registered: 2010-07-03
Posts: 22

Re: [solved] wpa_supplicant isnt connecting via wp2

hokasch wrote:

P.S.: [wiki]netcfg[/wiki] might be worth a try too, works great.

k will do

Last edited by kr1zmo (2010-07-03 11:12:08)

Offline

#6 2010-07-03 11:11:21

kr1zmo
Member
Registered: 2010-07-03
Posts: 22

Re: [solved] wpa_supplicant isnt connecting via wp2

You say here.

hokasch wrote:

To assign yourself an IP once wpa_supplicant connected

What do you mean by once I get wpa_supplicant connected, I thought I just edited the /etc/wpa_supplicant.conf
then ran, wpa_supplicant -B -Dwext -i wlan0 -c /etc/wpa_supplicant.conf
then tried to get a static ip with #ifconfig wlan0 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255

Then I was done am I missing a step here.

Last edited by kr1zmo (2010-07-03 11:12:24)

Offline

#7 2010-07-03 11:14:49

hokasch
Member
Registered: 2007-09-23
Posts: 1,461

Re: [solved] wpa_supplicant isnt connecting via wp2

1. configure wpa_supplicant
2. run wpa_supplicant -> if configured properly, it will authenticate with the router / "connect" to it
3. don't kill wpa_supplicant, open another terminal
4. assign yourself staatic ip
5. add the default gateway
6. ping something

Offline

#8 2010-07-03 11:29:32

kr1zmo
Member
Registered: 2010-07-03
Posts: 22

Re: [solved] wpa_supplicant isnt connecting via wp2

Alright I need some sleep I've been going at this since 12:30am, urgh its 7:29am ahhhh.

Offline

#9 2010-07-03 11:34:41

hokasch
Member
Registered: 2007-09-23
Posts: 1,461

Re: [solved] wpa_supplicant isnt connecting via wp2

Good thinking wink Look at it again tomorrow. Basically you connect to the router first which is handled by wpa_supplicant, and assign IP and gateway with ifconfig and route in the next step. To have this automated at boot, I recommend netcfg if you don't want a gui.

Offline

#10 2010-07-03 19:01:24

kr1zmo
Member
Registered: 2010-07-03
Posts: 22

Re: [solved] wpa_supplicant isnt connecting via wp2

hokasch wrote:

Good thinking wink Look at it again tomorrow. Basically you connect to the router first which is handled by wpa_supplicant, and assign IP and gateway with ifconfig and route in the next step. To have this automated at boot, I recommend netcfg if you don't want a gui.

Hey Hokasch is there anyway I can run some debugs or logs on wpa_supplicant to give you better information on whats going on.

1 Because i run  "wpa_supplicant -B -Dwext -i wlan0 -c /etc/wpa_supplicant.conf" with no errors im assuming it works but i have no clue.
2 Then I set the static ip with ifconfig 192.168.1.122 netmask 255.255.255.0 broadcast 192.168.1.255
3 Next I run ifconfig wlan0 to verify the ip which is says "inet addr:192.168.1.122"
4 I cant ping anything?

Note: I might add when i try to ping my router ip "192.168.1.1" I get Destination Host Unreachable

Last edited by kr1zmo (2010-07-03 19:06:35)

Offline

#11 2010-07-03 19:05:59

hokasch
Member
Registered: 2007-09-23
Posts: 1,461

Re: [solved] wpa_supplicant isnt connecting via wp2

Post the output from wpa_supplicant. When you run ifconfig, does it say you are associated with the AP?

You have to set the gateway with the route command as well - and I forgot to mention the DNS server, you need one in /etc/resolv.conf like so:

nameserver 8.8.8.8

for Google's, or use your router IP.

Offline

#12 2010-07-03 19:09:28

kr1zmo
Member
Registered: 2010-07-03
Posts: 22

Re: [solved] wpa_supplicant isnt connecting via wp2

hokasch wrote:

Post the output from wpa_supplicant. When you run ifconfig, does it say you are associated with the AP?

I'm sorry I'm a newbie, but how to I get an output from wpa_supplicant when I run ifconfig?

Last edited by kr1zmo (2010-07-03 19:10:52)

Offline

#13 2010-07-03 19:18:46

hokasch
Member
Registered: 2007-09-23
Posts: 1,461

Re: [solved] wpa_supplicant isnt connecting via wp2

Sorry, you have been running wpa_supplicant as daemon I just realized. Obmit the -B switch and it should output something like:

WPS-AP-AVAILABLE 
Trying to associate with <mac adress> (SSID='<AP name>' freq=2412 MHz)
WPS-AP-AVAILABLE 
Associated with <mac adress>
WPA: Key negotiation completed with <mac adress> [PTK=CCMP GTK=CCMP]
CTRL-EVENT-CONNECTED - Connection to <mac adress> completed (auth) [id=0 id_str=]

That is a successful connect. Next open a new terminal to run ifconfig & route.

Last edited by hokasch (2010-07-03 19:20:03)

Offline

#14 2010-07-03 19:36:21

kr1zmo
Member
Registered: 2010-07-03
Posts: 22

Re: [solved] wpa_supplicant isnt connecting via wp2

hokasch wrote:

Sorry, you have been running wpa_supplicant as daemon I just realized. Obmit the -B switch and it should output something like:

WPS-AP-AVAILABLE 
Trying to associate with <mac adress> (SSID='<AP name>' freq=2412 MHz)
WPS-AP-AVAILABLE 
Associated with <mac adress>
WPA: Key negotiation completed with <mac adress> [PTK=CCMP GTK=CCMP]
CTRL-EVENT-CONNECTED - Connection to <mac adress> completed (auth) [id=0 id_str=]

That is a successful connect. Next open a new terminal to run ifconfig & route.

This is great we narrowed the problem down to an issue with my wpa_supplicant, im getting this when i obmit the -B

Trying to associate with SSID 'awifi'
WPS-AP-AVAILABLE 
Authentication with 00:00:00:00:00:00 timed out.
Trying to associate with SSID 'awifi'

Did I mention I'm on WPA2 so it could be a issue with my /etc/wpa_supplicant.conf file?

I also might add that I did test to ensure my wireless bcm4306 is installed correctly, I took down my wifi security and was able to connect.  So the problem has to be with wpa_supplicant

Last edited by kr1zmo (2010-07-03 19:41:23)

Offline

#15 2010-07-03 19:43:02

hokasch
Member
Registered: 2007-09-23
Posts: 1,461

Re: [solved] wpa_supplicant isnt connecting via wp2

Yes it most definitely is. Just start from scratch following the example in the wiki guide.

Does your network SSID show with a "iwlist wlan0 scanning"?

Offline

#16 2010-07-03 19:48:53

kr1zmo
Member
Registered: 2010-07-03
Posts: 22

Re: [solved] wpa_supplicant isnt connecting via wp2

hokasch wrote:

Yes it most definitely is. Just start from scratch following the example in the wiki guide.

Does your network SSID show with a "iwlist wlan0 scanning"?

Yup I get a bunch of info on my awifi network

Offline

#17 2010-07-03 20:24:26

kr1zmo
Member
Registered: 2010-07-03
Posts: 22

Re: [solved] wpa_supplicant isnt connecting via wp2

Much *thanks* to "hokasch" for the help, I finally got it working now i need to automate the process.

Offline

#18 2010-07-03 21:18:23

kr1zmo
Member
Registered: 2010-07-03
Posts: 22

Re: [solved] wpa_supplicant isnt connecting via wp2

Wait one more problem i set the dns servers to 192.168.1.1 but it cant resolve any host names

Offline

#19 2010-07-04 07:01:03

kr1zmo
Member
Registered: 2010-07-03
Posts: 22

Re: [solved] wpa_supplicant isnt connecting via wp2

Before you start anything make sure your wireless card is installed and running, run #ifconfig wlan0 up then #iwlist wlan0
If you cant see your network listed on the output something wrongs.

======== // WPA (TKIP) + WP2 (TKIP+AES) // ==============
For this example ensure your wifi is setup as follows: 
Security Mode = wpa2 personal
WPA Algorithms = TKIP+AES
WPA SHARED KEY = YOUR PASSWORD

In my opinion this is a really common error not making sure your wpa2 is setup correctly and TKIP+AES is on.



1: Install wpa_supplicant with #pacman -S wpa_supplicant

Before we start edit configs -  reference: http://wiki.archlinux.org/index.php/Wpa_supplicant
2: After install, run #wpa_passphrase WIRELESSNAME PASSWORD > /etc/wpa_supplicant.conf
3: Open the conf file, run #nano /etc/wpa_supplicant.conf
4: Ensure /etc/wpa_supplicant.conf matches the format below add anything necessary

====This is for WPA2 (TKIP+AES SECURITY ONLY):==== // dont include this line

ctrl_interface=/var/run/wpa_supplicant
network={
        ssid="yournetworkname"
        proto=RSN
        key_mgmt=WPA-PSK
        pairwise=CCMP TKIP
        group=CCMP TKIP
        #psk="yourpassword"
        psk=your long encrypted pass
}

===This is for WPA(TKIP SECURITY ONLY)=== // dont include this line

ctrl_interface=/var/run/wpa_supplicant

network={
        ssid="yournetworkname"
        psk=your long encrypted pass
        key_mgmt=WPA-PSK
        proto=WPA
        pairwise=TKIP
}

Get connected to the network:
1: #ifconfig wlan0 down
2: #ifconfig wlan0 up
3: #rm /var/run/wpa_supplicant/wlan0
4: #wpa_supplicant -B -Dwext -i wlan0 -c /etc/wpa_supplicant.conf
5: #dhcpcd wlan0

7: Ensure were connected, run #ifconfig wlan0 - the output should show you an ip address example: 192.168.1.112
8: Test the wpa connection and ensure its active with a ping, run #ping -c 3 google.com
9: The ping should come back with packets

Note For Newbies like me: Remember you can use control+c to stop and clear the terminal at anytime


To do all this work at startup ensure the above worked correctly and follow these two steps below:
1: Install netcfg, run #pacman -S netcfg
2: Lets configure netcfg
Run, #cp /etc/network.d/examples/wireless-wpa-config /etc/network.d/wpa_suppl

Edit the new file to make sure it specifies the right interface, dont do anything else to this file other than the thing below.  So run, #nano /etc/network.d/wpa_suppl

INTERFACE="wlan0"

Next, open up  /etc/rc.conf. So lets run, #nano /etc/rc.conf

Add the network profile to the NETWORKS array:
NETWORKS=(wpa_suppl)

And, add the net-profiles daemon to the list of daemons started at boot:
DAEMONS=(... @net-profiles)

Next lets tell Arch to not startup and connect with eth0 at boot:
3: In /etc/rc.conf add # before this line INTERFACES=(eth0) so it should read #INTERFACES=(eth0) to do this, run #nano /etc/rc.conf


Ending Notes:  I have noticed that WPA2 (TKIP + AES) runs slower than, WPA (TKIP), so you may want to just use WPA (TKIP).
Thanks Everyone, if I mistyped any info please tell me ill correct it

smile

Last edited by kr1zmo (2010-07-04 21:23:26)

Offline

#20 2010-07-04 07:48:19

kr1zmo
Member
Registered: 2010-07-03
Posts: 22

Re: [solved] wpa_supplicant isnt connecting via wp2

removed

Last edited by kr1zmo (2010-07-04 20:54:08)

Offline

Board footer

Powered by FluxBB