# WPA_SUPPLICANT dhcpcd doesn't get an ip

## arabis

Yes, I know, another thread about wireless  :Confused:  . I have search the forum (I saw similar threads but no solution), Google, bugzilla for 3 days but I didn't find the solution.

I am on amd64, with ndiswrapper and bcmwl5 64 bits driver from Acer.

I use a D-Link 624 rev C router.

If I don't use encryption (open system wireless), everything is fine. My wlan0 is getting an ip from dhcpcd

If I use WPA-PSK, my wlan0 authenticates positively, dhcpcd start but it doesn't get and ip. If I check the router, I see an ip given to my wlan0.

(by the way, on Windows, WPA-PSK works fine).

```
ferrari ~ # /etc/init.d/net.wlan0 start

 * Starting wlan0

 *   Starting wpa_supplicant on wlan0 ...                                 [ ok ]

 *     wlan0 connected to "8v4rtyu" at 00:0F:3D:39:17:7C

 *   Bringing up wlan0

 *     dhcp

 *       Running dhcpcd ...                                               [ !! ]

```

Here is my /etc/conf.d/net:

```
config_eth0=( "dhcp" )

dhcpcd_eth0="-t 10"

modules=( "wpa_supplicant" )

wpa_supplicant_wlan0="-Dndiswrapper"

wpa_timeout_wlan0=30

config_wlan0=( "dhcp" )

dhcpcd_wlan0="-t 10"
```

Here is my /etc/wpa_supplicant.conf:

```
ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=0

ap_scan=1

network={

        ssid="8v4rtyu"

        mode=0

        key_mgmt=WPA-PSK

        proto=WPA

        pairwise=TKIP

        group=TKIP

        psk="xxxxxxxxxxxxxxxxxxxxxxxxxx"

        priority=2

}
```

My dmesg about ndiswrapper:

```
ndiswrapper version 1.5 loaded (preempt=yes,smp=no)

ndiswrapper (load_pe_images:582): fixing KI_USER_SHARED_DATA address in the driver

ndiswrapper: driver bcmwl5 (Broadcom,02/11/2005, 3.100.64.0) loaded

ACPI: PCI Interrupt 0000:06:02.0[A] -> GSI 21 (level, low) -> IRQ 21

ndiswrapper: using irq 21

wlan0: vendor: ''

wlan0: ndiswrapper ethernet device 00:14:a4:30:9e:b0 using driver bcmwl5, 14E4:4318.5.conf

wlan0: encryption modes supported: WEP; TKIP with WPA, WPA2, WPA2PSK; AES/CCMP with WPA, WPA2, WPA2PSK

```

I tried to disable preempt in the kernel, but the problem stays.

On the dmesg, I don't see explicitly a supported mode for WPA-PSK. Is it the reason? But I read on some other forum, that someone using the same laptop, with the same driver succeeded without probem using WPA-PSK. I tried his method without success.

Here is an output of wpa_supplicant:

