# [SOLVED]wireless not working with init.d script. ok manual

## mgp-gentoo

EDIT= was "wireless card doesn't work with init.d script, does manually"

When I run 

```
/etc/init.d/net.ra0 start
```

I get 

```

 * Starting ra0

 *   Configuring wireless network for ra0

 *   Failed to configure wireless for ra0    
```

But if I run 

```
$iwconfig ra0 essid linksys channel 11 mode Managed key 759478362C

$dhcpcd ra0
```

everything works fine.

My guess is that somehow I haven't managed to set my /etc/conf.d/wireless right. 

File is:

```
modules_ra0=( "iwconfig" )

essid_ra0="linksys"

key="759478362C enc open"

mode_ra0="Managed"

channel_ra0="11"

```

I have also observed the following behaviour. When I set the WEP key manually and check "iwconfig" I get the key in the output. After running the init script I check "iwconfig" and the key is set to off. Don't know if the scripts sets it back to that if it fails or if it's unable to set the key.

I believe I have followed the /etc/conf.d/wireless.example instuctions correctly to write /etc/conf.d/wireless and can't find the error. Web didn't help. Please ask for any information required.

Thanks in advance...

MichaelLast edited by mgp-gentoo on Thu Feb 16, 2006 6:21 pm; edited 3 times in total

----------

## ChickensDontFly

I didn't really notice anything wrong there. How do you have /etc/conf.d/net setup?

----------

## thecooptoo

which version of baselayout are you using?

https://forums.gentoo.org/viewtopic-t-377076-highlight-baselayout+homenw.html  was my solution

----------

## mgp-gentoo

I have checked the post you quoted and discovered we had the same problem:

```

/etc/init.d/net.ra0 start

 * Caching service dependencies ...                                       [ ok ]

 * Starting ra0

 *   Loading networking modules for ra0

 *     modules: iwconfig essidnet iptunnel ifconfig dhcpcd apipa

 *       iwconfig provides wireless

 *       ifconfig provides interface

 *       dhcpcd provides dhcp

 *   Configuring wireless network for ra0

 *   Connecting to "linksys" (WEP Disabled) ...                      [ !! ]

 *   Failed to configure wireless for ra0                                 [ !! ]

```

WEP is disabled but shouldn't be.

Solution seemed to be emerging the next version of baselayout.

I updated to the unstable version of baselayout (1.11.14 ---> 1.12)

but still get:

```

 * Caching service dependencies ...                                       [ ok ]

 * Starting ra0

 *   Loading networking modules for ra0

 *     modules: apipa arping macchanger macnet rename iwconfig essidnet iptunnel ifconfig system dhcpcd

 *       iwconfig provides wireless

 *       ifconfig provides interface

 *       dhcpcd provides dhcp

 *   Configuring ra0 for MAC address 00:80:5A:35:89:8B ...                [ ok ]

 *   Configuring wireless network for ra0

 *   Connecting to "linksys" (WEP Disabled) ...                           [ !! ]

 *   Failed to configure wireless for ra0                                 [ !! ]

```

So where do I enable WEP?

Thanks again

MichaelLast edited by mgp-gentoo on Thu Feb 16, 2006 6:22 pm; edited 2 times in total

----------

## mgp-gentoo

As for /etc/conf.d/net my file is:

```

iface_eth0="dhcp"

dhcpcd_eth0="-N"

iface_ra0="dhcp"

dhcpcd_ra0="-N"

```

----------

## thecooptoo

does it work if you configure the card manually ?

```
ifconfig eth1 up

iwconfig eth1 essid "xxx" key "xxxx-xxx etc etc -xx enc open"

dhcpcd eth1
```

----------

## UberLord

You're not helping by masking your essid.

----------

## mgp-gentoo

Works fine manually (as described in first post), only fails with the script.

Essid is linksys but can't see why that matters.

Can't remember key (not at the machine at the moment) but have tried all ways: XXXXXXXXXX, XXXX-XXXX-XX, s:XXXXXXXXXX, s:XXXX_XXXX_XX

Thank you for the help...

Michael

----------

## thecooptoo

if it works manually then its a problem with the script. Either file it as a bug or wait and Im sure uberlord will be around sometime soon.

----------

## UberLord

 *thecooptoo wrote:*   

> if it works manually then its a problem with the script. Either file it as a bug or wait and Im sure uberlord will be around sometime soon.

 

