PDA

View Full Version : wep 128bit


andycapp
05-05-2008, 01:23 PM
Hi guys,

I've installed FreeBSD 7.0 RELEASE on my laptop, configured all, video, sound, samba and networks. I wrote different scripts for various wlan environment (I want to use it for work).
I use a pcmcia wireless card.
In my home wlan environment I can associate with ssid and obtain IP form the router and it works fine (wpa mode).
When I try wep128 mode I can associate with my ssid but I can't obtain IP (by dhclient), and also giving IP manually I can't ping.
Ifconfig tells me that wlan is associated.
this is the script:

#!/bin/sh
ifconfig ral0 up
wpa_supplicant -B -iral0 -c/root/wlan/wep128.conf
dhclient ral0

and this is the .conf file

ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel
network={
ssid="3Com"
key_mgmt=NONE
wep_tx_keyidx=1
wep_key1=98402d9b0f57f4bbc2d6d3206b
}

any suggestions ?

richardpl
05-05-2008, 01:39 PM
For wep (please dont use any kind of wep) configuration could be done through ifconfig like this (not through wpa_supplicant, probably wpa_supplicant is not compiled with wep support in ):

ifconfig ral0 ssid 3Com weptxkey 1 wepmode on wepkey 98402d9b0f57f4bbc2d6d3206b

phoenix
05-05-2008, 04:47 PM
wpa_supplicant includes WEP support by default. Personally, I find using wpa_supplicant to be preferable, as you can keep *all* the details for all the networks you connect to in one spot, your rc.conf becomes a simple ifconfig_ath0="WPA DHCP", and you can "roam" around without mucking around with ifconfig commands.

In your /etc/wpa_supplicant.conf, hex keys are written with 0x as the prefix. Otherwise it's considered a decimal number or a string.

andycapp
05-05-2008, 06:05 PM
the code gave me richardpl works like my script that use wpa_supplicant and I still can't obtain IP address from router by dhclient.

In my rc.conf I don't have ifconfig_ral0="WPA DHCP" and my script for wpa mode works fine

here is the code :

#!/bin/sh
ifconfig ral0 up
wpa_supplicant -B -iral0 -c/root/wlan/wpa.conf
dhclient ral0

and this is the .conf file :

ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel
network={
ssid="3Com"
psk="veryverysecretpassword"
}

so the question is the same : why in wpa mode I can obtain IP and when in wep mode not ?
I remember you that I can associate with ssid but also giving an IP manually I can't ping. dhclient fails

phoenix
05-05-2008, 09:45 PM
Use your original script (or write a proper /etc/wpa_supplicant.conf and use a proper /etc/rc.conf) but prefix your key with 0x. Without that, it's not being treated as a hex key, and the key set on your NIC will not be the same as the key in your router.

richardpl
05-05-2008, 11:41 PM
YEAH, I somehow (dont shot me because of this :p) overlooked fact that 0x is not given. It must be given otherwise key will be considered in ASCII - meaning it will be incorrect key in most situations.

Hate such mistakes

andycapp
05-06-2008, 07:49 AM
I tryed to give 0x but in this case it reports an error.
I can associate with my ssid without 0x, so I guess my syntax is correct