# Wireless , Baselayout, Wep ???'s ## Solved ##

## codedmart

I went through the whole wireless setup and I thought I got it right but I still can't get it to connect with wep enabled

here is my /etc/conf.d/net

```
###########################################

####  Lan eth0 Settings

###########################################

#config_eth0="192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255"

ifconfig_eth0="dhcp"

#gatway_eth0="192.168.0.1"

###########################################

####  Wireless ath0 Settings

###########################################

# ath0 dhcp #

ifconfig_ath0="dhcp"

#iwconfig_ath0 key 94879A00B48EA4FE336CD

CEF3F essid "blmartin777"

modules=( "!iwconfig" )
```

and here is my /etc/conf.d/wireless

```
###########################################

####  Wireless ath0 Settings

###########################################

# ath0 dhcp #

#config_ath0=( "dhcp" )

# ESSID Setting #

#essid_ath0=( "any" )

# ESSID Pass WEP Key Setting #

#key_blmartin777=( "s:passkey" )

#essid_ath0="blmartin777"

# ESSID WEP Key Setting #

key_blmartin777="s:xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xx enc open"

preferred_aps=( "blmartin777" )

# Mode Setting #

#mode_ath0=( "Managed" )

# Channel Setting #

#channel_ath0=( "5" )
```

I connect fine with no wep and I get it to use wep with the command line so I know it works. I must have something configure wrong or am missing a step or something.

Any help would be great

ThanksLast edited by codedmart on Fri Jan 28, 2005 1:13 am; edited 1 time in total

----------

## UberLord

 *blmartin777 wrote:*   

> 
> 
> here is my /etc/conf.d/net
> 
> ```
> ...

 

You're telling net-scripts not to use the iwconfig module - but you've configured it anyway! Remove that line. If it still fails add RC_VERBOSE=yes to /etc/conf.d/rc and post the output of the script.

----------

## codedmart

Ok so now my /etc/conf.d/net only has this in it.

```
modules=( "!iwconfig" )

```

config_ath0=( "dhcp" )

and my wireless is the same so the only lines uncommented are...

```
config_ath0=( "dhcp" )

key_blmartin777="s:xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xx enc open"

preferred_aps=( "blmartin777" )

```

And just to make a note to make sure this is ok also I just open /etc/init.d/net.eth0 and renamed it net.ath0 which I assume is ok because no wep works but just wanted to make a note of that in case that is not good.

Now I have RC_VERBOSE=yes in /etc/conf.d/rc and this is the output when I try to start net.ath0

```
 * Starting ath0

 *    Loading networking modules for ath0

 *       modules: iptunnel ifconfig dhcpcd apipa

 *          ifconfig provides interface

 *          dhcpcd provides dhcp

 *    Bringing up ath0

 *       dhcp

 *          Running dhcpcd ...                                                                            [ !! ]
```

Not really sure what to do.

Thanks for the help.

----------

## UberLord

Well, it's not loading the iwconfig module so you need to emerge wireless-tools

----------

## codedmart

I have wireless-tools installed and I just updated them and tried again and same thing.

----------

## UberLord

In that case there is a configuration line somewhere saying "don't load the iwconfig module"

Here's what your two config files should look like

/etc/conf.d/net

```
config_eth0=( "dhcp" )

config_ath0=( "dhcp" )
```

/etc/conf.d/wireless

```
key_blmartin777="s:xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xx enc open"

preferred_aps=( "blmartin777" )
```

 *Quote:*   

> 
> 
> And just to make a note to make sure this is ok also I just open /etc/init.d/net.eth0 and renamed it net.ath0 which I assume is ok because no wep works but just wanted to make a note of that in case that is not good.
> 
> 

 

I suggest you read the Gentoo Installation handbook

http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=8#doc_chap2

Specifically code listing 16 on that page

----------

## codedmart

Yeah I had wep disabled you were right but when I enable it this is what I get

```
 * Starting ath0

 *    Loading networking modules for ath0

 *       modules: iwconfig essidnet iptunnel ifconfig dhcpcd apipa

 *          iwconfig provides wireless

 *          ifconfig provides interface

 *          dhcpcd provides dhcp

 *    Configuring wireless network for ath0

 *    Scanning for access points

 *       Found "blmartin777" at 00:0F:B5:27:4D:3C (WEP required)

/lib/rcscripts/net.modules.d/iwconfig: line 340: iwconfig_get_essid_var: command not found

 *    ath0 does not support setting keys

 *    or the parameter "mac_key_" or "key_" is incorrect

 *    Couldn't associate with any access points on ath0

 *    Failed to configure wireless for ath0                               [ !! ]
```

Hmmmmm?

Thank you for all your help so far!

----------

## UberLord

Sounds like you're suffering from the below bug

https://bugs.gentoo.org/show_bug.cgi?id=74723

Try re-emering baselayout as indicated - and ensure that you do an etc-update AND you've linked net.ath0 to net.lo

----------

## codedmart

Everything is updated there is a link but still that same error message?

----------

## codedmart

Ok if I use the actual passphrase like I do in windows instead of the long hex key it goes passed that error but dhcpcd times out but if I use the hex number I get that message.

----------

## codedmart

Well I took the s: off in front of the key and all works now. So it looks like this

```
key_ESSID="xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xx enc open"
```

Works so far so no complaints

----------

## TuxFriend

 *blmartin777 wrote:*   

> Well I took the s: off in front of the key and all works now. So it looks like this
> 
> ```
> key_ESSID="xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xx enc open"
> ```
> ...

 

Same over here removing the s: resulted in a working connection.

```
key_ESSID="xxxxxxxxxxxxxxxxxxxxxxxxxx enc open"
```

----------

## UberLord

Remember that the s: means everything after s: is text to be converted - ie a password.

If the s: is not present then it's a hex key.

Make sense?

----------

## Jerem

Stop bothering with overcomplicated and randomly working Gentoo wireless scripts.

Use /etc/conf.d/local.start to set up your network, it is a LOT easier and customizable. Here is my sample :

```
modprobe ipw2100 if_name=eth1

