# [SOLVED] can't use the init script for wlan0

## MajinJoko

Good evening guys,

I'm using a Broadcom 4318 wifi card on a 32bit gentoo (even if my processor is an amd 64).

It is recognized as "wlan0" thanks to ndiswrapper. I've installed the 32-bit driver for Windows, and so I can use it and succeeded in connecting to my wireless home lan thanks to these commands:

ifconfig wlan0 up 

iwconfig wlan0 commit 

iwconfig wlan0 essid neverland channel 8 key open <chiave> commit 

ifconfig wlan0 up 

dhcpcd wlan0

the problem is when I try to start /etc/init.d/net.wlan0 (symlink to net.lo).

I get:

```
 * Starting wlan0 

 *   Configuring wireless network for wlan0 

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

When the error is reported, in /var/log/messages appears the line:

```
Apr 6 19:59:40 Urumi rc-scripts: Failed to configure wireless for wlan0
```

Trying other net. start script (for example, for eth0), they works well.

My /etc/conf.d/wireless:

```
essid_wlan0="neverland" 

channel_wlan0="8" 

mode_wlan0="managed" 

key_neverland="mykey.." 

preferred_aps=("neverland") 

associate_order=("forcepreferredonly")
```

My /etc/conf.d/net:

```
config_wlan0=("dhcp")
```

I've tried to update everything.. ndiswrapper, baselayout, wireless-tools.. even switched to kernel 2.6.15, or 2.6.16..

..but the init script for wlan0 fails everytime. So, I can't use it at startup, and it's annoying.

I hope someone could help me!

Thanks,

MajinJoko

----------

## kostia_lewin

hi, first please forgive me my english. I have wifi card Pentagram HorNet on USB. this is my /etc/conf.d/net:

iface_wlan0="dhcp"

modules=("iwconfig")

dhcpcd_wlan0="-t 5"

essid_wlan0="dune"

key_dune="39:38:37:36:35:34:33:32:31:30:39:38:37 enc restricted"

preferred_aps=("dune")

channel_wlan0="6"

nick_wlan0="gentoo"

mode_wlan0="managed"

rate_wlan0="auto"

it works. maybe this  will help you. I hope.

----------

## MajinJoko

Good morning mariuszongentoo, and thank you for you reply..

WHOA:

```
 /etc/init.d/net.wlan0 restart

 * Starting wlan0

 *   Configuring wireless network for wlan0

 *     wlan0 connected to "neverland" at 00:12:BF:08:8B:33

 *     in managed mode on channel 8 (WEP enabled - open)

 *   You are using a depreciated configuration syntax for wlan0

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

 *   Bringing up wlan0

 *     dhcp

 *       Running dhcpcd ...                                              [ ok ]

 *       wlan0 received address 192.168.2.21/24

```

IT WORKS!

now I try to solve the strange advise, but REALLY THANK YOU, man!

edit: ok, I have to use

```
config_wlan0=("dhcp")
```

instead of 

```
iface_wlan0="dhcp"
```

----------