It's not a bug until he posts his ESSID. I'll bet money he's configured it wrong.

If there's no error and it says WEP Disabled then only 2 things are possible

1) iwconfig command worked, but driver failed to apply wep. As it works manually we can rule that out

2) key_ESSID does not match the escaped ESSID. Which is why I asked to see the ESSID.

----------

## mgp-gentoo

Ok.

Uberlord was right about the WEP. I've edited the posts to include all of the information. I have not just introduced the name for the *** but copied all the info again from the original files (except for the old baselayout output) so the information is that of the files on my computer. Realized in the first post that my wireless setup was not what I was saying it was. key_ESSID did not have an ESSID at all!!! Sorry for wasting your time with that. Unfortunatelly setting /etc/conf.d/wireless to:

```
  

modules_ra0=( "iwconfig" )

essid_ra0="linksys"

key_linksys="759478362C enc open"

mode_ra0="Managed"

channel_ra0="11"

```

and trying again it still doesn't work:

```

 /etc/init.d/net.ra0 start

 * Caching service dependencies ...                                       [ ok ]

 * Starting ra0

 *   Loading networking modules for ra0

 *     modules: apipa arping macchanger macnet rename iwconfig essidnet iptunnel ifconfig system dhcpcd

 *       iwconfig provides wireless

 *       ifconfig provides interface

 *       dhcpcd provides dhcp

 *   Configuring ra0 for MAC address 00:80:5A:35:89:8B ...                [ ok ]

 *   Configuring wireless network for ra0

 *   Connecting to "linksys" (WEP enabled - open) ...                     [ !! ]

 *   Failed to configure wireless for ra0                                 [ !! ]

```

and does work manually with:

```

$iwconfig ra0 essid linksys channel 11 mode Managed key 759478362C

$dhcpcd ra0

```

Thanks for your help, sorry for the errors above

Michael

----------

## UberLord

```
  

essid_ra0="linksys"

key_linksys="759478362C"

mode_ra0="managed"

```

Try that

----------

## mgp-gentoo

Set /etc/conf.d/wireless to:

```

#modules_ra0=( "iwconfig" )

essid_ra0="linksys"

key_linksys="759478362C"

mode_ra0="managed"

#channel_ra0="11"

```

but still gives the same error.

----------

## mgp-gentoo

Tried to set wireless setup to:

```

essid_ra0="linksys"

key_linksys="759478362C enc restricted"

mode_ra0="managed"

```

and finally worked, with the following warning:

```

 * Starting ra0

 *   Loading networking modules for ra0

 *     modules: apipa arping macchanger macnet rename iwconfig essidnet iptunnel               ifconfig system dhcpcd

 *       iwconfig provides wireless

 *       ifconfig provides interface

 *       dhcpcd provides dhcp

 *   Configuring ra0 for MAC address 00:80:5A:35:89:8B ...                [ ok ]

 *   Configuring wireless network for ra0

 *   Connecting to "linksys" (WEP enabled - restricted) ...               [ ok ]

 *     ra0 connected to "linksys" at 00:14:BF:D7:A9:0A

 *     in managed mode on channel 11 (WEP enabled - restricted)

 *   Configuring ra0 for ESSID "linksys" ...                              [ ok ]

 *   You are using a depreciated configuration syntax for ra0

 *   You are advised to read /etc/conf.d/net.example and upgrade it accordingly

 *   Bringing up ra0

 *     dhcp

 *       Running dhcpcd ...                                               [ ok ]

```

Strange, I didn't have to set restricted manually and the configuration on the router is set to open. Maybe this was trivial but tried everything before getting here. Thanks everyone for your help. What could the warning indicate? Should I have my wireless config in /etc/conf.d/net?  I'll wait for a few hours to see if I can get rid of the warning and then I'll mark the thread as solved. 

Thanks again

Michael

----------

## UberLord

 *mgp-gentoo wrote:*   

> As for /etc/conf.d/net my file is:
> 
> ```
> 
> iface_eth0="dhcp"
> ...

 

That's the warning. You need this

```
config_eth0=( "dhcp" )

dhcp_eth0="nontp"

config_ra0=( "dhcp" )

dhcp_ra0="nontp"
```

----------

## mgp-gentoo

Everything works fine. Thanks everyone for your help.

Setting thread to solved.

Michael

----------

