# ipw2200 & wpa_supplicant, dhcp not working on boot [SOLVED]

## dgaffuri

I've recently changed my wireless configuration from iwconfig to wpa_supplicant, because of changed security settings of the network configuration at work. Now dhcp is no more able to get and address at boot, but it works each time when running net.eth1 start _after_ boot. This happen at work and at home, where I have an open WEP network.

Packages merged

```
[ebuild   R   ] net-wireless/ipw2200-1.0.8  -debug -radiotap 0 kB

[ebuild   R   ] net-wireless/ipw2200-firmware-2.4  0 kB

[ebuild   R   ] net-wireless/ieee80211-1.1.6  -debug 0 kB

[ebuild   R   ] net-wireless/wpa_supplicant-0.4.6  -debug -gsm -madwifi +qt +readline +ssl 0 kB
```

wpa_supplicant configuration

```
# EAP-PEAP/MSCHAPv2 configuration at work

network={

        ssid="<work essid>"

        key_mgmt=IEEE8021X

        eap=PEAP

        identity="<username>@<domain>"

        password="<password>"

        phase2="auth=MSCHAPV2"

}

# Open WEP key connection at home

network={

        ssid="<home essid>"

        key_mgmt=NONE

        wep_key0=<hex wep key>

        wep_tx_keyidx=0

}
```

Kernel is 2.6.14. It works well at home with iwconfig.

Any ideas? Thanks in advance.

----------

## dgaffuri

Some update.

What's really happening is that wpa_supplicant is not working correctly the first time after the netword card is initialized. If I remove ipw2200 module and then modprobe it again, or even if I run

```
ipwpriv eth1 sw_reset
```

the next time that wpa_supplicant is started DHCP doesn't work (it get timeouts on bot DHCP_REQUEST and DHCP_DISCOVER). If I kill and restart wpa_supplicant all is OK. It works even if I reset the card while wpa_supplicant is running and then kill and restart it.

No one with similar problems?

----------

## Wildcat1

I'm using ndiswrapper for my adapter and was experiencing the same problems. after reading your post I got the idea that maybe my adapter ( Netgear wg111v2 usb stick ) wasn't having enough time to initialize before wpa_supplicant started messing with it. This is a pretty cheap fix in my opinion but it worked for me - I rearranged my  /etc/modules.autoload.d/kernel-2.6 file so that ndiswrapper was the first line - and it worked!

I think I saw somewhere theres a better way to pause and let your adapter initialize but I can't find it anymore.. maybe someone else knows?

----------

## namo

 *Wildcat1 wrote:*   

> I think I saw somewhere theres a better way to pause and let your adapter initialize but I can't find it anymore.. maybe someone else knows?

 

```
options:

  -B = run daemon in the background

  -d = increase debugging verbosity (-dd even more)

  -K = include keys (passwords, etc.) in debug output

  -t = include timestamp in debug messages

  -h = show this help text

  -L = show license (GPL and BSD)

  -q = decrease debugging verbosity (-qq even less)

  -v = show version

  -w = wait for interface to be added, if needed

  -N = start describing new interface
```

Maybe the -w option is what you're looking for ?

----------

## dgaffuri

Well, it seems I've solved. In the meantime I changed so many things that I really don't know why. Kernel is 2.6.15-rc5 with ipw2200 and ieee80211 built as modules (I unmerged portage packages). This is my /etc/conf.d/net (it seems that it started working after some change here)

```
# grep -v -e '^$\|^#' /etc/conf.d/net

modules_eth1=( "wpa_supplicant" )

wpa_supplicant_eth1="-Dwext"

associate_timeout_eth1="30"

config_eth0=( "dhcp" )

config_eth1=( "dhcp" )

dhcpcd_eth0="-t 10"

dhcpcd_eth1="-t 10"

plug_timeout="20"

modules_eth1=( "!plug" )
```

Previously I had

```
hotplug_eth1="no"
```

but it didn't work even without.

I emerged netplug and unmerged ifplugd. And I'm using (this didn't change) sys-apps/baselayout-1.12.0_pre11-r3.

----------

## beatryder

```
plug_timeout="20" 

 modules_eth1=( "!plug" )
```

What are those all about??

----------