```
ferrari ~ # wpa_supplicant -Dndiswrapper -iwlan0 -c/etc/wpa_supplicant.conf -dd

Initializing interface 'wlan0' conf '/etc/wpa_supplicant.conf' driver 'ndiswrapper' ctrl_interface 'N/A'

Configuration file '/etc/wpa_supplicant.conf' -> '/etc/wpa_supplicant.conf'

Reading configuration file '/etc/wpa_supplicant.conf'

ctrl_interface='/var/run/wpa_supplicant'

ctrl_interface_group=0

ap_scan=1

fast_reauth=1

Line: 5 - start of a new network block

ssid - hexdump_ascii(len=7):

     38 76 34 72 74 79 75                              8v4rtyu

key_mgmt: 0x2

proto: 0x1

pairwise: 0x18

group: 0x8

PSK (ASCII passphrase) - hexdump_ascii(len=19): [REMOVED]

priority=1 (0x1)

PSK (from passphrase) - hexdump(len=32): [REMOVED]

Priority group 1

   id=0 ssid='8v4rtyu'

Initializing interface (2) 'wlan0'

EAPOL: SUPP_PAE entering state DISCONNECTED

EAPOL: KEY_RX entering state NO_KEY_RECEIVE

EAPOL: SUPP_BE entering state INITIALIZE

EAP: EAP entering state DISABLED

EAPOL: External notification - portEnabled=0

EAPOL: External notification - portValid=0

SIOCGIWRANGE: WE(compiled)=19 WE(source)=18 enc_capa=0xe

  capabilities: key_mgmt 0xa enc 0xf

Own MAC address: 00:14:a4:30:9e:b0

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

Setting scan request: 0 sec 100000 usec

Using existing control interface directory.

Added interface wlan0

Wireless event: cmd=0x8b06 len=12

RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added

RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added

State: DISCONNECTED -> SCANNING

Starting AP scan (broadcast SSID)

RX EAPOL from 00:0f:3d:39:17:7c

RX EAPOL - hexdump(len=99): 01 03 00 5f fe 00 89 00 20 00 00 00 00 00 00 00 03 d0 29 70 98 1b ed 65 91 00 17 fd 2c b6 35 80 ae fd 0b 1d db e3 c2 d1 71 c9 b9 5a b4 a2 91 fd 73 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Setting authentication timeout: 10 sec 0 usec

EAPOL: Ignoring WPA EAPOL-Key frame in EAPOL state machines

IEEE 802.1X RX: version=1 type=3 length=95

  EAPOL-Key type=254

WPA: RX EAPOL-Key - hexdump(len=99): 01 03 00 5f fe 00 89 00 20 00 00 00 00 00 00 00 03 d0 29 70 98 1b ed 65 91 00 17 fd 2c b6 35 80 ae fd 0b 1d db e3 c2 d1 71 c9 b9 5a b4 a2 91 fd 73 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

State: SCANNING -> 4WAY_HANDSHAKE

WPA: RX message 1 of 4-Way Handshake from 00:0f:3d:39:17:7c (ver=1)

WPA: No assoc_wpa_ie set - cannot generate msg 2/4

Scan timeout - try to get results

Received 631 bytes of scan results (2 BSSes)

Scan results: 2

Selecting BSS from priority group 1

0: 00:0f:3d:39:17:7c ssid='8v4rtyu' wpa_ie_len=24 rsn_ie_len=0 caps=0x11

   selected based on WPA IE

Trying to associate with 00:0f:3d:39:17:7c (SSID='8v4rtyu' freq=2427 MHz)

Cancelling scan request

WPA: clearing own WPA/RSN IE

Automatic auth_alg selection: 0x1

WPA: using IEEE 802.11i/D3.0

WPA: Selected cipher suites: group 8 pairwise 8 key_mgmt 2

WPA: set AP WPA IE - hexdump(len=24): dd 16 00 50 f2 01 01 00 00 50 f2 02 01 00 00 50 f2 02 01 00 00 50 f2 02

WPA: clearing AP RSN IE

WPA: using GTK TKIP

WPA: using PTK TKIP

WPA: using KEY_MGMT WPA-PSK

WPA: Set own WPA IE default - hexdump(len=24): dd 16 00 50 f2 01 01 00 00 50 f2 02 01 00 00 50 f2 02 01 00 00 50 f2 02

No keys have been configured - skip key clearing

State: 4WAY_HANDSHAKE -> ASSOCIATING

Setting authentication timeout: 10 sec 0 usec

EAPOL: External notification - EAP success=0

EAPOL: External notification - EAP fail=0

EAPOL: External notification - portControl=Auto

RX EAPOL from 00:0f:3d:39:17:7c

RX EAPOL - hexdump(len=99): 01 03 00 5f fe 00 89 00 20 00 00 00 00 00 00 00 04 d0 29 70 98 1b ed 65 91 00 17 fd 2c b6 35 80 ae fd 0b 1d db e3 c2 d1 71 c9 b9 5a b4 a2 91 fd 73 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

IEEE 802.1X RX: version=1 type=3 length=95

  EAPOL-Key type=254

WPA: RX EAPOL-Key - hexdump(len=99): 01 03 00 5f fe 00 89 00 20 00 00 00 00 00 00 00 04 d0 29 70 98 1b ed 65 91 00 17 fd 2c b6 35 80 ae fd 0b 1d db e3 c2 d1 71 c9 b9 5a b4 a2 91 fd 73 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

State: ASSOCIATING -> 4WAY_HANDSHAKE

WPA: RX message 1 of 4-Way Handshake from 00:0f:3d:39:17:7c (ver=1)

WPA: WPA IE for msg 2/4 - hexdump(len=24): dd 16 00 50 f2 01 01 00 00 50 f2 02 01 00 00 50 f2 02 01 00 00 50 f2 02

WPA: Renewed SNonce - hexdump(len=32): 06 59 18 60 5d ab b4 e8 2d 40 f9 23 ee 30 86 9f 64 21 5e f5 09 40 c6 eb 44 57 c7 1c 0f 15 5d 27

WPA: PMK - hexdump(len=32): [REMOVED]

WPA: PTK - hexdump(len=64): [REMOVED]

WPA: Sending EAPOL-Key 2/4

WPA: TX EAPOL-Key - hexdump(len=123): 01 03 00 77 fe 01 09 00 20 00 00 00 00 00 00 00 04 06 59 18 60 5d ab b4 e8 2d 40 f9 23 ee 30 86 9f 64 21 5e f5 09 40 c6 eb 44 57 c7 1c 0f 15 5d 27 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 4f cc ef 98 4f 0e 73 84 fc 48 fa 14 e2 5e 4c 36 00 18 dd 16 00 50 f2 01 01 00 00 50 f2 02 01 00 00 50 f2 02 01 00 00 50 f2 02

RX EAPOL from 00:0f:3d:39:17:7c

RX EAPOL - hexdump(len=123): 01 03 00 77 fe 01 c9 00 20 00 00 00 00 00 00 00 05 d0 29 70 98 1b ed 65 91 00 17 fd 2c b6 35 80 ae fd 0b 1d db e3 c2 d1 71 c9 b9 5a b4 a2 91 fd 73 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 b6 82 30 56 a3 ba e0 26 4d e8 ee d2 12 8c 38 9b 00 18 dd 16 00 50 f2 01 01 00 00 50 f2 02 01 00 00 50 f2 02 01 00 00 50 f2 02

IEEE 802.1X RX: version=1 type=3 length=119

  EAPOL-Key type=254

WPA: RX EAPOL-Key - hexdump(len=123): 01 03 00 77 fe 01 c9 00 20 00 00 00 00 00 00 00 05 d0 29 70 98 1b ed 65 91 00 17 fd 2c b6 35 80 ae fd 0b 1d db e3 c2 d1 71 c9 b9 5a b4 a2 91 fd 73 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 b6 82 30 56 a3 ba e0 26 4d e8 ee d2 12 8c 38 9b 00 18 dd 16 00 50 f2 01 01 00 00 50 f2 02 01 00 00 50 f2 02 01 00 00 50 f2 02

State: 4WAY_HANDSHAKE -> 4WAY_HANDSHAKE

WPA: RX message 3 of 4-Way Handshake from 00:0f:3d:39:17:7c (ver=1)

WPA: IE KeyData - hexdump(len=24): dd 16 00 50 f2 01 01 00 00 50 f2 02 01 00 00 50 f2 02 01 00 00 50 f2 02

WPA: Sending EAPOL-Key 4/4

WPA: TX EAPOL-Key - hexdump(len=99): 01 03 00 5f fe 01 09 00 20 00 00 00 00 00 00 00 05 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3d 4f e3 89 31 7e a1 02 25 1b cf 55 d7 ea 90 e4 00 00

WPA: Installing PTK to the driver.

WPA: RSC - hexdump(len=6): 00 00 00 00 00 00

State: 4WAY_HANDSHAKE -> GROUP_HANDSHAKE

RX EAPOL from 00:0f:3d:39:17:7c

RX EAPOL - hexdump(len=131): 01 03 00 7f fe 03 91 00 20 00 00 00 00 00 00 00 06 74 03 4c e1 ce 28 2b c1 2e 0b 64 bc ce 8d 4b c0 ee 82 f5 06 7f b1 b6 ce 70 b8 d2 f7 23 c0 a8 94 6e be d1 3c d4 f6 a3 ad bc 01 28 0d 70 6d 8b 0a 20 a3 72 80 ff ff ff ff 00 00 00 00 00 00 00 00 f0 bc f6 11 9e 4c 7f fd 9f 1a d1 fe 6b 03 58 6b 00 20 25 06 7f fa f0 0d d4 26 74 60 e3 4c 70 fa 96 1d 69 9e 12 13 2e 44 45 66 fc 77 26 d9 ff 3c cc 6e

IEEE 802.1X RX: version=1 type=3 length=127

  EAPOL-Key type=254

WPA: RX EAPOL-Key - hexdump(len=131): 01 03 00 7f fe 03 91 00 20 00 00 00 00 00 00 00 06 74 03 4c e1 ce 28 2b c1 2e 0b 64 bc ce 8d 4b c0 ee 82 f5 06 7f b1 b6 ce 70 b8 d2 f7 23 c0 a8 94 6e be d1 3c d4 f6 a3 ad bc 01 28 0d 70 6d 8b 0a 20 a3 72 80 ff ff ff ff 00 00 00 00 00 00 00 00 f0 bc f6 11 9e 4c 7f fd 9f 1a d1 fe 6b 03 58 6b 00 20 25 06 7f fa f0 0d d4 26 74 60 e3 4c 70 fa 96 1d 69 9e 12 13 2e 44 45 66 fc 77 26 d9 ff 3c cc 6e

WPA: RX message 1 of Group Key or STAKey Handshake from 00:0f:3d:39:17:7c (ver=1)

State: GROUP_HANDSHAKE -> GROUP_HANDSHAKE

WPA: Group Key - hexdump(len=32): [REMOVED]

WPA: Installing GTK to the driver (keyidx=1 tx=0).

WPA: RSC - hexdump(len=6): 20 a3 72 80 ff ff

WPA: Sending EAPOL-Key 2/2

WPA: TX EAPOL-Key - hexdump(len=99): 01 03 00 5f fe 03 11 00 20 00 00 00 00 00 00 00 06 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 d5 c4 97 2b 0f c0 ca 89 3e ea 4e 09 24 2c 08 fc 00 00

WPA: Key negotiation completed with 00:0f:3d:39:17:7c [PTK=TKIP GTK=TKIP]

Cancelling authentication timeout

State: GROUP_HANDSHAKE -> COMPLETED

CTRL-EVENT-CONNECTED - Connection to 00:00:00:00:00:00 completed (auth)

EAPOL: External notification - portValid=1

EAPOL: External notification - EAP success=1

EAP: EAP entering state DISABLED

RX EAPOL from 00:0f:3d:39:17:7c

RX EAPOL - hexdump(len=99): 01 03 00 5f fe 00 89 00 20 00 00 00 00 00 00 00 01 53 4a ae 74 50 66 0b 83 d2 7d f1 c6 37 6a ee cb 83 0f ef 2a f3 21 2f 73 df e5 4b 3a db a6 0e 4c 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

IEEE 802.1X RX: version=1 type=3 length=95

  EAPOL-Key type=254

WPA: RX EAPOL-Key - hexdump(len=99): 01 03 00 5f fe 00 89 00 20 00 00 00 00 00 00 00 01 53 4a ae 74 50 66 0b 83 d2 7d f1 c6 37 6a ee cb 83 0f ef 2a f3 21 2f 73 df e5 4b 3a db a6 0e 4c 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

WPA: EAPOL-Key Replay Counter did not increase - dropping packet

```

