wpa_supplicant and WEP....

Tai-hwa Liang avatar at mmlab.cse.yzu.edu.tw
Fri Sep 30 18:47:39 PDT 2005


On Fri, 30 Sep 2005, Eric Schuele wrote:
> Hello,
>
> I have gotten wpa_supplicant to work fine for WPA-PSK and open sites... but I 
> would like it to work with WEP as well.  it appears to associate with a WEP 
> site no matter what WEP key I give it.  But whether the key is correct or 
> not... I can not get a response from my DHCP server.
>
> My wpa_supplicant entry:
>   (Note that no matter what I put for the key... I still get assoc.)
> network={
>   ssid="OfficeSSID"
>   scan_ssid=1
>   key_mgmt=NONE
>   wep_tx_keyidx=0
>   wep_key0="OfficeKey"
> }
> My dhclient.conf entry:
> interface "ath0" {
>  send dhcp-client-identifier "fangorn";
>  request subnet-mask, broadcast-address, routers, domain-name-servers, 
> domain-name;
> }
>
> Kernel Config: (are wlan_* necessary?)

   If you are using WEP only, wlan + wlan_wep should be enough.

> # Wireless LAN support
> device        wlan        # 802.11 support
> device        wlan_wep    # WLAN WEP kernel module
> device        wlan_ccmp    # AES-CCMP crypto support
> device        wlan_tkip    # TKIP and Michael cypto support for
>
> # Wirelass NIC cards
> device        ath        # Atheros support
> device        ath_hal        # Atheros HAL
> device        ath_rate_sample # SampleRate Rate Control

   I didn't statically compile these in kernel; however, there should
be no difference between dynamically loaded and statically compiled driver.

> fangorn# wpa_supplicant -i ath0 -c /etc/wpa_supplicant.conf -d &
> [1] 1057
> fangorn# Initializing interface 'ath0' conf '/etc/wpa_supplicant.conf' driver 
> 'default'
> 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 (from group name 'wheel')
> Priority group 0
>   id=0 ssid='home'
>   id=1 ssid='office-g'
>   id=2 ssid='dragnfly'
> Initializing interface (2) 'ath0'
> Own MAC address: 00:0e:9b:53:31:9d
> wpa_driver_bsd_set_wpa: enabled=1
> wpa_driver_bsd_set_wpa_internal: wpa=3 privacy=1
> wpa_driver_bsd_del_key: keyidx=0
> wpa_driver_bsd_del_key: keyidx=1
> wpa_driver_bsd_del_key: keyidx=2
> wpa_driver_bsd_del_key: keyidx=3
> wpa_driver_bsd_set_countermeasures: enabled=0
> wpa_driver_bsd_set_drop_unencrypted: enabled=1
> Setting scan request: 0 sec 100000 usec
> Starting AP scan (specific SSID)
> Scan SSID - hexdump_ascii(len=17):
>     77 4c 41 4e 5f 57 45 50 5f 4b 78 36 4c 30 34 6f   home
>     32                                                2
> Received 0 bytes of scan results (3 BSSes)
> Scan results: 3
> Selecting BSS from priority group 0
> 0: 96:0f:a4:ef:3c:4a ssid='AMO' wpa_ie_len=0 rsn_ie_len=0
>   skip - no WPA/RSN IE
> 1: 00:0c:41:0b:fe:c5 ssid='office-a' wpa_ie_len=0 rsn_ie_len=0
>   skip - no WPA/RSN IE
> 2: 00:0f:66:10:d6:da ssid='' wpa_ie_len=0 rsn_ie_len=0
>   skip - no WPA/RSN IE
> No suitable AP found.
> Setting scan request: 5 sec 0 usec
> Starting AP scan (specific SSID)
> Scan SSID - hexdump_ascii(len=10):
>     6c 61 71 75 69 6e 74 61 2d 67                     office-g
> Received 0 bytes of scan results (3 BSSes)
> Scan results: 3
> Selecting BSS from priority group 0
> 0: 96:0f:a4:ef:3c:4a ssid='AMO' wpa_ie_len=0 rsn_ie_len=0
>   skip - no WPA/RSN IE
> 1: 00:0c:41:0b:fe:c5 ssid='office-a' wpa_ie_len=0 rsn_ie_len=0
>   skip - no WPA/RSN IE
> 2: 00:0f:66:10:d6:da ssid='office-g' wpa_ie_len=0 rsn_ie_len=0
>   skip - no WPA/RSN IE
>   selected non-WPA AP 00:0f:66:10:d6:da ssid='office-g'
> Trying to associate with 00:0f:66:10:d6:da (SSID='office-g' freq=2437 MHz)
> Cancelling scan request
> Automatic auth_alg selection: 0x1
> No keys have been configured - skip key clearing
> wpa_driver_bsd_set_key: alg=WEP addr=ff:ff:ff:ff:ff:ff key_idx=0 set_tx=1 
> seq_len=0 key_len=7
> wpa_driver_bsd_set_drop_unencrypted: enabled=1
> wpa_driver_bsd_associate: ssid 'office-g' wpa ie len 0 pairwise 4 group 4 key 
> mgmt 2
> wpa_driver_bsd_associate: set PRIVACY 1
> Setting authentication timeout: 5 sec 0 usec
> Association event - clear replay counter
> Associated to a new BSS: BSSID=00:0f:66:10:d6:da
> Associated with 00:0f:66:10:d6:da
> Cancelling authentication timeout

   Looks fine to me.

