# Yet another Need Help with Internet Thread



## steve_s (Feb 7, 2010)

I run dmesg to find out what internet hook up I'm using.  Using either usb wireless or lan line, I gotta use wep key and ssid so I try this:


```
#ifconfig nfe0 ssid Monkeys123456 wepmod on wepkey 36HH8JY15K
ifconfig: SIOCS89211: Invalid arguement
```

I have already designated the interface as up.  The ssid and wepkey of course aren't really what mine is, but they are the same format.

What do I do with that error?  what am I missing?


----------



## steve_s (Feb 7, 2010)

Sorry, that error message was this:

```
ifconfig: SIOCS80211: Invalid argument
```


----------



## volatilevoid (Feb 7, 2010)

Well, as nfe(4) is the NVIDIA Ethernet driver for *wired* LAN, you won't be able to activate WEP, which is for *wireless* LAN.

Which wireless LAN hardware do you have?


----------



## steve_s (Feb 7, 2010)

Tried this according to a netbsd archive, used this format instead:


```
wepkey 1:0xMY_KEY ssid MYSSID weptxkey 1 wepmode on
```

...and I get the same error message.  Right now, at least until I get this sorted, I'm using a lan line that is going through a router...


----------



## volatilevoid (Feb 7, 2010)

I see, but you can't enable a wireless LAN security algorithm on wired LAN, so using WEP on nfe0 can't work. The device doesn't support it. 

What is this USB wireless controller you wrote about?


----------



## steve_s (Feb 7, 2010)

I've tried both a linksys using ral driver and a belkin using rum and got this error message.

Ultimately I would love to have the linksys work.  It seems that freebsd loads the interface fine, just can't get the right code entered to get past this error.


----------



## steve_s (Feb 7, 2010)

volatilevoid: thanks for the tip with the lan; it works.

But why am I getting that error message with the wireless?  I can't leave this indefinitely plugged into the router; the wife will beat me. ;-)


----------



## volatilevoid (Feb 7, 2010)

Have you tried the example from the ral(4) man page?



> Join a specific BSS network with 104-bit WEP encryption:
> 
> `# ifconfig wlan create wlandev ral0 inet 192.168.0.20 netmask 0xffffff00 ssid my_net wepmode on wepkey 0x01020304050607080910111213 weptxkey 1`



Note that the example uses a key with characters converted to their hexadecimal values. So you have to convert your passphrase first.

See also the sticky thread from DutchDaemon.


----------



## steve_s (Feb 7, 2010)

volatilevoid: very well done!  I'm not totally out of the woods, but the interface seems to be cooking.

Now I can run a scan and see the router, but I can't get the internet.  ifconfig wlan0 status says associated, but still neither opera nor firefox3 can get a connection...

Any idea what to do?


----------



## steve_s (Feb 7, 2010)

I run dhclient wlan0 and it says DHDISCOVER on wlan0 a few times, but then says no DHOFFERS recieved...


----------



## volatilevoid (Feb 8, 2010)

Does your router have a status log? If so, what does it say?

What happens if you use a static IP? Can you ping your router?


----------



## steve_s (Feb 8, 2010)

volatilevoid said:
			
		

> Does your router have a status log? If so, what does it say?
> 
> What happens if you use a static IP? Can you ping your router?



Don't know how to ping my router or check for a status log...I did try to ping a website and it gave a negative...


----------



## volatilevoid (Feb 9, 2010)

Well, your router likely has the same IP as you would get by DHCP but with .1 at the end. The most common ones are 192.168.0.1 / 192.168.1.1 or, if you're on a Fritz!Box like me, 192.168.178.1.

Not getting an IP sounds to me like an authentication problem. Your router then discards your DHDISCOVER requests. Are you sure your key is correct?

It would also help to know exactly what you entered.


----------



## steve_s (Feb 9, 2010)

Well, it was basically this


```
ifconfig wlan create wlandev ural0 ssid Fakeyboy123456 wepmode on wepkey 0x32374545394143303349 weptxkey 1
```

with changes of course, but it is essentially that...

then


```
dhclient wlan0
```

...did I miss something again?  You're kicking butt, like I said, and it's much closer now...what else?
:\


----------



## steve_s (Feb 9, 2010)

