# Wireless - is there a GENTOO-way?

## larand54

I have a DLINK 650+ PCMCIA card that works in gentoo if you first set it up manually by running iwconfig.

But I don't think you should need to do it like that. 

After looking around I found that you could use a file (/etc/conf.d/wireless) to setup the parameters for iwconfig but HOW do I make Gentoo use it?

I have created a link in /etc/init.d with the name of net.wlan0 and points to net.eth0. I also configured /etc/conf.d/net as any network card.

If I then run /etc/init.dnet.wlan0 it answeres: "* Keeping kernel configuration for wlan0".

If I then stop it and start it again - it tries contacting the dhcp-server but fails.

There must be some special setting for using wireless in Gentoo but what?

Thanks in advance for som guidance.Last edited by larand54 on Mon May 23, 2005 9:51 pm; edited 1 time in total

----------

## coax

omg, it's ...

google

http://gentoo-wiki.com/HOWTO_Wireless_Configuration_and_Startup

 :Wink: 

----------

## larand54

Well, that was fast! Thank you. And I can hardly wait until the link will come up again.  :Wink: 

The link was down when I first tried it but now it's up again.  :Smile: 

----------

## larand54

I didn't make it  :Sad: 

I still need to issue the iwconfig  manually to make it work.

If I only run iwconfig I can see that it has not got any "essid" instead the field nickname has got the essid!

That sounds buggy to me, but probably I've made the misstake but I can't find it  :Sad: 

----------

## Gherald

I'll tell you what works for me:

1) upgrade to the latest baselayout  (put sys-apps/baselayout in /etc/portage/package.keywords and then emerge baselayout)

2) etc-update or dispatch-conf

3) put "essid_wlan0=<essid>" in /etc/conf.d/wireless

4) /etc/init.d/net.wlan0 start

----------

## larand54

I ve already made those things, I followed the wiki-link above and copied the commands from there.

I have configured the /etc/conf.d/wireless file as:

```

essid_wlan0="myEssid"

mode_wlan0="managed"

channel_wlan0="6"

iwconfig_wlan0="rate 22M"

key_myessid="9999AAAA67"

preferred_aps=( "myessid" )

```

And I can't se anything wrong with that.

But as I said,

The "nickname" becomes myessid and "ESSID" becomes "EFFID:off/any".Last edited by larand54 on Thu May 19, 2005 1:47 pm; edited 1 time in total

----------

## macawgumbo

echo your commands to /etc/init.d/local.start

```
echo iwconfig wlan0 essid your_essid_here >> /etc/init.d/local.start
```

Really what your doing here is having the startup script do the commands for you.  It is the only and quickest way that worked for me.  Also, remove ntp-client from the default runlevel (you know the time syncing daemon) and echo the line 

```
ntpdate -b -u pool.ntp.org
```

 as well, but only after all the lines for wireless config.  This will allow the ntp daemon to use your wireless connection to access the internet.

----------

## larand54

Yes, that's an easy way to get the wireless work! But it doesn't make it easy for you in other ways. You mentioned ntpd for instance, but you also need to move startup for ssh and other network-dependent things.

If you want to make your own script you could of course make your own startup script for the network in /etc/init.d that replaces the original net.lo and then you don't need to move the other scripts out.

This is of course not quite as easy and I really want to avoid all these things that breakes "Gentoo"-rules.

But thank you anyway.  :Smile: 

----------

## jakubc

hi,

could you post your /etc/conf.d/net and /etc/conf.d/wireless (only uncommented lines), as well as your baselayout version?  Just to define the problem more thoroughly...

----------

## coax

And how about you ditch the wep key first, to see if you can get it to work without it.

----------

## larand54

 *jakubc wrote:*   

> hi,
> 
> could you post your /etc/conf.d/net and /etc/conf.d/wireless (only uncommented lines), as well as your baselayout version?  Just to define the problem more thoroughly...

 

/etc/conf.d/wireless:

