# Can't figure WEP wireless connection



## xtremystinx (Mar 10, 2014)

Hello everyone, *I* just tried FreeBSD for the first time (FreeBSD 10) on VirtualBox and I was thinking of making it a permanent installation on one of my partitions. Only problem I'm having is the wireless connection. During installation I kept getting a "DHCP leasing acquisition failed" however I used the DVD and managed to finish the installation. I tried various entries on both /etc/rc.conf and /etc/wpa_supplicant.conf but didn't have much luck. I'm using a TP-LINK TL_WN321G USB stick and I have 

```
if_rum_load="YES"
wlan_wep_load="YES"
```
on my /boot/loader.conf

Here's what I have in /etc/rc.conf

```
hostname="freebsd"
wlans_rum0="wlan0"
ifconfig_wlan0="DHCP"
sshd_enable="YES"
moused_enable="YES"
slim_enable="YES"
hald_enable="YES"
dbus_enable="YES"
dumpdev="AUTO"
```

And finally my /etc/wpa_supplicant.conf

```
network={
              ssid="my_ssid"
              key_mgmt=NONE
              wep_tx_keyidx=1
              wep_key1=**********
}
```
Where my_ssid is the SSID of my wireless network (Thomson-blah-blah) and ******* is my 10-digit hexadecimal password (eg E4596N53HY)

Strange thing is `wpa_supplicant -i wlan0 -c /etc/wpa.supplicant.conf` hangs but if I use ifconfig(8) like this:
`ifconfig wlan0 inet 192.168.1.1 netmask 255.255.255.0 ssid my_ssid wepmode on weptxkey 1 wepkey 1:0x**********`
It works like a charm, I can ping http://www.google.com without any problems. One last thing that might be useful, during boot, rum0 interface gives "status: associated" and  then:

```
starting devd
add net fe80::: gateway ::1
add net ff02::: gateway ::1
add net ::ffff:0.0.0.0: gateway ::1
add net ::0.0.0.0: gateway ::1
waiting 30s for the default route interface: .... (no carrier)
```

Any help would be greatly appreciated.


----------



## tzoi516 (Mar 10, 2014)

Try this:


```
network={
              ssid="my_ssid"
              key_mgmt=NONE
              wep_tx_keyidx=0
              wep_key0=**********
}
```


----------



## xtremystinx (Mar 10, 2014)

Thanks a lot for the quick response, unfortunately it didn't change anything, *I*'m still getting the exact same thing. The USB indicator on the bottom panel of Virtualbox and the actual USB both flash (but only give red blinks) and when *I* log[]in and try to ping *I* get "host lookup failed". Does this have to do with dhclient maybe?


----------



## Juanitou (Mar 10, 2014)

Try adding 
	
	



```
defaultrouter="192.168.1.1"
```
 (adapt as necessary) to /etc/rc.conf.


----------



## tzoi516 (Mar 10, 2014)

*Re: cant figure wep wireless connection*



			
				xtremystinx said:
			
		

> Thanks a lot for the quick response, unfortunately it didn't change anything, i'm still getting the exact same thing.
> The usb indicator on the bottom panel of virtualbox and the actual usb both flash (but only give red blinks) and when i login and try to ping i get host look up failed.
> Does this have to do with dhclient maybe?



After updating did you reboot or try `wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf &`?


----------



## tzoi516 (Mar 10, 2014)

Also, the Handbook shows 2 lines in a different order, like this:


```
network={
              ssid="my_ssid"
              key_mgmt=NONE
              wep_key0=**********
              wep_tx_keyidx=0
}
```


----------



## wblock@ (Mar 10, 2014)

The order is probably not significant.  But really, it is time to stop using WEP, which is effectively insecure and really not very different from running an open access point.


----------



## tzoi516 (Mar 10, 2014)

I had to use WEP at someone's house recently, using FreeBSD 10.0-RELEASE. The order and '0' were important for me to connect.


----------



## xtremystinx (Mar 10, 2014)

*Re: cant figure wep wireless connection*

@Juanitou
Thanks for replying, i'm afraid this didn't work either...
During boot I got

```
starting devd
route:writing to routing socket: Network is unreachable
add net default: gateway 192.168.1.254 fib 0: Network is unreachable
add net fe80::: gateway ::1
add net ff02::: gateway ::1
add net ::ffff:0.0.0.0: gateway ::1
add net ::0.0.0.0: gateway ::1
waiting 30s for the defaulthttps://forums.freebsd.org/memberlist.php?mode=viewprofile&u=36284 route interface: .... (no carrier)
```

@tzoi516 I rebooted and I always do after every attempt... I'll try changing the order some time tomorrow morning and I'll report back, thanks again for your tip.

