# /etc/conf.d/net help [SOLVED]

## jammin

Hi all,

At minute, to bring my wireless up I need to, after boot,

```

ifconfig wlan0 up

wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf

dhcpcd wlan0

```

Im trying to this all working at boot with /etc/conf.d/net.

Currently, I have:

```

modules=( "wpa_supplicant" )

wpa_supplicant_wlan0="-Dwext -iwlan0 c=/etc/wpa_supplicant.conf"

 

config_WLAN=( "dhcp" )

dhcpd_WLAN=" -t 10"

```

Which doesnt work. Is this bringing wlan0 up before it trys wpa? Also, is ndiswrapper loaded at this stage of boot?

ThanksLast edited by jammin on Thu Aug 10, 2006 2:47 pm; edited 1 time in total

----------

## linear

Okay,

What do you have in your /etc/conf.d/wireless file?

Let us know.

/bk

----------

## jammin

Thanks for the reply.

I dont even have an /etc/conf.d/wireless :S 

Looking through wireless.example; does it support WPA? Or is that irrelevant. 

Any pointers to what I should have in my etc/conf.d/wireless??

Thanks again.

----------

## UberLord

 *jammin wrote:*   

> 
> 
> Currently, I have:
> 
> ```
> ...

 

As it's totally wrong! This should work for you

```

modules=( "wpa_supplicant" )

wpa_supplicant_wlan0="-Dwext"

 

config_WLAN=( "dhcp" )

dhcpcd_WLAN=" -t 10"

```

If the ESSID you're connecting to is not WLAN then you probably need this instead

```

modules=( "wpa_supplicant" )

wpa_supplicant_wlan0="-Dwext"

 

config_wlan0=( "dhcp" )

dhcpcd_wlan0=" -t 10"

```

----------

## jammin

Hi, and thanks for the reply -

Ive tried both:

```

modules=( "wpa_supplicant" ) 

wpa_supplicant_wlan0="-Dwext" 

  

config_wlan0=( "dhcp" ) 

dhcpcd_wlan0=" -t 10" 

```

and 

```

modules=( "wpa_supplicant" ) 

wpa_supplicant_wlan0="-Dwext" 

  

config_WorRouter=( "dhcp" ) 

dhcpcd_WorRouter=" -t 10" 

```

But still no luck?

Is this bringing wlan0 up before trying wpa_suplicant? 

Thanks again

----------

## UberLord

If /etc/wpa_supplicant/wpa_supplicant.conf exists then move /etc/wpa_supplicant.conf to /etc/wpa_supplicant

----------

## jammin

Thanks again for the quick reply. 

/etc/wpa_supplicant/ did not exist, it was /etc/wpa_supplicant.conf, which i moved to  /etc/wpa_supplicant and tried both examples form my above post with no luck?

Also, on a side note, is it possible to test this without rebooting? Ive tried bringing wlan0 down then -

```

Saturn jammin # /etc/conf.d/net

bash: /etc/conf.d/net: Permission denied

Saturn jammin #

```

Thanks again.

<edit> I noticed your replies in https://forums.gentoo.org/viewtopic-t-484319.html. Here are the outputs of the two commands you asked the starter of that thread to run -

```
Saturn jammin # sed -n -e 's/[ \t]*#.*//g;s/[

\t]*$//g;s/^ctrl_interface=//p' /etc/wpa_supplicant/wpa_supplicant.conf

sed: can't read /etc/wpa_supplicant/wpa_supplicant.conf: Not a directory

Saturn jammin # sed -n -e 's/[ \t]*#.*//g;s/[

\t]*$//g;s/^ctrl_interface=//p' /etc/wpa_supplicant.conf

/var/run/wpa_supplicant

Saturn jammin #

```

Hope that helps, thanks again.

<edit2> after reading that thread a little more, i dont have an /etc/conf.d/net.wlan0. Should I? (Excuse my newbieness   :Embarassed:   )

----------

## linear

 *jammin wrote:*   

> Also, on a side note, is it possible to test this without rebooting? Ive tried bringing wlan0 down then -
> 
> ...<snip>
> 
> <edit2> after reading that thread a little more, i dont have an /etc/conf.d/net.wlan0. Should I? (Excuse my newbieness    )

 

Okay, to answer both questions simultaneously, you should have a /etc/init.d/net.wlan0.  To bring it down, you would use:

```
$ /etc/init.d/net.wlan0 stop
```

then to bring it back up, use:

```
$ /etc/init.d/net.wlan0 start
```

and you shouldn't have a /etc/conf.d/net.wlan0 file, but you should have a /etc/conf.d/wireless as well as a /etc/conf.d/net if you are going to use a wireless interface.

HTH.

/bk

----------

## UberLord

 *jammin wrote:*   

> after reading that thread a little more, i dont have an /etc/conf.d/net.wlan0. Should I? (Excuse my newbieness    )

 

Please tell me you do have an /etc/init.d/net.wlan0 though?

Just to make sure do this

```
rm -f /etc/init.d/net.wlan0

ln -s net.lo /etc/init.d/net.wlan0

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

----------

## jammin

Thanks for the replies guys.

Im at home home for a week so cant try but will report back as soon as I can.

Thanks again.

----------

## jammin

Sorted  :Smile: 

Thanks guys.

I did:

```

rm -f /etc/init.d/net.wlan0 

ln -s net.lo /etc/init.d/net.wlan0 

/etc/init.d/net.wlan0 start

```

Then did a 

```

rc-update add net.wlan0 default

```

And it all works spot on from boot  :Smile: 

Thanks again all; here is my /etc/conf.d/net for anyone serching and finding this:

```

modules=( "wpa_supplicant" )

wpa_supplicant_wlan0="-Dwext -iwlan0 c=/etc/wpa_supplicant.conf"

config_wlan0=( "dhcp" )

dhcpd_wlan0=" -t 10"

```

Where wlan0 is not the ESSID of my router but the name of the wirless interface.

----------

