# wpa_supplicant problem? cannot connect with wlan0

## floops

update I changed title to reflect where I think the issue is-

now this is the second time- the latest update as of Jan 8 around 8pm est, I added nameservers to resolv.conf, then changed the permissions on the file so that it is read only for everyone. Now I can bring wlan0 up and still have dns service with eth0 (see below guess the problem is dhcpcd).

Output below is after I stopped net.eth0 (I tried it once with both running and shut down eth0 to avoid conflicts)

tux floopy # /etc/init.d/net.wlan0 restart

 * Bringing down interface wlan0

 *   Removing addresses

 *     Stopping wpa_cli on wlan0 ...                                      [ ok ]

 *     Stopping wpa_supplicant on wlan0 ...

                                                                          [ ok ]

 * Bringing up interface wlan0

 *   Starting wpa_supplicant on wlan0 ...                                 [ ok ]

 *   Starting wpa_cli on wlan0 ...                                        [ ok ]

 *   Backgrounding ... ...

 * WARNING: net.wlan0 has started, but is inactive

tux floopy # 

tux floopy # ifconfig

lo        Link encap:Local Loopback  

          inet addr:127.0.0.1  Mask:255.0.0.0

          inet6 addr: ::1/128 Scope:Host

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:132 errors:0 dropped:0 overruns:0 frame:0

          TX packets:132 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0 

          RX bytes:10444 (10.1 KiB)  TX bytes:10444 (10.1 KiB)

sit0      Link encap:IPv6-in-IPv4  

          inet6 addr: ::127.0.0.1/96 Scope:Unknown

          UP RUNNING NOARP  MTU:1480  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0 

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wlan0     Link encap:Ethernet  HWaddr ec:55:f9:ad:2e:f2  

          inet6 addr: fe80::ee55:f9ff:fead:2ef2/64 Scope:Link

          UP BROADCAST MULTICAST  MTU:1500  Metric:1

          RX packets:10 errors:0 dropped:0 overruns:0 frame:0

          TX packets:7 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:1408 (1.3 KiB)  TX bytes:1558 (1.5 KiB)

tux floopy # wpa_cli scan

Selected interface 'wlan0'

OK

tux floopy # wpa_cli scan_results

Selected interface 'wlan0'

bssid / frequency / signal level / flags / ssid

lots of other resiults+

00:09:5b:eb:14:18	2452	200	[WEP][ESS]	NETGEAR

tux floopy # wpa_cli add 1

Selected interface 'wlan0'

1

tux floopy # wpa_cli stat

Selected interface 'wlan0'

wpa_state=SCANNING

note I have two networks configured one using a shared key wep and one with just wep - thus I can try to connect to either but neither one works- it just says associating then flips back to scanning.

Any thoughts?

Original Post begins below:

Hi - I recently installed Gentoo and am still trying to get everything working- I am pretty new so this may be something trivial.

I recently enabled my Broadcom 4313 wireless card and got the brcmsmac driver installed. So now it recognizes the wireless card, however since then now my eth0 connection does not function correctly- it should be asking the router for a dns but it does not. I can ping the router so I know I am connected but cannot seem to get the dns working. I am using dhcp so editing resolv.conf keeps getting overridden.

lsmod only shows brcmsmac and brcmutil running

I do not have a working internet connection on that computer at the moment so cannot easily post big outputs but here are some things that look strange to me

/etc/init.d/net.eth0 status

inactive

/etc/init.d/net.wlan0 status

starting

/etc/init.d.net.wlan0 stop

ERROR: net.wlan0 stopped by something else

ifconfig does show eth0 received an IP address, it shows wlan0 exists but I seem to be unable to get it to do anything

in dmesg I get a lot of comments about how different drivers or whatever are being assigned to wlan0 but are then disassociated then it says

 wlan0:deauthenticatting by local choice

Any ideas- thanks in advance for any helpLast edited by floops on Mon Jan 09, 2012 1:52 am; edited 3 times in total

----------

## bartex

Hi floops,