Here is my lspci for network adaptors:

```
05:00.0 Ethernet controller: Broadcom Corporation NetLink BCM5789 Gigabit Ethernet PCI Express (rev 11)

06:02.0 Network controller: Broadcom Corporation BCM4318 [AirForce One 54g] 802.11g Wireless LAN Controller (rev 02)

```

I don't know if it is inter-related, but if my nic driver is compiled as a module (tg3), I can't get an ip from dhcpcd. If my nic driver is compiled in the kernel, my net.eth0 gets an ip from dhcpcd. Also ifplugd doesn't seem to work, as it doesn't bring up or down my net.eth0 if I plug-unplug the cable.

I am using:

baselayout-1.11.13-r1

ndiswrapper-1.5

wpa_supplicant-0.4.7

gentoo-sources-2.6.14-r2

ifplugd-0.28-r4

dhcpcd-2.0.0

Edit (2006-01-01 17h00)

I update baselayout to version 1.12.0_pre12. Now ifplugd is working but I still doesn't have an ip for my wlan0:

```
ferrari ~ # /etc/init.d/net.wlan0 start

 * Starting wlan0

 *   Starting wpa_supplicant on wlan0 ...                                 [ ok ]

 *   Starting wpa_cli on wlan0 ...                                        [ ok ]

 *     Failed to configure wlan0 in the background                        [ !! ]

```