> fangorn# ifconfig
> ath0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
>    inet 0.0.0.0 netmask 0xff000000 broadcast 255.255.255.255
>    ether 00:0e:9b:53:31:9d
>    media: IEEE 802.11 Wireless Ethernet autoselect (DS/1Mbps)
>    status: associated
>    ssid office-g channel 6 bssid 00:0f:66:10:d6:da
>    authmode OPEN privacy ON deftxkey 1 wepkey 1:104-bit txpowmax 54
>    protmode CTS roaming MANUAL bintval 100
> lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
>    inet 127.0.0.1 netmask 0xff000000

   Your station should be associated to the AP at this point. Which implies
the key configuration written in your wpa_supplicant.conf is correct.

> fangorn# dhclient ath0
> DHCPREQUEST on ath0 to 255.255.255.255 port 67
> DHCPREQUEST on ath0 to 255.255.255.255 port 67
> DHCPDISCOVER on ath0 to 255.255.255.255 port 67 interval 6
> DHCPDISCOVER on ath0 to 255.255.255.255 port 67 interval 10
> DHCPDISCOVER on ath0 to 255.255.255.255 port 67 interval 11
> ^C
> fangorn# exit

   This is weird. Did you try to set ath0 IP address manually and ping some
other hosts as well?

   In addition to that, whilst dhclient was acquiring an IP address, was
there any abnormal behaviour(such like re-associate with the AP) on your
wpa_supplicant console?

> uname -a
> FreeBSD fangorn.nxdomain.org 6.0-BETA5 FreeBSD 6.0-BETA5 #29: Wed Sep 28 
> 11:47:26 CDT 2005 root at fangorn.nxdomain.org:/usr/obj/usr/src/sys/CUSTOM_6 
> i386

   My test was on a 3 days old 7-CURRENT but there shouldn't be too much
difference in their net80211 stack and wpa_supplicant.

> What have I done wrong???  Any other info needed can be provided.

   Does your AP suppose to be your DHCP server? If not, try to manually
set the ath0 address and your AP's IP address to the same subnet and
see if you can ping the AP from ath0 after they associate with each other.

   If you don't have problem to ping your AP, there probably be something
wrong between your AP and the real DHCP provider.

-- 
Cheers,

Tai-hwa Liang


More information about the freebsd-current mailing list