first of all, tell us what sort of wireless encryption do you use?? is it WEP or WPA?? You can try configuring your wireless card using static IP. 

I think that this site might help you: http://en.gentoo-wiki.com/wiki/Broadcom_43xx

BR,

bartex

----------

## floops

hi bartex-

this network uses wep

I am hesitant to turn off dhcp and force an IP address since this usually masks the real problem. I would try it but I think the problem s deeper.

I do get an IP address assigned to eth0 via dhcp

Hope that helps- thanks for your response

floops

----------

## floops

new detail- 

I rebooted and nothing appears to have changed- however I went into the router and the router thinks that both eth0 and wlan0 are connected and have IP addresses. However only eth0 has an address per ifconfig or iwconfig (wlan0 shos no connection) and still no access beyond the router since the dns is still not functioning

thanks

----------

## floops

router lost wlan0 so the router still shows eth0 connected but not wlan- no oher status changes

----------

## floops

one more potential symptom- shutting down takes foreverr because everything is waiting for net.wlan0 (everrything=mtab, root, fsck, modules, udev, etc) no sure if that helps- I may try the fixed ip address just so I can output more information- I did not realize the wisdom of that yesterday- apologies to bartex

----------

## floops

update- finally progress- here is some of what I have been mucking around with-

killed any wpa_supplicant and wpa_gui processes I could find, tweaked /etc/conf.d/net in many ways currently I just have eth0 and wlan0 set to dhcp 

then I restarted wpa_supplicant with the -d to debug

wpa_supplicant -iwlan0 -d -c/etc/wpa_supplicant.conf

and it seems to work- it scans, sees local networks, finds the one that I want which is WEP non-WPA, it seems to connect and then just seems to time out and give up here is some of the output

15: 00:09:5b:eb:14:18 ssid='NETGEAR' wpa_ie_len=0 rsn_ie_len=0 caps=0x11

   selected non-WPA AP 00:09:5b:eb:14:18 ssid='NETGEAR'

Trying to associate with 00:09:5b:eb:14:18 (SSID='NETGEAR' freq=2452 MHz)

Cancelling scan request

WPA: clearing own WPA/RSN IE

Automatic auth_alg selection: 0x1

Overriding auth_alg selection: 0x2

WPA: clearing AP WPA IE

WPA: clearing AP RSN IE

WPA: clearing own WPA/RSN IE

wpa_driver_wext_set_key: alg=0 key_idx=0 set_tx=0 seq_len=0 key_len=0

wpa_driver_wext_set_key: alg=0 key_idx=1 set_tx=0 seq_len=0 key_len=0

wpa_driver_wext_set_key: alg=0 key_idx=2 set_tx=0 seq_len=0 key_len=0

wpa_driver_wext_set_key: alg=0 key_idx=3 set_tx=0 seq_len=0 key_len=0

wpa_driver_wext_set_key: alg=0 key_idx=0 set_tx=0 seq_len=0 key_len=0

wpa_driver_wext_set_key: alg=1 key_idx=0 set_tx=1 seq_len=0 key_len=5

State: SCANNING -> ASSOCIATING

wpa_driver_wext_set_operstate: operstate 0->0 (DORMANT)

netlink: Operstate: linkmode=-1, operstate=5

wpa_driver_wext_associate

wpa_driver_wext_set_drop_unencrypted

wpa_driver_wext_set_psk

Setting authentication timeout: 10 sec 0 usec

EAPOL: External notification - EAP success=0

EAPOL: Supplicant port status: Unauthorized

EAPOL: External notification - EAP fail=0

EAPOL: Supplicant port status: Unauthorized

EAPOL: External notification - portControl=ForceAuthorized

EAPOL: Supplicant port status: Unauthorized

RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP])

RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added

Wireless event: cmd=0x8b1a len=8

RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP])

RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added

Wireless event: cmd=0x8b06 len=8

RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP])

RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added

Wireless event: cmd=0x8b04 len=12

RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP])

RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added

Wireless event: cmd=0x8b1a len=15

RTM_NEWLINK: operstate=0 ifi_flags=0x11003 ([UP][LOWER_UP])

RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added

RTM_NEWLINK: operstate=0 ifi_flags=0x11003 ([UP][LOWER_UP])

RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added

Wireless event: cmd=0x8c08 len=24

AssocResp IE wireless event - hexdump(len=16): 01 08 82 84 8b 96 0c 18 30 48 32 04 12 24 60 6c

RTM_NEWLINK: operstate=0 ifi_flags=0x11003 ([UP][LOWER_UP])

RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added

Wireless event: cmd=0x8b15 len=20

Wireless event: new AP: 00:09:5b:eb:14:18

Association info event

resp_ies - hexdump(len=16): 01 08 82 84 8b 96 0c 18 30 48 32 04 12 24 60 6c

State: ASSOCIATING -> ASSOCIATED

wpa_driver_wext_set_operstate: operstate 0->0 (DORMANT)

netlink: Operstate: linkmode=-1, operstate=5

Associated to a new BSS: BSSID=00:09:5b:eb:14:18

Associated with 00:09:5b:eb:14:18

WPA: Association event - clear replay counter

WPA: Clear old PTK

EAPOL: External notification - portEnabled=0

EAPOL: Supplicant port status: Unauthorized

EAPOL: External notification - portValid=0

EAPOL: Supplicant port status: Unauthorized

EAPOL: External notification - portEnabled=1

EAPOL: SUPP_PAE entering state S_FORCE_AUTH

EAPOL: Supplicant port status: Authorized

EAPOL: SUPP_BE entering state IDLE

Cancelling authentication timeout

State: ASSOCIATED -> COMPLETED

CTRL-EVENT-CONNECTED - Connection to 00:09:5b:eb:14:18 completed (reauth) [id=0 id_str=]

wpa_driver_wext_set_operstate: operstate 0->1 (UP)

netlink: Operstate: linkmode=-1, operstate=6

Cancelling scan request

RTM_NEWLINK: operstate=1 ifi_flags=0x11043 ([UP][RUNNING][LOWER_UP])

RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added

RTM_NEWLINK: operstate=1 ifi_flags=0x1043 ([UP][RUNNING])

RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added

Wireless event: cmd=0x8b15 len=20

Wireless event: new AP: 00:00:00:00:00:00

Disassociation notification

Setting scan request: 0 sec 100000 usec

Added BSSID 00:09:5b:eb:14:18 into blacklist

CTRL-EVENT-DISCONNECTED bssid=00:09:5b:eb:14:18 reason=0

State: COMPLETED -> DISCONNECTED

wpa_driver_wext_set_operstate: operstate 1->0 (DORMANT)

netlink: Operstate: linkmode=-1, operstate=5

EAPOL: External notification - portEnabled=0

EAPOL: SUPP_PAE entering state DISCONNECTED

EAPOL: Supplicant port status: Unauthorized

EAPOL: SUPP_BE entering state INITIALIZE

EAPOL: Supplicant port status: Unauthorized

EAPOL: External notification - portValid=0

EAPOL: Supplicant port status: Unauthorized

RTM_NEWLINK: operstate=0 ifi_flags=0x1043 ([UP][RUNNING])

RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added

Wireless event: cmd=0x8b1a len=8

RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP])

RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added

State: DISCONNECTED -> SCANNING

so something is still wrong- maybe the key (in hex)?

however when I checked

/etc/init.d/net.eth0 status && /etc/init.d/net.wlan0 status it said both were inactive (which is better than "starting")  so I

/etc/init.d/net.wlan0 stop

and then

/etc/init.d/net.eth0 restart

and eth0 is back up and able to resolve names (dns works) so I can now post output (provided I do not muck up the system between now and then)

so still having problems but making progress

----------

## floops

just to reiterate or clarify- I keep going around in circles, starting and stopping wlan0 and wpa_supplicant and restarting eth0 I have tweaked the wpa_supplicant.conf file a few times but perhaps I do not know the right settings- it is a simple wep key written in hex, not sure if it supposed to be shared key or not- have tried both and neither works- can anyone tell from the previous output if this seems to be the issue?