If I configure a static ip for wlan0, I don't have this error anymore and it says that wlan0 has the ip. But when I try to go to the internet, it doesn't work.

----------

## arabis

Bump

Any ideas?   :Confused: 

----------

## andyrewbobb

same problem, i was able to get it working using iwconfig then dhcp, which leads me to believe that im not getting wpa_supplicant to auth right, however, 

wpa_gui seems to indicate that i have

----------

## arabis

I compiled these as modules in my kernel:

```
--- Networking support                                   

          Networking options  --->                         

  [ ]   Amateur Radio support  --->                         

  < >   IrDA (infrared) subsystem support  --->       

  < >   Bluetooth subsystem support  --->                   

  <M>   Generic IEEE 802.11 Networking Stack         

  [  ]     Enable full debugging output (NEW)               

  <M>     IEEE 802.11 WEP encryption (802.1x)               

  <M>     IEEE 802.11i CCMP support                       

  <M>     IEEE 802.11i TKIP encryption
```

added this to modules.autoload/kernel2.6:

```
ieee80211_crypt_wep

ieee80211_crypt_tkip

ieee80211_crypt_ccmp
```

Hoping I found the solution, but the problem stays the same (no dhcp)  :Sad:  .

----------

## bommee

Any progress on this one?  I am having a real slog getting even WEP to work.  Why am I posting to a WPA thread about a problem with WEP?  I fell back to WEP when I couldn't get WPA to go.  