Oh, and as far as whether or not the code is right, I just flat copied (copied and pasted) it into the link you gave me and hit convert...thanks for that link, by the way...


----------



## volatilevoid (Feb 9, 2010)

Hmmm, in DutchDaemons thread, the command is `# ifconfig wlan0 ...` whereas in the manual it is `# ifconfig wlan ...`. I don't know if that makes any difference though. Rest looks OK.

You may also give wlandebug(8) a try. Especially to check whether authentication works or not.


----------



## DutchDaemon (Feb 9, 2010)

volatilevoid said:
			
		

> Hmmm, in DutchDaemons thread, the command is `# ifconfig wlan0 ...` whereas in the manual it is `# ifconfig wlan ...`. I don't know if that makes any difference though. Rest looks OK.



The NIC manuals differ in this respect. Compare e.g. iwi(4) and ath(4)). To me 'wlan0' sounds slightly more 'right', because all NICs are referred to as _nic_0 (_nic_1, _nic_2, etc.) in ifconfig(8). Then again, wlan isn't really a nic


----------



## LateNiteTV (Feb 9, 2010)

are you sure you are using the correct wep key?


----------



## steve_s (Feb 10, 2010)

LateNiteTV: as far as I know...I mentioned before that I just took the key that I knew, that I've used for some time, then volatilevoid had mentioned that it needed to be converted, provided a link, I selected it, copied it, then pasted it, all via the computer, converted it, then moved it to a flash drive and then to the freebsd computer.  So the answer is, yes, I can make mistakes (and I'll check it again), but I'm pretty sure...


----------



## LateNiteTV (Feb 10, 2010)

the key needed to be converted into what?


----------



## volatilevoid (Feb 10, 2010)

LateNiteTV said:
			
		

> the key needed to be converted into what?



They need to be converted into hex. At least if the manual pages are correct.


----------



## LateNiteTV (Feb 10, 2010)

i only have wep enabled on my wireless network and the key is not hex.
i was having problems when first setting it up because i thought it had to be converted to hex also, but it turns out that that is wrong.


----------



## LateNiteTV (Feb 10, 2010)

the key still needs to have the 0x in front of it, but the actual key doesnt have to be converted to hex.


----------



## steve_s (Feb 11, 2010)

LateNiteTV said:
			
		

> the key still needs to have the 0x in front of it, but the actual key doesnt have to be converted to hex.



Hmmm...I'll try that too...I'll post back with results in the next day or so...


----------



## volatilevoid (Feb 12, 2010)

If that really is the cause, then someone should change the manual pages accordingly. 

Unfortunately, I don't have any own experience with WEP - always used WPA2 with wpa_supplicant and that worked for me.


----------



## LateNiteTV (Feb 12, 2010)

volatilevoid said:
			
		

> If that really is the cause, then someone should change the manual pages accordingly.
> 
> Unfortunately, I don't have any own experience with WEP - always used WPA2 with wpa_supplicant and that worked for me.




in which man page does it say that the key needs to be in hex?


----------



## volatilevoid (Feb 12, 2010)

LateNiteTV said:
			
		

> in which man page does it say that the key needs to be in hex?


See the ifconfig(8) manual page. Scroll down to wepkey or search for it.


> It may be specified either as a plain string or as a string of hexadecimal digits preceded by `0x'.  For maximum portability, hex keys are recommended; the mapping of text keys to WEP encryption is usually driver-specific.


The manual page for ral(4) uses them, too.


----------



## steve_s (Feb 13, 2010)

Ok, here is what I did.  I made a script that is basically this (yes, I edited it so it isn't exactly the right wep code and all that, but it is basically this...).  Hex may work, but this was not hex:


```
#!/bin/sh
ifconfig wlan create wlandev ural0 ssid SloppyJoe123456 wepmode on wepkey 0x34JJ7BC92U weptxkey 1
dhclient wlan0
```

The line with "ifconfig..." is all one line past "...weptxkey 1".  dhclient is a new line.

And saved it as "freebsd-wifi."  I did that as root...then made it active for all users with


```
chmod +x freebsd-wifi
```

Then I just now ran it...and it worked!  I'm posting with it right now...

Well done everyone!  We got it going....thank you!


----------



## volatilevoid (Feb 13, 2010)

Congrats! 

If it wouldn't work with hex values then I'd really think about changing the manual pages...


----------