I have been able to bring up wlan0 start wpa_supplicant have 

wpa_cli scan 

for networks (and mine was visible) and even got so far as 

wpa_cli SELECT_NETWORK 0 

and it said OK, when I checked 

wpa_cli status 

it said ASSOCIATING

but never got any further?

As soon as I do this I lose dns ability on eth0 so I need to kill everything again to get back online

Should I just get rid of wpa_supplicant? One other thing- wpa_supplicant seems to be on auto start because every time I kill it then run

ps -x

 I see /usr/sbin/wpa_supplicant -u

So if I want to get rid of wpa_supplicant altogether how do I do this? (Assuming it is a good idea)

One other thing I tried- stopping net.eth0 and then bringing up net.wlan0 but it did not change anything- I could run wpa_supplicant but the output was the same as earlier- I think I may try all of this with the ethernet cord pulled out and see if that fixes anything

Oh- and looking at the router- I can see the wireless cards MAC address but it does not get assigned an IP address- but it is communicating something to the router

----------

## bartex

Wpa_supplicant is a great tool so don't get rid of it.

Right now I'm a bit confused. If you wan't to use wpa_cli to connect to your wireless network, do like this:

wpa_cli list // so we can see what network are in the supplicant

wpa_cli add_n //add the network. if you have only one network it index will be 0

wpa_cli set_n 0 ssid "MyWireless" //your wireless name

wpa_cli set_n 0 key_mgmt NONE //key_mgmt is used for WPA-PSK

wpa_cli set_n 0 wep_key0 "MySecretPass"

You can always save the config to wpa_supplicant.conf - wpa_cli save_config

If the connection will be COMPLETED you have to use "dhcpcd" to gain an IP address - dhcpcd wlan0.

I hope that that will be usefull and one more thing, try this: http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=4&chap=4

BR,

bartex

----------

## floops

Here is what I got

tux floopy # wpa_cli list

Selected interface 'wlan0'

network id / ssid / bssid / flags

0	NETGEAR	any	[CURRENT]

I think the current tag means it connected- and my router shows the wireless card mac address but no ip

Do you think I need to do the rest of the steps? 

Here is the relevant part of wpa_supplicant.conf in case that helps

network={

  ssid="NETGEAR"

  key_mgmt=NONE

  wep_key0=B83276758A

  wep_tx_keyidx=0

  priority=5

}

----------

## floops

oh and I have been all over the link you sent- I know most of it by heart

----------

## bartex

If you want to check is your wireless card connected to the network type "wpa_cli stat" and it should give something like that:

 *Quote:*   

> bssid=f0:7d:68:45:81:c8
> 
> ssid=MyWifi
> 
> id=1
> ...

 

The "wpa_cli list" command only shows the current selected network becasue you can have many wireless network in your supplicant. You must obtain IP address by using the dhcpcd command.

----------

## floops

have uninstalled and reinstalled wpa_supplicant

have tried shutting down eth0 and unplugging ethernet cable, bringing up wlan0 and here is how far I got, it was able to scan, find my network, and even connect momentarily- but then it dropped the connection and just started to cycle through scanning, associating, disconnected,  here is some output

tux floopy # wpa_cli list

Selected interface 'wlan0'

network id / ssid / bssid / flags

0	NETGEAR	any	[CURRENT]

tux floopy # wpa_cli add 0

Selected interface 'wlan0'

1

tux floopy # wpa_cli stat

Selected interface 'wlan0'

bssid=00:09:5b:eb:14:18

ssid=NETGEAR

id=0

mode=station

pairwise_cipher=WEP-40

group_cipher=WEP-40

key_mgmt=NONE

wpa_state=COMPLETED

tux floopy # ping -c 3 192.168.2.1

connect: Network is unreachable

tux floopy # wpa_cli stat

Selected interface 'wlan0'

wpa_state=SCANNING

tux floopy # wpa_cli stat

Selected interface 'wlan0'

wpa_state=ASSOCIATING

tux floopy # wpa_cli stat

Selected interface 'wlan0'