iwconfig eth1 essid YOURESSID

iwconfig eth1 key restricted

iwconfig eth1 key YOURWEPKEY

iwconfig eth1 ap YOURACCESSPOINT

iwconfig eth1 WHATEVERELSE

sleep 1

dhcpcd -t 10 eth1
```

you may add other sleep 1 commands since some wireless devices need some time to respond to iwconfig.

Of course you may cutomomize the script to your needs like using grep to catch the available aps in the iwlist output.

----------

## TuxFriend

 *UberLord wrote:*   

> Remember that the s: means everything after s: is text to be converted - ie a password.
> 
> If the s: is not present then it's a hex key.
> 
> Make sense?

 

Make sense indeed, maybe you want to add this line to the example-file. It would have saved me (and probably others) some time to figure it out.

----------

## UberLord

 *Jerem wrote:*   

> Stop bothering with overcomplicated and randomly working Gentoo wireless scripts.

 

Lets see whose complicated!

OK - here's the exact setup I use (minus keys) with Gentoo's scripts

```

key_Uber_NET="s:xxxxxxxxxxxx enc open"

key_DevNET="s:xxxxxxxxxxxx enc open"

preferred_aps=( "Uber NET" "DevNET" )

```

Tell me - is that more or less complicated than what you posted?

Here is your sample

```

iwconfig eth1 essid YOURESSID

iwconfig eth1 key restricted

iwconfig eth1 key YOURWEPKEY

iwconfig eth1 ap YOURACCESSPOINT

iwconfig eth1 WHATEVERELSE

```

Hey - you did know that you can just use 1 iwconfig line todo the above?

 *Quote:*   

> Of course you may cutomomize the script to your needs like using grep to catch the available aps in the iwlist output.

 

Then it becomes longer and complicted - especially when you try and support every driver combo going.

I would also point out that many people use these scripts for over a year without issue - I'm not saying that there aren't any bugs in them as there probably are.

----------

## UberLord

 *TuxFriend wrote:*   

>  *UberLord wrote:*   Remember that the s: means everything after s: is text to be converted - ie a password.
> 
> If the s: is not present then it's a hex key.
> 
> Make sense? 
> ...

 

It's on line 130, but I suppose I could bump it up higher

----------

## TuxFriend

 *Jerem wrote:*   

> Stop bothering with overcomplicated and randomly working Gentoo wireless scripts.
> 
> Use /etc/conf.d/local.start to set up your network, it is a LOT easier and customizable.

 

Why is it complicated? You only have to fill in a few values. Besides the distinction between s: and without s: the documentation in the example-file is very clear. If you put it in /etc/conf.d/local.start you don't have dependencies in your init-scripts, because it's always last executed.

If you tell us what you think is complicated we (the developers) can improve things.

----------

## TuxFriend

 *UberLord wrote:*   

>  *TuxFriend wrote:*    *UberLord wrote:*   Remember that the s: means everything after s: is text to be converted - ie a password.
> 
> If the s: is not present then it's a hex key.
> 
> Make sense? 
> ...

 

I think it's at the right position, I have read it before entering my values. However the distinction between the two variants isn't verbose enough (at least for me) so I wasn't aware that entering the wrong format.

BTW. thanks for the wireless-infrastructure in Gentoo, I think it's great!

----------

## codedmart

 *UberLord wrote:*   

> Remember that the s: means everything after s: is text to be converted - ie a password.
> 
> If the s: is not present then it's a hex key.
> 
> Make sense?

 

So UberLord essentially I could put the "s:" and then the text passphrase and it would convert it to hex? For some reason I tought I tried that and it wouldn't connect (but I can't remember). Oh well no need to worry it is connecting and once I figured it out it is a great script. Thanks!

----------

## UberLord

 *blmartin777 wrote:*   

> So UberLord essentially I could put the "s:" and then the text passphrase and it would convert it to hex? For some reason I tought I tried that and it wouldn't connect (but I can't remember). Oh well no need to worry it is connecting and once I figured it out it is a great script. Thanks!

 

Not exactly ......

Passphrase is not supported. Passphrase is when 4 keys are generated from a passphrase - unfortunately, different manufacturers use different algos for making the keys so this is not guaranteed to work, hence it's not supported by wireless-tools which is what powers the script.

Passkey on the other hand is a straight ASCII to HEX conversion and is supported. So for your 4 keys (if you use all 4) you have 4 passkeys.

Does this make sense?

----------

## codedmart

I think so....

So I use wep 128 bit. I give it a password(text) and it creates 4 keys. I looked at all the keys and they are all the same. So is this what you are saying......

If I used stupid as my "text word" then in the wireless would I put this

key_ESSID="s:stupid-stupid-stupid-stupid enc open"

for each key or just

key_ESSID="s:stupid enc open"

----------

## UberLord

 *blmartin777 wrote:*   

> 
> 
> If I used stupid as my "text word" then in the wireless would I put this
> 
> key_ESSID="s:stupid-stupid-stupid-stupid enc open"
> ...

 

key_ESSID="s:stupid enc open"

But if it doesn't work then it was creating by the passphrase thing I talked about earlier which we cannot use

----------