Edit: @wblock@ I understand what you're saying, it never troubled me much as I live in an isolated area but I think it will be my final choice if I cant make it work with WEP.


----------



## xtremystinx (Mar 11, 2014)

So... changing the order of the lines didn't change anything so I switched to WPA2 PSK... However for some reason I'm still having problems connecting to the internet. The only time I managed to connect without problems is when I removed all protection from my network and left it open, (of course I also removed WPA from  the ifconfig_wlan0="WPA DHCP" line in my rc.conf ). While using WPA my new /etc/rc.conf is:

```
hostname="freebsd"
wlans_rum0="wlan0"
ifconfig_wlan0="WPA DHCP"
sshd_enable="YES"
moused_enable="YES"
slim_enable="YES"
hald_enable="YES"
dbus_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
```
/etc/wpa_supplicant.conf:

```
network={
	ssid="network_ssid"
	key_mgmt=WPA-PSK
	psk="**********"
}
```
/boot/loader.conf

```
if_rum_load="YES"
wlan_ccmp_load="YES"
wlan_tkip_load="YES"
```
Last part of a /var/log/messages file that might help:

```
Mar 11 12:47:52 freebsd kernel: ugen0.2: <Ralink> at usbus0
Mar 11 12:47:52 freebsd kernel: rum0: <Ralink 54M.USB......., class 0/0, rev 1.10/0.01, addr 2> on usbus0
Mar 11 12:47:52 freebsd kernel: rum0: MAC/BBP RT2573 (rev 0x2573a), RF RT2528
Mar 11 12:47:52 freebsd kernel: Root mount waiting for: usbus0
Mar 11 12:47:52 freebsd kernel: Root mount waiting for: usbus0
Mar 11 12:47:52 freebsd kernel: Trying to mount root from ufs:/dev/ada0p2 [rw]...
Mar 11 12:47:52 freebsd kernel: wlan0: Ethernet address: 00:25:86:ef:b5:5f
Mar 11 12:47:52 freebsd kernel: rum0: need to implement rum_update_mcast
Mar 11 12:47:54 freebsd kernel: .
Mar 11 12:47:58 freebsd wpa_supplicant[490]: wlan0: CTRL-EVENT-DISCONNECTED bssid=58:98:35:50:20:f8 reason=0
Mar 11 12:47:58 freebsd kernel: wlan0: link state changed to DOWN
Mar 11 12:47:59 freebsd dbus[936]: [system] Activating service name='org.freedesktop.ConsoleKit' (using servicehelper)
Mar 11 12:47:59 freebsd dbus[936]: [system] Activating service name='org.freedesktop.PolicyKit1' (using servicehelper)
Mar 11 12:47:59 freebsd dbus[936]: [system] Successfully activated service 'org.freedesktop.PolicyKit1'
Mar 11 12:47:59 freebsd dbus[936]: [system] Successfully activated service 'org.freedesktop.ConsoleKit'
Mar 11 12:48:02 freebsd wpa_supplicant[490]: wlan0: Trying to associate with 58:98:35:50:20:f8 (SSID='Thomson5020F8' freq=2412 MHz)
Mar 11 12:48:02 freebsd wpa_supplicant[490]: wlan0: Associated with 58:98:35:50:20:f8
Mar 11 12:48:02 freebsd kernel: wlan0: link state changed to UP
Mar 11 12:48:02 freebsd dhclient[701]: send_packet: No buffer space available
Mar 11 12:48:02 freebsd dhclient[701]: send_packet: No buffer space available
Mar 11 12:48:02 freebsd wpa_supplicant[490]: wlan0: WPA: Key negotiation completed with 58:98:35:50:20:f8 [PTK=CCMP GTK=CCMP]
Mar 11 12:48:02 freebsd wpa_supplicant[490]: wlan0: CTRL-EVENT-CONNECTED - Connection to 58:98:35:50:20:f8 completed [id=0 id_str=]
Mar 11 12:49:03 freebsd devd: Executing '/etc/rc.d/dhclient quietstart wlan0'
```
and while I boot I remember seeing that rum0 is associated and then I get something like this:

```
starting devd 
add net fe80::: gateway ::1
add net ff02::: gateway ::1
add net ::ffff:0.0.0.0: gateway ::1
add net ::0.0.0.0: gateway ::1
wlan0: link state changed to up
need to implement rum_update_mcast
waiting 30s for the default route interface: ..............................
```
and then boot continues and I login but don't have internet connection (when I switched my network to open I rebooted and after this last line it gave a positive response, can't remember the exact text).
Tried to manually run `wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf` but it hangs and I think it gives a messages for not supported action,
I also tried setting defaultrouter="192.168.1.254", tried synchronous dhclient="YES", but none of these helped, I'm all out of ideas... i know it should be much easier but what am I missing here?


----------