```

essid_wlan0="myessid"

mode_wlan0="managed"

channel_wlan0="6"

iwconfig_wlan0="rate 22M"

sleep_scan_wlan0="5"

key_myessid="9999999999"

preferred_aps=( "myessid" )

```

Baselayout = 1.11.12-r1

----------

## larand54

 *coax wrote:*   

> And how about you ditch the wep key first, to see if you can get it to work without it.

 It won't help as it doesn't get it's ESSID setup.

Also...it works when I do this manually:

```

iwconfig wlan0 essid myessid channel 6 key 9999999999 mode managed rate 22M

/etc/init.d/net.wlan0 start

```

But if I run the start command before iwconfig it won't work.

Why does the "Nickname" get the "myessid" when essid is cleared?

----------

## larand54

BUMP!

I still need some help! I could, and have, go into the scripts and try figuring out myself but I think I'm not ready for that yet  :Wink: . Need some more experience.

----------

## daviessm

Hi,

I was having the same problem as you and to make it work (note: not fix  :Wink: ) I wrote a little shell script that passed all the options to iwconfig in my home dir, like:

```
#!/bin/bash

iwconfig eth1 essid <the ESSID>

iwconfig eth1 key <the WEP key>

ifconfig eth1 up
```

Then I edited the /etc/init.d/net.eth1 script and added a line to call that script before the line that calls dhcpcd.

Hope that helps  :Smile: 

----------

## jakubc

hi,

try editing the rate line like so:

```

essid_wlan0="myessid"

mode_wlan0="managed"

channel_wlan0="6"

rate_wlan0="22M"

sleep_scan_wlan0="5"

key_myessid="9999999999"

preferred_aps=( "myessid" ) 

```

cosmetic adjustment, but might work:-) 

 *Quote:*   

> 
> 
> Why does the "Nickname" get the "myessid" when essid is cleared?
> 
> 

 

you get this after the script has run right?  I got this when things weren't working too, I presume it is just the script cleaning up after itself... try to do a ctrl-c when the script is running, then run "iwconfig" and you will (hopefully) see that everything is as it should be according to your /etc/conf.d/wireless

Also please post your /etc/conf.d/net if the problem persists.

----------

## larand54

Hi,

 *jakubc wrote:*   

> hi,
> 
> try editing the rate line like so:
> 
> ```
> ...

 

Well,... it didn't work but...

 *jakubc wrote:*   

>  *larand54 wrote:*   
> 
> Why does the "Nickname" get the "myessid" when essid is cleared?
> 
>  
> ...

 

It displayed the correct "ESSID" but wrong channel and rate.

if I just issue:

```
iwconfig wlan0 channel 6

```

and then restart 

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

 it works. Strange huh?

 *jakubc wrote:*   

> 
> 
> Also please post your /etc/conf.d/net if the problem persists.
> 
> 

 

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

```

iface_eth0="dhcp"

dhcpcd_eth0="-N"

iface_wlan0="dhcp"

dhcpcd_wlan0="-N -h "$HOSTNAME

```

eth0 has not been used (not started) when testing the wireless.

----------

## jakubc

hi,

well if your /etc/conf.d/net looks like that, then what you are missing in it is this:

```

modules=( "iwconfig" )

```

this tells the startup script (/etc/init.d/net.lo) to look in /etc/conf.d/wireless for your setings (or rather into iwconfig's config file which is /etc/conf.d/wireless).  Try that and see what happens.  When "iwconfig" showed your essid it was (I think) because the card performed an automatic scan, and found your AP to be the one with the best signal... but didn't have the proper settings without the setup that you feed into it with your "iwconfig" command...

I am keeping my fingers crossed!

----------

## larand54

Hope you don't broke your finger's..I really thought you where wright this time but....no same thin again.

This is how the startup look like:

```

Starting wlan0

 Loading networking modules for wlan0

   modules: iwconfig essidnet iptunnel ifconfig dhcpcd apipa

        iwconfig provides wireless

        ifconfig provides interface

        dhcpcd provides dhcp

    Configuring wireless network for wlan0

    Connecting to "myessid" (WEP enabled - open) ...

  Failed to configure wireless for wlan0