I am getting the following from /etc/init.d/net.wlan0 start

```
* Starting wlan0

 *   Configuring wireless network for wlan0

 *     wlan0 connected to "linksys" at 00:12:17:46:DC:11

 *     in managed mode (WEP disabled)

 *   Bringing up wlan0

 *     dhcp

 *       Running dhcpcd ...                                                                                               [ !! ]
```

The thing that is really curious is that it is connecting to the AP but it is stating that WEP is disabled.  There is no open connection to that AP and I have given it a WEP key.  I am adding the modules you mentioned into the kernel to see if it helps at all.  I will keep you posted.

----------

## bommee

No luck with the modules you mentioned either.  Guess I shouldn't be surprised.  

Here is what I have tried and the result so far:

It appears I can get wlan0 up and talking to the AP by issuing the following commands:

```
bash ~ # iwconfig wlan0 key open <wep key>

bash ~ # iwconfig wlan0 essid <linksys 54G>

bash ~ # ifconfig wlan0 192.168.2.50
```

I can even SSH to 192.168.2.50...until I shut down eth0 (my wired connection) at which point networking fails entirely.

If I do:

```
bash ~ # ifconfig wlan0 up

bash ~ # dhcpcd -do wlan0
```

It eventually times out without an IP and the following log message:

```
Jan 11 11:58:32 mgwj dhcpcd[7116]: broadcasting DHCP_REQUEST for 192.168.2.104

Jan 11 11:58:47 mgwj dhcpcd[7116]: timed out waiting for DHCP_ACK response

Jan 11 11:58:47 mgwj dhcpcd[7116]: broadcasting DHCP_DISCOVER

Jan 11 11:59:02 mgwj dhcpcd[7116]: timed out waiting for a valid DHCP server response
```

I am staring to wonder if there is an issue with my router (WRT54G) giving out two IPs for the same host name.  When I look at the wireless client MAC list I see the MAC of the wireless card in my linux box, but with no host name.

Any thoughts here?

----------

## UberLord

Maybe a router issue.

I can run my DrayTek Vigor 2600 in WEP&WPA mode. Everthing I have works fine like this except for the rt2500 driver which only works if router does either WEP or WPA, but not both at the same time. Weird huh?

----------

## arabis

I have noticed this in my /var/log/messages:

```
an 11 18:08:51 ferrari ifplugd(eth0)[5781]: client:  wpa_supplicant_eth0 does not define a driver

Jan 11 18:08:51 ferrari rc-scripts: wpa_supplicant_eth0 does not define a driver

Jan 11 18:08:51 ferrari dhcpcd[6666]: infinite IP address lease time. Exiting

Jan 11 18:08:52 ferrari ifplugd(eth0)[5781]: Program executed successfully.

```

How come ifplugd expects a driver for my wired interface? I've search the forum, but no clue. I was thinking that maybe these messages will bring me a clue for my problem:I still don't get and IP from dhcpcd for my net.wlan0.

----------

## bommee

I'm going to suggest that you need to change the /etc/conf.d/net from what you suggested in your first post (presuming they are the same) 

 *Quote:*   

> modules=( "wpa_supplicant" )

 

To modules_wlan0=( "wpa_supplicant" ).

I am guessing that /etc/init.d/net.* is looking at /etc/conf.d/net and seeing the generic "modules=" thinks it should be for all adapters and that is causing the error.

Let me know if that helps.

----------

## arabis

to bommee:

I did what you suggested, I modified my 

```
modules=( "wpa_supplicant" )
```

to

```
modules_wlan0=( "wpa_supplicant" )
```

in my /etc/conf.d/net.

I got rid of these:

```
wpa_supplicant_eth0 does not define a driver
```

but I still have:

```
ferrari ~ # /etc/init.d/net.wlan0 start

 * Starting wlan0

 *   Starting wpa_supplicant on wlan0 ...                                                 [ ok ]

 *   Starting wpa_cli on wlan0 ...                                                            [ ok ]

 *     Failed to configure wlan0 in the background                                     [ !! ]

```

Anyway, thanks for your suggestion, it's a step to the good direction.  :Smile: 

----------

## bommee

It looks to me like upgrading Baseutils might have been a step in the wrong direction.  It seemed you were connecting to the AP before and now you aren't.

Have you tried running 

```
wpa_supplicant -dd -iwlan0 -c/etc/wpa_supplicant.conf -Dndiswrapper
```

 then running 

```
ifconfig wlan up
```

 and finally 

```
dhcpcd -do wlan0
```

The "-do" for dhcpcd should keep the interface alive and give you output to your /var/log/messages.  

If that doesn't help post your /etc/conf.d/net, /etc/wpa_supplicant.conf and the relevant tail of your /var/log/messages.  Also is there anything interesting going on in dmesg?

----------

## arabis

To bommee:

I did what you said but no success.

I always get positively authenticated

```
State: GROUP_HANDSHAKE -> COMPLETED

CTRL-EVENT-CONNECTED - Connection to 00:0f:3d:39:17:7c completed (auth)

EAPOL: External notification - portValid=1

EAPOL: External notification - EAP success=1

EAPOL: SUPP_PAE entering state AUTHENTICATING

EAPOL: SUPP_BE entering state SUCCESS

EAP: EAP entering state DISABLED

EAPOL: SUPP_PAE entering state AUTHENTICATED

EAPOL: SUPP_BE entering state IDLE

EAPOL: startWhen --> 0

```

But no ip:

```
ferrari ~ # ifconfig

eth0      Lien encap:Ethernet  HWaddr 00:C0:9F:A1:CE:23

          inet adr:192.168.0.102  Bcast:192.168.0.255  Masque:255.255.255.0

          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1

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

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

          collisions:0 lg file transmission:1000

          RX bytes:22363809 (21.3 Mb)  TX bytes:1266940 (1.2 Mb)

          Interruption:17

lo        Lien encap:Boucle locale

          inet adr:127.0.0.1  Masque:255.0.0.0

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

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

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

          collisions:0 lg file transmission:0

          RX bytes:400 (400.0 b)  TX bytes:400 (400.0 b)

wlan0     Lien encap:Ethernet  HWaddr 00:14:A4:30:9E:B0

          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1

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

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

          collisions:0 lg file transmission:1000

          RX bytes:4858 (4.7 Kb)  TX bytes:10170 (9.9 Kb)

          Interruption:21 Mémoire:c0304000-c0306000

```

My /etc/conf.d/net:

```
config_eth0=( "dhcp" )

dhcpcd_eth0="-t 10 -Y -N"

config_wlan0=( "dhcp" )

#modules=( "iwconfig" )

modules_wlan0=( "wpa_supplicant" )

wpa_supplicant_wlan0="-Dndiswrapper"

wpa_timeout_wlan0=30

dhcpcd_wlan0="-t 10"

config_ppp0=( "ppp" )

link_ppp0="/dev/ttySL0"

```

My /etc/wpa_supplicant.conf:

```
ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=0

ap_scan=1

fast_reauth=1

network={

        ssid="8v4rtyu"

        psk="084jst5578b7mowz233"

        proto=WPA

        key_mgmt=WPA-PSK

        pairwise=TKIP

}

```

My /var/log/messages:

```
an 11 21:12:30 ferrari dhcpcd[20908]: broadcasting DHCP_REQUEST for 192.168.0.103

Jan 11 21:13:30 ferrari dhcpcd[20908]: timed out waiting for DHCP_ACK response

Jan 11 21:13:30 ferrari dhcpcd[20908]: broadcasting DHCP_DISCOVER

Jan 11 21:14:30 ferrari dhcpcd[20908]: timed out waiting for a valid DHCP server response

```

----------

## bommee

Ok kinda grasping here but a few things to try....

Can you run the following and paste the output back here: "iwlist wlan0 scan"

Also I would change the psk value in the network block to the use the output from wpa_passphrase.  You will get something like the following:

```
network={

        ssid="8v4rtyu"

        #psk="084jst5578b7mowz233"

        psk=59c99fc7fb1a178aaf603be96b942e7eae163a4a902392a44734348cda4bf143

}
```

In fact that might be exact unless you have changed either the essid or the psk you posted earlier.  Make sure the output in your /etc/wpa_supplicant.conf is exactly as shown in the output of wpa_passphrase.  This isn't going to help with getting you authenticated it will just speed it up.

I know what you are thinking...you get authenticated.  I guess the reason I am suggesting this course of action is that in your first post you make it past configuring wlan0 then it appears it is broken after the upgrade of the baselayout.  I am wondering if something else might have changed.  You might even try using the /etc/wpa_supplicant.conf that you had listed in your first post and see if you get further.

One other thing you might consider if you have two interfaces from the same machine (which it looks like) connecting to the same router (not sure about that) is to if possible set up Static DHCP for each interface at the router.  I was having issues with my router not getting a host name for my second interface.  I am not sure if that was tripping up the IP leasing or not but going to Static DHCP fixed it.

----------

## arabis

To bommee:

Here is the output of "iwlist wlan0 scan":

```
ferrari ~ # iwlist wlan0 scan

wlan0     Scan completed :

          Cell 01 - Address: 00:0F:3D:39:17:7C

                    ESSID:"8v4rtyu"

                    Protocol:IEEE 802.11g

                    Mode:Managed

                    Frequency:2.427 GHz (Channel 4)

                    Quality:0/100  Signal level:-36 dBm  Noise level:-256 dBm

                    Encryption key:on

                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 6 Mb/s; 9 Mb/s

                              11 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s

                              48 Mb/s; 54 Mb/s

                    Extra:bcn_int=100

                    Extra:atim=0

                    Extra:wpa_ie=dd160050f20101000050f20201000050f20201000050f202

```

I tried with my fist wpa_supplicant.conf and with the output from wpa_passphrase. Again, I got autenticated but no ip.

My router list my wlan0 with an ip and the proper hostname "ferrari" (as I see it on my router page):

```
Dynamic DHCP Client List

Host Name    IP Address    MAC Address    Expired Time    

ferrari   192.168.0.103   00-14-a4-30-9e-b0   Aug/24/2019 20:06:32

unknown   192.168.0.102   00-c0-9f-a1-ce-23   Jan/20/2006 19:27:44
```

BUT my laptop doesn't get this ip  :Sad: .

With static everything seem correct but no internet  :Crying or Very sad:  

```
ferrari ~ # ifconfig wlan0

wlan0     Lien encap:Ethernet  HWaddr 00:14:A4:30:9E:B0

          inet adr:192.168.0.103  Bcast:192.168.0.255  Masque:255.255.255.0

          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1

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

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

          collisions:0 lg file transmission:1000

          RX bytes:24063 (23.4 Kb)  TX bytes:7269 (7.0 Kb)

          Interruption:21 Mémoire:c0304000-c0306000

```

