# [solved] Problem getting a dhcp address from AP with WPA2

## napoleonb

Hello all,

I'm trying to figure out what's wrong with my wireless settings. I cannot get a dhcp address when my router is set to WPA2 (I can when it's set to WPA). My wireless adaptor is the Intel 4965AGN (iwl4965 driver).

Here are the results I get:

```

# wpa_cli status

Selected interface 'wlan0'

bssid=01:ab:23:cd:45:ef (fake values)

ssid=whatever           (fake name)

id=0

pairwise_cipher=CCMP

group_cipher=CCMP

key_mgmt=WPA2-PSK

wpa_state=COMPLETED

# iwlist wlan0 scan

wlan0     Scan completed :

          Cell 01 - Address: 01:AB:23:CD:45:EF  (fake values)

                    ESSID:"whatever"            (fake name)

                    Mode:Master

                    Channel:6

                    Frequency:2.437 GHz

                    Quality=100/100  Signal level=-28 dBm  Noise level=-93 dBm

                    Encryption key:on

                    IE: IEEE 802.11i/WPA2 Version 1

                        Group Cipher : CCMP

                        Pairwise Ciphers (1) : CCMP

                        Authentication Suites (1) : PSK

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

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

                              48 Mb/s; 54 Mb/s

                    Extra:tsf=00000008e6e7e647

# ifconfig wlan0 (after doing dhcpcd on wlan0 with multiple options including -t 1000)

wlan0     Link encap:Ethernet  HWaddr AB:12:CD:23:EF:45 (fake values)

          inet addr:169.254.126.138  Bcast:169.254.255.255  Mask:255.255.0.0    (apipa address, I guess)

          inet6 addr: fe80::213:e8ff:fe50:4cc9/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

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

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

          collisions:0 txqueuelen:1000

          RX bytes:654 (654.0 b)  TX bytes:20372 (19.8 Kb)

```

The router is a DLink and has the latest firmware installed.Last edited by napoleonb on Wed Nov 14, 2007 6:55 am; edited 1 time in total

----------

## VinzC

Does this post relate the same (kind of) problem?

----------

## napoleonb

I don't think so...

----------

## VinzC

Have you tried other encryption modes?

----------

## napoleonb

As I said in my initial post WPA works. I didn't try WEP as I'm not interested in it. My problems are only with WPA2.

----------

## VinzC

 *napoleonb wrote:*   

> As I said in my initial post WPA works. I didn't try WEP as I'm not interested in it. My problems are only with WPA2.

 

Sorry, didn't read throughout. I know there have been a couple of problems using encryption with Intel Wireless drivers however. I suppose I can safely assume you made sure to load the appropriate encryption modules, din't you?

IWL wifi is still being developped. Make sure you are using the latest version (1.1.21, Nov 1st). Otherwise you still have the opportunity to browse the bug database or post to Intel tech support. You may also continue to post in the thread I indicated before as it relates to Intel new wireless drivers in general, not especialy dedicated to 3945 - the thread started before 4965 was added.

----------

## napoleonb

I have set up wlan0 with a static IP as a temporary measure and that works. dhcp (either with dhcpcd or with udhcpc) doesn't, however.

----------

## VinzC

What version of dhcpcd do you have? I know versions 3.x do have some various issues. You might want to try masked versions.

----------

## napoleonb

I have 3.1.5-r1.

I don't know if it relevant to the problem or not but I get a lot of these in the logs when anything happens on wlan0

CTS protection enabled (BSSID=12:AB:34:CD:56:EF)

CTS protection disabled (BSSID=12:AB:34:CD:56:EF)

Those messages are alternating in abondance (BSSID is the MAC address of the router (fake values shown here)).

Also, yesterday, I said I could work with a static IP but it's not entirely true. The address will work only if the network has been started with the hardwired NIC. Otherwise, the IP is set but the network is unreachable.

----------

## VinzC

It looks to me like it's a bug in the driver. Are you using the latest release of iwlwifi?

----------

## napoleonb

 *VinzC wrote:*   

> It looks to me like it's a bug in the driver. Are you using the latest release of iwlwifi?

 

Yeah, I'm using the 1.1.21 version. The CTS protection message seems to come from the mac80211 kernel module (I found the string in the kernel source tree) and doesn't prevent the wireless connection to work with WPA(1). I've been using the laptop for more than a day emerging a lot of stuff and the connection never dropped. I just can't succesfully connect the laptop to the router using WPA2.

----------

## napoleonb

The problem seems to be fixed. I'm not sure which one of the two things I changed in the kernel did the trick (maybe both), but here are the things I changed:

Activated the "QoS and/or fair queueing" option (in Networking --> Networking options --> QoS and/or fair queueing);

Deactivated all the Wireless LAN options in Device Drivers --> Network device support --> Wireless LAN.

----------

## VinzC

 *napoleonb wrote:*   

> The problem seems to be fixed. I'm not sure which one of the two things I changed in the kernel did the trick (maybe both), but here are the things I changed:
> 
> Activated the "QoS and/or fair queueing" option (in Networking --> Networking options --> QoS and/or fair queueing);
> 
> Deactivated all the Wireless LAN options in Device Drivers --> Network device support --> Wireless LAN.

 

That's interresting. I'd vote for the disabling of Wireless LAN options... That looks more logical to me. If the new wireless stack is completely independent and different from the previous one, then I can understand there might be conflicting modules or components. Glad you fixed it. Don't hesitate to share your experience in the thread I mentioned earlier.

----------

## napoleonb

It definitely has something to do with QoS. I just disabled Qos in the kernel and couldn't make wlan0 work. Also, I think that there is a quirk in the mac80211 kernel module. In the module's helper, we can read the following:

```

Selects: CRYPTO && CRYPTO_ECB && CRYPTO_ARC4 && CRYPTO_AES && CRC32 && WIRELESS_EXT && CFG80211 && NET_SCH_FIFO

```

Now, it selects CONFIG_NET_SCH_FIFO which is a QoS sub-option but it doesn't select QoS itself. I think that CONFIG_NET_SCH_FIFO simply doesn't work if QoS itself (CONFIG_NET_SCHED) isn't enabled.

----------

## VinzC

Well, fortunately I didn't play the lotery  :Laughing:  .

Otherwise it's a good opportunity to file a bug about that.

----------

## hefe

```
14:00.0 Network controller: Intel Corporation Unknown device 4229 (rev 61)
```

Since i removed

```
 -> Device Drivers -> Network device support (NETDEVICES [=y]) -> Wireless LAN
```

and activated 

```
 -> Networking -> Networking support (NET [=y]) -> Networking options -> QoS and/or fair queueing 
```

 i associate to a hot spot where i could not get traffic before.

Note 1: Wireless LAN does not affect built kernel

Note 2: QoS does affect built kernel no matter you select an algorithm or not

Note 3: there were other access points that i could connect to before (they work aswell now)

Seems to be a problem, but i dont know if its a kernel, user, or driver bug  :Very Happy: 

----------