```

 And this is hw it look like when it works:

```

Starting wlan0

   Loading networking modules for wlan0

     modules: iwconfig essidnet iptunnel ifconfig dhcpcd apipa

       iwconfig provides wireless

      ifconfig provides interface

       dhcpcd provides dhcp

   Configuring wireless network for wlan0

   Connecting to "myessid" (WEP enabled - open) ...

   wlan0 connected to "myessid" at 00:xx:xx:xx:xx:xx

   in managed mode (WEP enabled - open)

   Configuring wlan0 for "myessid" ...

   Bringing up wlan0

     dhcp

       Running dhcpcd ...

       wlan0 received address 172.16.68.100

```

Hereis a part from dmesg:

```

module count --

new ratevector: 82 84 8b 96 ac

Incompatible basic rates

Incompatible operational rates

module count ++

OPENING DEVICE

acx_set_status: Setting status = 1 (SCANNING)

<acx_set_timer> Elapse = 2500000

attempt to set the timer when the card interface is not up!

ACX100 f/w ver >= 1.9.3.e or ACX111 --> using s/w timer

Got Info IRQ: status 0x0000, type 0x0001: scan complete

Radio scan found 0 stations in this area

acx_complete_dot11_scan: no matching station found in range yet

acx_set_status: Setting status = 1 (SCANNING)

<acx_set_timer> Elapse = 2500000

attempt to set the timer when the card interface is not up!

initial settings update on iface activation.

get_mask 0x00000000, set_mask 0x0026debc

important setting has been changed --> need to update packet templates, too

Updating Tx fallback to 0 retries

Updating transmit power: 18 dBm

changing radio power level to 18 dBm (41)

Updating antenna value: 0x8F

Updating Energy Detect (ED) threshold: 112

Updating Channel Clear Assessment (CCA) value: 0x0D

Updating channel: 6

Updating: enable Tx

Updating: enable Rx on channel: 6

Updating regulatory domain: 0x30

Updating WEP key settings

Setting WEP key: 0 with size: 5

Setting WEP key 0 as default.

Starting radio scan

acx_set_status: Setting status = 1 (SCANNING)

<acx_set_timer> Elapse = 2500000

attempt to set the timer when the card interface is not up!

get_mask 0x00000000, set_mask 0x00001000 - after update

FIXME: most likely needs refinement, first implementation version only...

get_mask 0x00000000, set_mask 0x00001040

setting RXconfig to 2010:0fdd

get_mask 0x00000000, set_mask 0x00001000 - after update

FIXME: most likely needs refinement, first implementation version only...

get_mask 0x00000000, set_mask 0x00001040

setting RXconfig to 2010:0fdd

get_mask 0x00000000, set_mask 0x00001000 - after update

new ratevector: 82 84 8b 96 2c

Incompatible basic rates

Incompatible operational rates

get_mask 0x00000000, set_mask 0x00201000

Updating Tx fallback to 1 retries

get_mask 0x00000000, set_mask 0x00001000 - after update

get_mask 0x00000000, set_mask 0x00001000

get_mask 0x00000000, set_mask 0x00001000 - after update

get_mask 0x00000000, set_mask 0x00001200

Updating transmit power: 18 dBm

changing radio power level to 18 dBm (41)

get_mask 0x00000000, set_mask 0x00001000 - after update

get_mask 0x00000000, set_mask 0x00041000

important setting has been changed --> need to update packet templates, too

Updating WEP key settings

Setting WEP key: 0 with size: 5

Setting WEP key 0 as default.

Starting radio scan

acx_issue_cmd FAILED: Scan in progress [4954850 uSec] Cmd: 8h, Result: Fh

acx_set_status: Setting status = 1 (SCANNING)

<acx_set_timer> Elapse = 2500000

get_mask 0x00000000, set_mask 0x00001000 - after update

get_mask 0x00000000, set_mask 0x00011000

important setting has been changed --> need to update packet templates, too

