# wireless-tools not working w/ /etc/conf.d/net

## jrtayloriv

I am trying to get wireless networking set up using wireless-tools. Everything works fine when I do it via the command line w/ ifconfig, iwconfig, & dhcpcd, but I can't get it to work with the init scripts. That is /etc/init.d/net.wlan0 start does not work. 

I have a WEP network that I need to connect to, and I told it to use a key to connect to this network, but it's not doing it for some reason -- it keeps saying WEP disabled, when the init script starts loading. Here is what I get when I run '/etc/init.d/net.wlan0 start'

```

 * Caching service dependencies ... [ok ]

 * Starting wlan0

 *   Configuring wireless network for wlan0

 *     wlan0 connected to ESSID "comcastsawyerst" at 10:13:4D:44:A1:C3

 *     in managed mode on channel 11 (WEP disabled)

 *   Bringing up wlan0

 *     dhcp

 *       Running dhcpcd ... [ok ]

Error, wlan0: timed out 

 *       wlan0 received address 169.254.231.192/16

```

And here's what I have in my '/etc/conf.d/net'

```

modules=("iwconfig")

config_wlan0=("dhcp")

dhcp_wlan0="-t 3"

mode_wlan0="managed"

associate_order="preferredonly"

preferred_aps=( "comcastsawyerst" )

key_comcastsawyerst="1659383a334f143f75f396aa4b enc restricted"

```

However this works just fine:

```

ifconfig wlan0 up

iwconfig wlan0 essid comcastsawyerst mode managed key 3434343434343434343434343

dhcpcd wlan0

```

And this is what iwconfig shows when it is working via manually starting it up w/ iwconfig and dhcpcd:

```

wlan0     IEEE 802.11b  ESSID:"comcastsawyerst"  

          Mode:Managed  Frequency:2.462 GHz  Access Point: 00:1B:FC:BF:C3:C6   

          Bit Rate=11 Mb/s   

          RTS thr=2432 B   Fragment thr=2432 B   

          Encryption key:1349-AC16-737F-155F-33F3-22AA-4B   Security mode:restricted

          Power Management:off

          Link Quality:64/100  Signal level:-55 dBm  Noise level:-96 dBm

          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0

          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

```

Is there something I am doing wrong here? 

Why does it say 'WEP Disabled' when I start up the wlan0 init script?

Thanks,

jrtayloriv

----------

## StarDragon

I would take out forcedpreferred and preferredonly options. They tend to behave flaky on my card. Just use the essid_wlan0=comcastsawyerst option.

Also, you have power management. You should turn that on, to make better use of it.

```
iwconfig_wlan0="power on"
```

----------

## jrtayloriv

Thanks for the tip on the power management -- I didn't know about that. But it is still not working.

My /etc/conf.d/net now looks like this.

```

modules=("iwconfig")

config_wlan0=("dhcp")

dhcp_wlan0="-t 3"

mode_wlan0="managed"

essid_wlan0=("comcastsawyerst")

iwconfig_wlan0="power on"

key_comcastsawyerst="1049a836533f140f80f396aa4b enc restricted"

```

But I am getting the same output as above. Any other suggestions?

Thanks,

jrtayloriv

----------

## NeddySeagoon

jrtayloriv,

You card may need some settling delays - see /etc/conf.d/net,example and the Handbook

You get these delays for free when you issue the commands manually

----------

## jrtayloriv

NeddySeagoon: Thanks for the suggestions, but I'm still not having any success. Same output, the sleep just makes it take longer. (But net.example did remind me to turn on macchanger, so Neddy++  :Wink: 

Now my /etc/conf.d/net looks like this:

```

arping_sleep=5

arping_sleep_lan=7

sleep_scan_wlan0=2

modules=("iwconfig")

config_wlan0=("dhcp")

dhcp_wlan0="-t 3"

mac_wlan0="random-anykind"

mode_wlan0="managed"

essid_wlan0="comcastsawyerst"

iwconfig_wlan0="power on"

key_comcastsawyerst="1049a836533f140f80f396aa4b enc restricted"

```

I think the problem is tied to it saying WEP disabled. It is finding the access point and associating with it, but it just can't seem to understand to actually use the key that I gave it for some reason.

Any other suggestions?

--jrtayloriv

----------

## UberLord

Why did you use enc restricted in your non working config but omit it on the working command line?

maybe that is where error is.

----------

## jrtayloriv

I have tried it without 'enc restricted' -- same result. So that's not it either.

I added 'enc restricted', by the way, because of the output that iwconfig gives when it is working (i.e. when I bring it up from the command line), which says Security Mode: restricted

Anyhow I appreciate all of you folks' help with this...any other ideas?

--jrtayloriv

PS:

By the way, I just tried removing everything except for the following, just in case:

```

modules=("iwconfig")

config_wlan0=("dhcp")

essid_wlan0="comcastsawyerst"

key_comcastsawyerst="1049a836533f140f80f396aa4b"

```

And that didn't work either.

PPS:

And I also just tried re-emerging wireless-tools -- no luck there either.

----------

## NeddySeagoon

jrtayloriv,

My rt73 often associates ok but comes up with the TxPower set to zero, which is a very bad thing.

I have to spoon feed it both iwconfig wlan0 txpower 30dBm and iwconfig wlan0 ap xx:....  to make it work then

Thats after its associated and iwconfig wlan0 shows the correct AP.

----------

## UberLord

If you're feeling brave, you can try baselayout-2 or OpenRC, which have improved wireless scripts over baselayout-1.

----------

## NeddySeagoon

UberLord,

I've been on baselayout2 for about 6 months. Is OpenRC better still in the wireless deparment?

----------

## jrtayloriv

NeddySeagoon: I tried txpower, but my card can't do that. I browsed around in wireless.example and tried a few things in there, with no luck. But that doesn't seem to be an issue. I am pretty sure that it is just not even trying to use WEP, but everything in the config seems correct, so I can't figure out why.

Here's what I've got now:

```

arping_sleep=5

arping_sleep_lan=7

sleep_scan_wlan0=2

modules=("iwconfig")

config_wlan0=("dhcp")

dhcp_wlan0="-t 3"

mac_wlan0="random-anykind"

mode_wlan0="managed"

essid_wlan0="comcastsawyerst"

iwconfig_wlan0="power on"

key_comcastsawyerst="1249-B8D6-523F-130F-80F3-96CA-4B enc restricted"

mac_key_001BFCBFC3C6="1249-B8D6-523F-130F-80F3-96CA-4B enc restricted"

```

I'll look into the baselayout-2 option -- at this point I'm getting sick of screwing around with this stupid thing.

What did you mean uberlord, by 'if you're feeling brave' -- am I likely to break something?

--jrtayloriv

----------

## UberLord

 *NeddySeagoon wrote:*   

> I've been on baselayout2 for about 6 months. Is OpenRC better still in the wireless deparment?

 

It has a few fixes here and there, but it's just as good really.

----------

## UberLord

 *jrtayloriv wrote:*   

> What did you mean uberlord, by 'if you're feeling brave' -- am I likely to break something?

 

baselayout-2 in portage right now has know bugs and issues.

openrc, which will eventually replace the bulk of baselayout is not in portage, but is available in layman. I wrote both, and started openrc when I retired from Gentoo.

At this point, I'd rather people run OpenRC as it's very bug free and stable right now. I suppose I ought to pester the right people to get it into portage.

----------

## NeddySeagoon

 *UberLord wrote:*   

> I suppose I ought to pester the right people to get it into portage

 

Yes please!

----------