----------

## arabis

By the way, in order to use WPA, I would like to know if supports for WEP, TKIP, CCMP from the kernel (as modules or compiled in) are needed if I am using ndiswrapper because I suspect that driver includes already these supports. Am I right? or feel free to correct me.

----------

## arabis

Some thoughts:

Is it a bug? And if it is, from what?

Router: I don't think it is a router issue since WPA works under Windows with the wired interface plugged in or not.

Driver: The driver "bcmwl5" is working under Windows with WPA but Windows use the 32 bits version (under Gentoo, I am using the 64 bits version).

Ndiswrapper: I get this message ( from /var/log/messages) when loading ndiswrapper

```
wlan0: ndiswrapper ethernet device 00:14:a4:30:9e:b0 using driver bcmwl5, 14E4:4318.5.conf

wlan0: encryption modes supported: WEP; TKIP with WPA, WPA2, WPA2PSK; AES/CCMP with WPA, WPA2, WPA2PSK 
```

I don't see "TKIP with WPAPSK" so can I conclude that it is not supported?

and finally WPA-SUPPLICANT (many people seem having problems to get it working).

I would appreciate some infomation about these questions  :Smile: 

----------

## bommee

I am guessing that you are using X on your laptop.  If that is the case you might try using net-wireless/waveselect or net-wireless/wlassistant.  I have read a couple of posts where waveselect has come in quite handy to configure wpa_supplicant in cases where the user was having difficulty with their settings.  It might seem like a bit of a cheat but if it works it means you are up and running and get to learn the errors that were made.

Given that you can connect to the AP it seems to rule out the driver as a problem; ndiswrapper seems to think that the driver is working with the hardware as well.  Beyond that is is kinda hard to be sure.  You could use the process of elimination to see where things are falling apart.  Turn off security on the AP and test to see if you can connect and get an IP.  That would show you that you have the correct driver, that the AP is fine communicating with your machine and leasing you an IP (DHCP).  Then if you want to be sure about the encryption mode (TKIP with WPA-PSK) turn on WEP at the AP and attempt to connect again.  If all works up to this point then perhaps it is an issue with the protocol.  I have to admit I would try waveselect first and see what the results are before I went to the trouble.

----------

## arabis

 *Quote:*   

> you might try using net-wireless/waveselect or net-wireless/wlassistant

 

Good suggestion!  :Very Happy:  . I will try net-wireless/wlassistant ( net-wireless/waveselect: there is no ebuild for amd64)

When the security is turned off on the AP, my wireless card works fine, I get an ip from my AP and I can go to the internet. With WPA, no internet  :Confused: 

I saw on the forum that the linux driver bcm43xx is now in Portage. Maybe I'm gonna try this one instead Ndiswrapper. But in order to do that, I am a little bit confused how to switch from Ndiswrapper to this one. Ndiswrapper module is loaded automatically when I start my wlan0 because I have a file called ndiswrapper in my /etc/modules.d/ with this:

```
# modules.d configuration file for NDISWRAPPER

# Internal Aliases - Do not edit

# ------------------------------

alias wlan0 ndiswrapper

# Configurable module parameters

# ------------------------------

# hangcheck_interval:   The interval, in seconds, for checking if driver is hung. (default: 0)

# debug:   debug level

# proc_gid:   The gid of the files created in /proc (default: 0).

# proc_uid:   The uid of the files created in /proc (default: 0).

# if_name:   Network interface name or template (default: wlan%d)
```

Can I remove it safely?

----------

## fyreflyer

I was just searching for a fix to this same problem.  One thing to note is that ndiswrapper with wpa_supplicant works fine for me using kernel 2.6.12-gentoo-r10.  Any kernel more recent than that fails.

----------

## fyreflyer

Update: I just got it working by switching the bcmwl5 driver to the Windows 2000 version, dated June 1, 2004.

----------

## arabis

To fireflyer:

I guess that you are using a 32 bits version of bcmwl5.

Correct me if I'm wrong but I don't think I can use this one on my 64 bits platform.

----------