Starting radio scan

acx_issue_cmd FAILED: Scan in progress [4954300 uSec] Cmd: 8h, Result: Fh

acx_set_status: Setting status = 1 (SCANNING)

<acx_set_timer> Elapse = 2500000

get_mask 0x00000000, set_mask 0x00001000 - after update

get_mask 0x00000000, set_mask 0x00041000

important setting has been changed --> need to update packet templates, too

Updating WEP key settings

Setting WEP key: 0 with size: 5

Setting WEP key 0 as default.

Starting radio scan

acx_issue_cmd FAILED: Scan in progress [4953750 uSec] Cmd: 8h, Result: Fh

acx_set_status: Setting status = 1 (SCANNING)

<acx_set_timer> Elapse = 2500000

get_mask 0x00000000, set_mask 0x00001000 - after update

get_mask 0x00000000, set_mask 0x00011000

important setting has been changed --> need to update packet templates, too

Starting radio scan

acx_issue_cmd FAILED: Scan in progress [4964250 uSec] Cmd: 8h, Result: Fh

acx_set_status: Setting status = 1 (SCANNING)

<acx_set_timer> Elapse = 2500000

get_mask 0x00000000, set_mask 0x00001000 - after update

Got Info IRQ: status 0x0000, type 0x0001: scan complete

Radio scan found 0 stations in this area

```

Hope that this could put some light on it... :Sad: 

----------

## jakubc

hmmm...

well all I can glean (I am by far no expert) from dmesg is that it is getting your channel and a WEP key... so try this:

when you do your normal "iwconfig command" connect not writing the channel and WEP key... see if it connects...

also try just putting in the channel and then running the srcipt (did I get you right when you said this worked earlier?)...

also try to take out the sleep_scan from /etc/conf.d/wireless, you don't have it in your "iwconfig command" and it's connecting... 

this is real quick, am going out... I will think about this, and post when I get home...

my fingers didn't break... but it was close, thanks for posting back so fast:-)

----------

## larand54

Hi,

I've been quite busy the last week but have managed to make some more investigation.

One thing that works ist to put in a couple of "echo" statements in the code of 

```
/lib/rcscripts/net.modules.d/iwconfig

#bool iwconfig_configure(char *iface)

#

# The main startup code

# First we bring the interface up, apply defaults, apply user configuration

# Then we test to see if ad-hoc mode has been requested and branch if needed

# Then we scan for access points and try to connect to them in a predetermined order

# Once we're connected we show a report and then configure any interface

# variables for the ESSID

