# WEP wireless doesn't work



## Niltugor (May 18, 2013)

Hello,

I'm new on FreeBSD and I have some problems with my WEP network. I read the FreeBSD documentation and I searched on the internet but I didn't find a solution yet.

I added wlan0 and ifconfig_wlan0 to rc.conf:
`# cat /etc/rc.conf`

```
hostname="Manaudbureau"
keymap="fr-dvorak-bepo"
ifconfig_sge0="DHCP"
sshd_enable="YES"
moused_enable="YES"
ntpd_enable="YES"
powerd_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="NO"
hald_enable="YES"
dbus_enable="YES"
wlans_wi0="wlan0"
ifconfig_wlan0="country FR WPA DHCP"

linux_enable="YES"
```

I configured wpa_supplicant for my WEP network GAS:
`# cat /etc/wpa_supplicant.conf`

```
ctrl_interface=/var/run/wpa_supplicant
eapol_version=2
ap_scan=1
fast_reauth=1

network={
	ssid="GAS"
	priority=1
	key_mgmt=NONE
	wep_tx_keyidx=0
	wep_key0=[I]mykey[/I]
}
```

And I added the wi driver to loader.conf:
`# cat /boot/loader.conf`

```
if_wi_load="YES"
if_rum_load="YES"
wlan_wep_load="YES"
wlan_ccmp_load="YES"
wlan_tkip_load="YES"
```

But it doesn't work . After a `ifconfig wlan0 up` I have:
`ifconfig wi0`

```
wi0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 2290
	ether 00:09:5b:74:63:5f
	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
	media: IEEE 802.11 Wireless Ethernet autoselect mode 11b
	status: associated
```
`ifconfig wlan0`

```
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
	ether 00:09:5b:74:63:5f
	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
	media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
	status: no carrier
	ssid "" channel 1 (2412 MHz 11b)
	regdomain ETSI country FR authmode OPEN privacy OFF txpower 30
	bmiss 7 scanvalid 60 roaming MANUAL
```

When I try to start wpa_supplicant I have this:
`wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf`

```
ioctl[SIOCS80211, op 26, arg 0x3]: Operation not supported
Failed to initialize driver interface
ELOOP: remaining socket: sock=4 eloop_data=0x284081c0 user_data=0x28412080 handler=0x8070bd0
```

So I think there is a problem with that. What am I doing wrong?


----------



## freesbies (May 18, 2013)

Tell me what's your wireless card and *w*hat driver are you running*?*


----------



## Niltugor (May 18, 2013)

My wireless card is a ISL3874 Prism 2.5 and my driver is wi and boots at start (so I added 
	
	



```
if_wi_load="YES"
```
 in loader.conf like it is said in wi(4)).


```
wi0@pci0:0:9:0:	class=0x028000 card=0x41051385 chip=0x38731260 rev=0x01 hdr=0x00
    vendor     = 'Intersil Corporation'
    device     = 'ISL3874 [Prism 2.5]/ISL3872 [Prism 3]'
    class      = network
```


----------



## freesbies (May 18, 2013)

*D*id you run this command as root?

`# wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf`


----------



## Niltugor (May 18, 2013)

Yes, it was as root. Sorry I didn't mention it in my first message.


----------



## freesbies (May 19, 2013)

Try to remove "Country FR" like: `ifconfig_wlan0="WPA DHCP"` on `/etc/rc.conf`


----------



## Niltugor (May 19, 2013)

It seems that doesn't change anything (except for the country of course).
`# ifconfig wlan0`

```
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
	ether 00:09:5b:74:63:5f
	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
	media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
	status: no carrier
	ssid "" channel 1 (2412 MHz 11b)
	country US authmode OPEN privacy OFF txpower 0 bmiss 7 scanvalid 60
	roaming MANUAL bintval 0
```

I don't understand why wpa_supplicant doesn't work.
Also, when I try to connect manually to my network with `# ifconfig wlan0 ssid GAS wepmode on weptxkey 1 wepkey 1:[i]mykey[/i]`, it doesn't work either.
`# ifconfig wlan0`

```
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
	ether 00:09:5b:74:63:5f
	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
	media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
	status: no carrier
	ssid GAS channel 1 (2412 MHz 11b)
	country US authmode OPEN privacy ON deftxkey 1 wepkey 1:104-bit
	txpower 0 bmiss 7 scanvalid 60 roaming MANUAL bintval 0
```

But the network is detected with `# ifconfig wlan0 scan` and I'm sure of the key.


----------



## cederom (May 20, 2013)

The same here: FreeBSD 9.1 AMD64, iwn WiFi module and some old Linksys router. WEP connection is associated but no response from DHCP and no network traffic on manual IP assignment. Tried wpa_supplicant, tried manual ifconfig permutations. Connection to this WEP network works on Android, Linux and Windows, it does not work on FreeBSD. Network on FreeBSD works fine using wpa_supplicant to WPA networks.

It seems FreeBSD has broken WEP support


----------



## wblock@ (May 21, 2013)

The nice thing about WEP is that you can ask the numerous neighbors sharing your connection without permission how they got it to work.

wpa_supplicant.conf(5) says the WEP key must be enclosed in quotes.  Is yours?  There is an example at the end of that man page.

That said... stop using WEP.  Don't use WEP at all, ever, anywhere.  WEP is trivially broken, by anyone, with easily available tools, in minutes.  If you have equipment that only supports WEP, replace it.  If you must use WEP, run IPsec over it so at least they won't be able to use your system after they have easily cracked the WEP keys.  But don't do that, replace WEP with WPA2.


----------



## cederom (May 22, 2013)

I know I can crack WEP too and I know it's insecure but sometimes I _need_ to use it and I don't want to stop my work switch to another OS just because my FreeBSD does not support it


----------



## Niltugor (May 22, 2013)

I replaced WEP with WPA. I changed my wpa_supplicant.conf(5) to :

```
ctrl_interface=/var/run/wpa_supplicant
eapol_version=2
ap_scan=1
fast_reauth=1

network={
	ssid="GAS"
	psk="[I]mynewkey[/I]"
}
```

But when I try to launch wpa_supplicant with `# wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf` I always get:

```
ioctl[SIOCS80211, op 26, arg 0x3]: Operation not supported
Failed to initialize driver interface
ELOOP: remaining socket: sock=4 eloop_data=0x284081c0 user_data=0x28412080 handler=0x8070bd0
```

So the problem is the same as before and I don't understand what it is because the driver should run with 
	
	



```
if_wi_load="YES"
```
 that I put in /boot/loader.conf, isn't it?


----------



## wblock@ (May 22, 2013)

Don't change defaults.  Remove all the unnecessary settings in wpa_supplicant.conf (that would be everything except ssid and psk) and only add them if they are required.

Also, read wi(4).  It is a very old card, and may not support WPA.


----------



## neilms (May 22, 2013)

This is not a reply that will help the original poster. It is just a follow on from what others have already said about WEP that might help others. The 'WEP' protocol should not be used at all. It was replaced by WPA2 for a very good reason. 

In my view, modern access points should not even have it as an option as it can easily confuse a user into selecting it rather than WPA2 or other secure variant. 

So if anyone reading this has a new wireless router you should set it up with WPA2 and use a 63 character passphrase. It only has to be entered once for each of your wireless devices.

Kind Regards


----------



## kpa (May 22, 2013)

16 characters (128bit) WPA2 password is good enough assuming it has enough randomness. 128 bit key can not be brute forced and the key itself is not directly used in WPA2 but used as the seed for generating the actual encryption keys.


----------