'STATUS' command timed out.

tux floopy # wpa_cli stat

Selected interface 'wlan0'

'STATUS' command timed out.

tux floopy # wpa_cli scan

Selected interface 'wlan0'

OK

tux floopy # wpa_cli add 0

Selected interface 'wlan0'

'ADD_NETWORK' command timed out.

tux floopy # wpa_cli add 0

Selected interface 'wlan0'

'ADD_NETWORK' command timed out.

tux floopy # wpa_cli add 0

Selected interface 'wlan0'

4

tux floopy # wpa_cli stat 

Selected interface 'wlan0'

wpa_state=SCANNING

tux floopy # wpa_cli stat

Selected interface 'wlan0'

wpa_state=ASSOCIATING

tux floopy # wpa_cli stat

Selected interface 'wlan0'

wpa_state=DISCONNECTED

tux floopy # wpa_cli stat

Selected interface 'wlan0'

wpa_state=SCANNING

tux floopy # wpa_cli stat

Selected interface 'wlan0'

'STATUS' command timed out.

tux floopy # nano -w /etc/wpa_supplicant.conf

tux floopy # wpa_cli reconfigure

Selected interface 'wlan0'

OK

tux floopy # wpa_cli stat

Selected interface 'wlan0'

'STATUS' command timed out.

tux floopy # wpa_cli scan

Selected interface 'wlan0'

'SCAN' command timed out.

tux floopy # wpa_cli scan

Selected interface 'wlan0'

'SCAN' command timed out.

tux floopy # wpa_cli terminate

Selected interface 'wlan0'

'TERMINATE' command timed out.

tux floopy # wpa_cli stat 

Selected interface 'wlan0'

'STATUS' command timed out.

I still cannot keep eth0 and wlan0 up at the same time, eth0 loses dns ability

Any thoughts?

----------

## floops

ok- I have a hypothesis (due to a friend)

eth0 comes up and dhcp connects, it writes the dns servers (actually just 192.168.2.1 my router) to /etc/resolv.conf (and this is all that is not commented)

then wlan0 comes up, dhcp overwrites resolv.conf thus I lose dns

I thought that if both were available then ifplugd is supposed to turn wlan0 to quiet, but it does not let eth0 overwrite resolv.conf

current plan of attack-

write the resolv.conf to have nameservers I know work, or just the router as above, then change the write permissions so that nothing is allowed to overwrite it

won't solve the wlan0 problems but I should be able to keep them both up at the same time

Thoughts? Advice?

----------

## floops

Latest update-

wlan- still cannot connect to networks

when I start the computer eth0 now does not connect automatically- or at least it is not connecting to my wired network. When I look at the network monitor it shows that eth0 is receiving information but is not getting an ip address, however /etc/conf.d.net still has both etho and wlan0 set to dhcp? /etc/init.d/net.eth0 restart got eth0 to connect again

Can it be the brcmsmac driver? I am out of ideas and do not see another option besides going with the Broadcom-STA driver.

Can anyone help?

----------

## floops

Update-

I gave up trying to use the brcmsmac driver and went with the broadcom-sta driver. Wireless works great now- connects instantly and does not interfere with eth0 at all. 

In installing the broadcom-sta driver there were some kernel options that were needed to proceed-

CONFIG_SSB should not be set but it is

CONFIG_LIB80211 is not set and should be

CONFIG_MAC_80211 should not be set but is

Is is possible that these issues also interfere with brcmsmac? I do not know what options I had before but I doubt I turned off SSB previously- this was hard as I could not just turn it off until I had unchecked the Broadcom 44xx driver from Ethernet 10MB. Then it gave me the option to uncheck SSB (Sonic Silicon something?). I would guess I had this box checked when I installed the brcmsmac driver also- could this have caused all of my problems? I would not have guessed that these two drivers were related since I assumed one was just for wired and one was for wireless. 

Not sure if I should add [SOLVED:] to this or not? My problem is resolved with the proprietary driver and some kernel options- but I know most people want to use the free driver and I believe it can work- I just could not figure it out.

----------