iwconfig_configure() {

   local iface=${1} test x e ifvar=$( interface_variable ${1} )

   local -a essid_APs mac_APs enc_APs

   # We need to bring the interface up to apply stuff

   interface_up ${iface}

      e=$( iwconfig ${iface} mode managed 2>&1 )

echo "Hej! ${e}"

   # Are we a proper IEEE device?

   # Most devices reutrn IEEE 802.11b/g - but intel cards return IEEE in lower case

   # and RA cards return RAPCI or similar which really sucks :(

   # For the time being, we will test prism54 not loading firmware which reports

   # NOT READY!

   x=$( iwconfig_get_type ${iface} )

echo "Hej! ${x}"

   if [[ ${x} == "NOT READY!" ]]; then

      eerror "Looks like there was a probem loading the firmware for ${iface}"

      return 1

   fi

```

You can se where I putted those "echo:s"

Why does this help?

I'm not satisfied with this - it must be a REAL solution....or..?

----------

## freebies_11

Maybe a timing issue?

----------

## larand54

It probably is, but what can I do about it?

Maybee it's an issue for "uberlord"?

Ooops! I'm a guru now! Then I should be able to answer it myself  :Wink: .

But, sorry... I can't!

I've been trying to find the function "interface_up" but failed. Anyone that can tell?

----------

## larand54

Need to add this:

Not always this work either. After that the computer have been power off:d in 24 hours or more, it didn't start the wireless.

I tried several times but no success. After 15 minutes or so it worked. I then powered off again, waited 10 seconds and powred on again.

This time it worked. Funny...or...?

----------

## jakubc

hi,

well you sure are righ about being a "guru", by reaching the 300 posts limit you cease having the right to complain about your own problems and must start solving other peoples problems:-)

back to business...

My connection sometimes doesn't connect at boot also (1 out of about 5 boots), but running "/etc/init.d/net.wlan0 start" starts everything right away (once I had to do this twice)...

so there probably is an issue with the script, and the timing does seem to be a possibility (again I am no script person so please correct me if I'm wrong), because in my case running the same thing twice in a row with 2 different results is strange to say the least...

----------

## larand54

 *jakubc wrote:*   

> hi,
> 
> well you sure are righ about being a "guru", by reaching the 300 posts limit you cease having the right to complain about your own problems and must start solving other peoples problems:-)
> 
> 

 

Tuff times ahead then..?  :Wink: 

 *jakubc wrote:*   

> 
> 
> My connection sometimes doesn't connect at boot also (1 out of about 5 boots), but running "/etc/init.d/net.wlan0 start" starts everything right away (once I had to do this twice)...
> 
> so there probably is an issue with the script, and the timing does seem to be a possibility (again I am no script person so please correct me if I'm wrong), because in my case running the same thing twice in a row with 2 different results is strange to say the least...

 

I'm far away beeing a script person but want to learn. Any way, I'm curios about the function (interface_up) that is called in the iwconfig-script but don't know where to find it. Do you know...?

Hmm.. time too sleep now. Hope I can get some free minutes tommorrow. Good night!

----------

## schmobag

I would suggest using wpa_supplicant instead.  There are instructions here.  Sometimes it works where iwconfig won't.  For example, only wpa_supplicant will work at home with my linksys wrt54g.  On the other hand, only iwconfig works on my school's wireless network.

Good luck

----------

## UberLord

 *larand54 wrote:*   

> It probably is, but what can I do about it?
> 
> Maybee it's an issue for "uberlord"?

 

Maybe it is - and lo I am here!

 *Quote:*   

> I've been trying to find the function "interface_up" but failed. Anyone that can tell?

 

It's found in either the ifconfig or iproute2 modules. Both of these modules provide "interface" so you can only use one or the other and all their functions get remapped to what they provide

So if you're using ifconfig then ifconfig_up becomes interface_up

----------

## UberLord

 *larand54 wrote:*   

> 
> 
> ```
> 
>    # We need to bring the interface up to apply stuff
> ...

 

That may be the solution as you've forced it into managed mode before doing anything. Obviously it's not the end solution as not everyone wants managed.

----------

## larand54

 *UberLord wrote:*   

>  *larand54 wrote:*   
> 
> ```
> 
>    # We need to bring the interface up to apply stuff
> ...

 

Thanks!

Hmm, I'm not sure what you mean, I didn't change the existing code I just added the "echo:s".

The configuration file is setup for managed if that's what you mean?

----------

## catzooka

from my experiences, the best way to get my wireless card to properly work is to give the iwconfig commands in the following specific sequence.

first i give it the key:

```
iwconfig wlan0 enc someKey restricted
```

then the essid:

```
iwconfig wlan0 essid someEssid
```

then i bring up the interface:

```
ifconfig wlan0 up
```

and finally, dhcpcd configures wlan0:

```
dhcpcd wlan0
```

and only in this sequence will it work.

also, it is important that if you were to put these commands into a script, make sure you put sleep 1; statements inbetween, because elseway there isn't enough time inbetween commands for the wlan0 card to register the commands (this might somewhat explain why putting those echo's into your script helped you).

im not quite sure if this is just specific to my card (I have a NetGear MA521 PCMCIA Wireless card with the rtl8180 driver inside ndiswrapper), but hopefully my experience with my card somehow relates to your problem and helps you out. good luck.

----------

## larand54

 *Deftochino wrote:*   

> from my experiences, the best way to get my wireless card to properly work is to give the iwconfig commands in the following specific sequence.
> 
> first i give it the key:
> 
> ```
> ...

 

For me it's possible to start the network just by issuing iwconfig with all parameters at once (essid, channel, key, mode, rate) and then "ifconfig wlan0 up".

But I think it's not necessary to run ifconfig afterwards. I think it's enough if you run it before iwconfig but I'm not sure at the moment.

You see, the problem is that I wan't to have it work in the "GENTOO"-way and be more safe in future updates.

If we can pin-out the issues with this and other cards we will get a more useful GENTOO system that can attract more people.

But you got an important point when saying that we need a sleep between the commands. But could we get it to work by checking some status-flags from the card/driver to get the init faster and more safe?

Thanks for your tip!  :Very Happy: 

----------

## UberLord

 *larand54 wrote:*   

>  *UberLord wrote:*    *larand54 wrote:*   
> 
> ```
> 
>    # We need to bring the interface up to apply stuff
> ...

 

No, that line changing to managed mode is not in my source.

And your comment leaves me confused - have you managed to get this working or not? If so, what did you do?

----------

## UberLord

 *larand54 wrote:*   

> For me it's possible to start the network just by issuing iwconfig with all parameters at once (essid, channel, key, mode, rate) and then "ifconfig wlan0 up".
> 
> But I think it's not necessary to run ifconfig afterwards. I think it's enough if you run it before iwconfig but I'm not sure at the moment.

 

Would you care to post the commands and config (if different from the 1st post)?

 *Quote:*   

> 
> 
> You see, the problem is that I wan't to have it work in the "GENTOO"-way and be more safe in future updates.
> 
> If we can pin-out the issues with this and other cards we will get a more useful GENTOO system that can attract more people.
> ...

 

Wise man.

You can however do this in conf.d/net

[code]

# Disable wireless support

modules=( "!iwconfig" "!wpa_supplicant" )

preup() {

   if [[ ${IFACE} == "wlan0" ]]; then

      interface_up ${IFACE}

      iwconfig ${IFACE} essid foo key s:bar

      # Wait for association. We can either use a Gentoo builtin

      # to check for association or we can just sleep X seconds

      # and hope.

      iwconfig_wait_for_association ${IFACE} || return 1

      # sleep 5

   fi

}

 *Quote:*   

> But you got an important point when saying that we need a sleep between the commands. But could we get it to work by checking some status-flags from the card/driver to get the init faster and more safe?

 

There is an option to sleep after doing a scan, but as you're hardcoding the ESSID it's irrelevant.

----------

## larand54

[quote="UberLord"][quote="larand54"] *UberLord wrote:*   

>  *larand54 wrote:*   
> 
> ```
> 
>    # We need to bring the interface up to apply stuff
> ...

 

I'm sorry  :Embarassed:  I remember now, I copied some lines from another section but forgot to remove this one.

The situation is this:

I have installed the latest baselayout, wireless tools bash etc..

I have added the startscript (symbolic link) /etc/init.d/net.wlan0

I have setup the /etc/conf.d/wireless like this:

```

essid_wlan0="secret"

mode_wlan0="managed"

channel_wlan0="6"

iwconfig_wlan0="rate 22M"

key_default="10HEXCHARS"

preferred_aps=( "secret" )

#sleep_scan_wlan0="15"

```

If I run /etc/init.d/net.wlan0 start --- it fails!

If I run ifconfig wlan0 up before I run the startscript it works.

Otherwise it sometimes work if have the two "echo"-lines together with my hardcoded iwconfig-line.

That's it. Hope this clear's things up somewhat[/b].

I've also tried the sleep command, in the wireless-config file, without any success.

----------

## UberLord

Try this in /etc/conf.d/net

```

preup() {

if [[ ${IFACE} == "wlan0" ]]; then

   interface_up ${IFACE}

   sleep 10

fi

}
```

If that works, you may want to experiment with lowering the sleep

----------

## vishnoo

Hello,

I'm experiencing the same kind of problem, and thanks to you I found a "temporary solution" - ahem - but a quite dissatisfying one ...

I have a ralink  card and use the rt2500 module : the whole thing seems to come from this driver, so you (larand54) should take a look at yours too.

iWhen i configure it manually i must do :

```

iwconfig ra0 key "XXXX...."

ifconfig ra0 up

iwconfig ra0 essid my_essid"

dhcpcd ra0

```

otherwise if change the order of  lines 2 and 3,  the essid is forgotten....

So, naturally the automatic configuration in can't work : the essid I put in "preferred_aps" gets lost.

I had the same problem with this driver on other distributions and i had to put a "pre-up" keyword in my /etc/networking/interfaces.

What suprised me was that i didn't find other people with the same problem...

Here with gentoo, i can't find an almost clean solution...

Just like larand54, I want to use the gentoo conf files and absolutely not a personnal script with the if/wconfigs

(gentoo conf  is for me one of the strong points of gentoo)

Without dhcp I have this in my /etc/conf.d/net : (for the example i put everything in the "net" file and nothing in "wireless")

```

key_my_essid="XXXX..."

preferred_apps=( "my_essid" )

iface_ra0="192.168.0.2  broadcast 192.168.0.255 netmask 255.255.255.0"

gateway="ra0/192.168.0.254"

# dirty trick

postup() {

if [[ ${IFACE} == "ra0" ]]; then

   iwconfig ${IFACE} essid my_essid

fi

}

```

But with dhcp it gets really really dirty (with a preup() too...) and i'm even ashamed to show it here  :Embarassed: 

The result is that everything works with a " /etc/iinid.d/net.ra0 start "  but it's intellectually dissatisfying to have things called two times and a conf file which is not clean nor clear at all.

Don't know what to do with that...(ideally if I was well educated I should take a look at the driver sources  :Wink:  )

----------

## UberLord

 *vishnoo wrote:*   

> 
> 
> iWhen i configure it manually i must do :
> 
> ```
> ...

 

Really? That - well sucks.

Does this work?

```

iwconfig ra0 key "XXXX...."

ifconfig ra0 up

iwconfig ra0 essid my_essid"

ifconfig ra0 up

dhcpcd ra0

```

If not, could you provide the output of iwconfig ra0 please?

----------

## vishnoo

 *UberLord wrote:*   

> 
> 
> Does this work?
> 
> ```
> ...

 

yes, it works : 

my ifconfig is like girls, it seems to have a selective memory  :Smile: 

----------

## UberLord

Does this work?

```

ifconfig ra0 up

iwconfig ra0 key "XXXX...."

ifconfig ra0 up

iwconfig ra0 essid my_essid"

ifconfig ra0 up

dhcpcd ra0

```

----------

## vishnoo

 *UberLord wrote:*   

> Does this work?
> 
> ```
> 
> ifconfig ra0 up
> ...

 

Yes, it does

In fact, even this works :

```

ifconfig ra0 up

iwconfig ra0 key "XXXX...."

iwconfig ra0 essid my_essid"

ifconfig ra0 up

dhcpcd ra0

```

(this is the sequence i used in the debian conf with "pre-up ifconfig ra0 up" )

But with only :

```

ifconfig ra0 up

iwconfig ra0 key "XXXX...."

iwconfig ra0 essid my_essid"

dhcpcd ra0

```

the dhcp fails, even if the informations provided by iwconfig & ifconfig are exactly the same that in the previous one.

In fact this is the first time I see it fails even if  the AP mac address is correctly detected

What i mean by that is :

```

# ifconfig ra0 up

# iwconfig ra0 key "XXXX...."

# iwconfig ra0 essid my_essid"

# iwconfig ra0 

ra0       RT2500 Wireless  ESSID:"my_essid"

          Mode:Managed  Frequency=2.472 GHz  Access Point: XX:XX:XX:XX:XX:XX

          Bit Rate:48 Mb/s

          RTS thr=2312 B   Fragment thr=2312 B

          Encryption key:XXXXXXX.....   Security mode:open

          Link Quality=54/100  Signal level:-218 dBm  Noise level:-256 dBm

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

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

```

with the good Access point and all.

So, after that a "dhcpcd ra0" fails if not preceeded by another "ifconfig ra0 up"

----------

## UberLord

OK, could you edit /lib/rcscripts/net.modules.d/iwconfig and goto line 882 (or there abouts) and change

```
iwconfig_configure ${iface} && return 0
```

to read

```
iwconfig_configure ${iface} && interface_up ${iface} && return 0
```

And test again please - based on what you have said it should now work without any postup hacks

----------

## vishnoo

Thanks a lot for your support  :Smile: 

It's very strange, but it doesn't work either, even if I change the order to :

```
 interface_up ${iface} && iwconfig_configure ${iface} && return 0
```

while this  in /etc/conf.d/net works well :

```

preup() {

if [[ ${IFACE} == "ra0" ]]; then

    ifconfig ${IFACE} up

    iwconfig ${IFACE} essid my_essid

fi

}

```

I don't know how to make things more verbose (the einfo ..., some echo would help) in your wireless script it's as stdout was redirected, but don't know when.

----------

## UberLord

OK, try this line.

```
iwconfig_configure ${iface} && interface_up ${iface} && iwconfig ${iface} essid "${ESSID}" && return 0
```

If it still fails then there is nothing I can do with the code that would make it work for you without adversely affecting what we currently have. I would recommend sending this bug upstream to the ra devs.

Maybe you could try wpa_supplicant if it's supported for ra cards?

----------

## vishnoo

Thanks really really a lot for your help.

Your line doesn't work, but I totally agree the problem obviously comes from the driver.

I'll try to see it with them (event if I didn't see anyone with the same problem)

In fact, I can't complain too much, all works well with the preup()  :Smile: 

----------

## UberLord

care to put RC_VERBOSE="yes" into /etc/conf.d/net, restart it (without your preup hack) and post the output as it maybe something else?

BTW, the new config syntax is

```

config_ra0=( "192.168.0.2  broadcast 192.168.0.255 netmask 255.255.255.0" )

routes_ra0=( "default via 192.168.0.254" )
```

Thanks

----------

## depontius

 *schmobag wrote:*   

> I would suggest using wpa_supplicant instead.  There are instructions here.  Sometimes it works where iwconfig won't.  For example, only wpa_supplicant will work at home with my linksys wrt54g.  On the other hand, only iwconfig works on my school's wireless network.
> 
> Good luck

 

I'm just getting into wireless over the past week. I have a WRT54G, and my R50 (Atheros wireless) laptop works with it in WPA/AES mode, as well as Cisco-LEAP at work. I'd like to get Linux working wireless too, but am at an impass at the starting gate.

Are you also switching between wpa_supplicant and xsupplicant when you switch between wpa_supplicant and iwconfig? The stock Linux instructions at work use xsupplicant, but they're only concerned with LEAP, and probably hotels or other open hotspots that aren't meant to be secure. To get WPA, it takes wpa_supplicant. The wpa_supplicant docs say it can do LEAP, but only if the driver has the necessary support. I've searched against MadWiFi (the Atheros driver) and haven't been able to discover if it has the necessary support, or not. Being unfamiliar with wireless, I'm not eager to take this on as a try-it-out proposition that might not even be capable of working, given the amount of trouble others have had even with the recommended xsupplicant. Nor do I wish to downgrade my home security to WEP.

Switching between x and wpa_ supplicants seems to be the only way to connect to both places, though I haven't really checked to see if they're mutually exclusive, it seems that they both fool around in the same conf.d files.

----------

## vishnoo

 *UberLord wrote:*   

> care to put RC_VERBOSE="yes" into /etc/conf.d/net, restart it (without your preup hack) and post the output as it maybe something else?

 

No problem appears with verbose. Don't care, it's my driver which is odd  :Confused: 

Thanx for all and for the  new syntax which is clearer especially for the route  :Cool: 

----------

