# Wireless configuration and startup - The Gentoo way

## UberLord

WIRELESS CONFIGURATION IS NOW IN PORTAGE

It's in sys-apps/baselayout-1.11.0 - which is currently package.masked

If you wish to try it out, do the following

 Unmask it

```
mkdir -P /etc/portage

echo "=sys-apps/baselayout-1.11.0" >> /etc/portage/package.unmask
```

 If you're running x86 instead of ~x86, set baselayout to the ~x86 package

```
echo "=sys-apps/baselayout-1.11.0 ~x86" >> /etc/portage/package.keywords
```

 emerge baselayout

```
emerge sync

emerge -av sys-apps/baselayout

etc-update
```

Ensure that version 1.11.0 or newer is going to get installed and go for it!

Otherwise, find out why it's not (hint: step 1 or 2 is wrong)

Ensure that etc-update updates /etc/conf.d/net and /etc/conf.d/net.lo - please do this

 Then symlink any net.* devices to net.lo instead of net.eth0

 Consult /etc/conf.d/net.example for details about how to configure networking

 If you have net-wireless/wireless-config installed, remove it

```
emerge unmerge net-wireless/wireless-config

rm /etc/init.d/wireless.sh
```

If you did not update /etc/conf.d/net in the steps above, you need to manually remove the patch to /etc/conf.d/net which loads wireless.sh and calls wireless_* in preup(), predown() and/or postdown() functions if they exist - it's now automatic

 Consult /etc/conf.d/wireless.example for how to configure wireless

And you're done  :Smile: 

PS - you need to have wireless-tools emerged for wireless to work ....

FAQ

Q. I don't have net.wlan0, net.eth1, net.ath0 or similar in /etc/init.d!

A. Read up on Gentoo networking in their handbook

http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=8#doc_chap2

A2. The docs will be wrong when baselayout hits stable - you need to symlink to net.lo instead of net.eth0

Q. I'm seeing Wireless extensions not found for $interface - but it's a wireless device!

A. You need to enable wireless-extensions in your kernel.

To do this, enable the following config options in /usr/src/linux/.config

```
CONFIG_NET_RADIO=y

CONFIG_NET_WIRELESS=y
```

Then recompile your kernel and modules and re-install them

If your driver is external then re-compile and re-install that.

Finally, re-emerge wireless-tools against the new kernel and driver

Q. I get the following error or similar

```
SIOCSIFADDR: No such device
```

A. It's a kernel/driver problem. Chances are you're using ndiswrapper and it's not configured correctly.

Q/ I get the following error or similar

```
SIOCSIFFLAGS: No such file or directory
```

A. Again, it's a driver problem. This normally means that the firmware for your card has not been uploaded properly.

Q. I have an Prism based card and it appears to configure correctly but it's unreliable.

A. You may have old buggy firmware. Here's a possible fix (Thanks to hotplainrice)

Q.Are there any drivers that do not work with this?

A.The only one I know of is linux-wlan-ng. They have their own setup software which is vastly different from anyone elses. All other drivers use wireless-tools which is what my script uses. The developers of linux-wlan-ng are in the process of making their driver support wireless-tools - so eventually it should work. Bug them about this, not me.

Q. WTF am I doing wrong?

A. Please check that you have a working kernel module for your wireless card. There's a whole lotta hardware out there that I do not have, and probably will never have and I cannot help with driver/hardware issues. Please start a new thread in the forum if this is the case.

Q. OK, I got a working kernel module that's reported by iwconfig but it's still not working!

A. I need information. Specifically, the output of net.eth0 start and any uncommented lines in /etc/conf.d/wireless

Q. Will this work on the LiveCD?

A. No Gentoo LiveCD currently supports wireless - so no

However, you should be able to install Gentoo from a Knoppix CD and some of them support wireless.

Q. Is WPA supported?

A. Not at the moment, but I do have plans to support it

Q. I cannot get WEP working!

A. WEP is a fickle beast. Some drivers don't support both encryption methods, some cards/drivers won't talk to some Access Points. Remember that encryption method on the Access Point has to match the method on the client otherwise it will not work. Basically, if you can get WEP to work on the command line it will work with my script.

Q. The script claims to connect, but I cannot get a DHCP address or ping computers

A Are you using WEP? See above. Remember that this script just configures wireless for you and some settings allow you to "connect" even though they are blatently wrong. This is dependant on card, driver, AP, etc. If you've got this far, don't expect too much help from me as I'm a developer and not a network engineer.

OLD EBUILD INSTRUCTIONS

Ebuild for sys-apps/baselayout>=1.8.11 <1.11.0

net-wireless/wireless-config-0.6.2.ebuild

If you used my old net.eth0 script prior to using this ebuild, you do not need it anymore

If you've never put a custom ebuild into your local portage tree before, here's how

edit /etc/make.conf and enable PORTDIR_OVERLAY (defaults to /usr/local/portage)

ensure that the folder exists 

```
mkdir -p /usr/local/portage/net-wireless/wireless-config
```

add wireless-config to package.keywords if not running ~ARCH

```
mkdir -p /etc/portage

echo "net-wireless/wireless-config ~x86" >> /etc/portage/package.keywords
```

(note - change ~x86 to match your ~arch)

You only have to do the above steps once. Repeat the below steps every time you download a custom ebuild

put the ebuild in that folder 

```
cd /usr/local/portage/net-wireless/wireless-config

wget http://rsm1.demon.co.uk/wireless-config-0.6.2.ebuild
```

fetch and digest the source 

```
ebuild wireless-config-0.6.2.ebuild digest
```

emerge it and follow the ebuilds instructions

```
emerge net-wireless/wireless-config
```

Checkout /etc/conf.d/wireless.example for all settings and save them to /etc/conf.d/wireless

enjoy wireless networking  :Smile: 

END

Newcomers to this thread are advised to skip to the last few pages of this thread as it's very big and starts off with stuff that is no-longer used

MOD EDIT:

13.DEC.04:  Since it is "outdated" I've moved it back to Networking & Security from Documentation, Tips & Tricks. --pjp

 Moved from Networking & Security.

-- Deathwing00

NOTE: Currently cannot detect if /etc/conf.d/net has been patched when >=sys-apps/baselayout-1.10 is installedLast edited by UberLord on Thu Sep 16, 2004 5:25 pm; edited 125 times in total

----------

## UberLord

I know some people like em - or at least they're trying them

I've updated them.  :Very Happy: 

Changes

Changed the configuration slightly.

Now, you can set channel, rate, mode, rts, frag and essid per interface instead of per essid (makes for sense I think)

Features

Warnings when you try an unsupported feature on your driver

If your card can't scan - and my lappy one won't - or you need to choose essids manually you can configure them via grub.

Append wireless_essid_ath0=UberNET to the kernel line

Of course, change ath0 and UberNET to your interface and essid  :Wink: 

Gimmie some feedback if you love em or hate em   :Razz: 

----------

## preacher

I like it a lot, it made configuring my new wireless card much easier than I thought it would be. However, I'm just not there yet. When I try 

#  /etc/init.d/net.ath0 start

I get the following output:

/sbin/runscript.sh: line 20: roaming: command not found

 * Bringing ath0 up...

 * Failed to bring ath0 up                                                [ !! ]

What gives?

Also, when I try to load the ath_pci module, I get an error message saying 

/lib/modules/2.4.22-gentoo-r3/net/ath_pci.o: init_module: No such device

Hint: insmod errors can be caused by incorrect module parameters, including invalid IO or IRQ parameters.

      You may find more information in syslog or the output from dmesg

/lib/modules/2.4.22-gentoo-r3/net/ath_pci.o: insmod /lib/modules/2.4.22-gentoo-r3/net/ath_pci.o failed

/lib/modules/2.4.22-gentoo-r3/net/ath_pci.o: insmod ath_pci failed

The madwifi-driver is the emerged one.

----------

## preacher

Never mind the roaming stuff, it was me who had an extra linebreak where it shouldn't be.

However, I still cant get the ath_pci module to load, I recompiled the kernel with Wireless support built in but the problem remains.

----------

## UberLord

I didn't actually upload the new scripts to the correct location   :Embarassed: 

They are there now  :Smile: 

preacher, whats the problem loading the module? Is there an error? Can you post it or your dmesg output?

----------

## preacher

insmod wlan and ath_hal both go fine, but when i do

```
insmod ath_hal
```

I get

```
Using /lib/modules/2.4.22-gentoo-r3/net/ath_pci.o

/lib/modules/2.4.22-gentoo-r3/net/ath_pci.o: init_module: No such device

Hint: insmod errors can be caused by incorrect module parameters, including invalid IO or IRQ parameters.

      You may find more information in syslog or the output from dmesg
```

And dmesg says

```
wlan: 0.7.2.0 BETA

ath_hal: 0.9.6.3

ath_pci: 0.8.4.0 BETA

ath_pci: No devices found, driver not installed.
```

I've tried a lot now, I made sure wlan was compiled into the kernel, and after reboot I have reemerged both wireless-tools and madwifi-driver.

I've tried switching PCI-slot for my network-card, which is DLink G520+, but still the error remains.[/code]

----------

## UberLord

That card requires the acx100 drivers - madwifi will not work!

Checkout the below link for the driver you need

https://forums.gentoo.org/viewtopic.php?t=122584&highlight=acx100

----------

## preacher

Thanks for your reply, however, that is sadly not the case.

Because of D-Links retarded naming-scheme these devices are very easy to mix up.

After a lot of searching I found out this. The DWL-G520+ is based on a chip from Texas Instruments, for which no driver exists. That's right, nada, zip. Also note that this card is different from the DWL-G520 (without +).

And I bought two, and when one didn't work I opened the other one. Which means that here I am with two useless cards and I can't even return one of them. Woe me.

I tried the wrapper from linuxant, but I got unresolved symbols when loading the module.

I'm sure your scripts are great, but atleast I wont have any use of them in the near (far?) future  :Sad: 

----------

## UberLord

 *preacher wrote:*   

> 
> 
> After a lot of searching I found out this. The DWL-G520+ is based on a chip from Texas Instruments, for which no driver exists. That's right, nada, zip. Also note that this card is different from the DWL-G520 (without +).

 

The acx100 driver is made by Texas Instruments.

Have you even tried it?

----------

## zfc-tinkerer

if you have a card which is truly not supported by any linux drivers, you might try ndis-wrapper (available on sourceforge.net) which will allow you to use windows drivers for that card.  Just don't do the dumb thing I did and forget to get the most recent version of the windows drivers.  I'm not crazy about using non-native drivers like this, but I already have the card, so it's not like I bought a card planning on using the windows drivers and a wrapper.

ndis-wrapper is free, unlike the linuxant wrapper, and at least for me it seems to run better and be simpler to set up.  if only some brave and wonderful person would make an ebuild for it   :Wink: 

----------

## preacher

Yes I know, but this is another chipset not compatible with acx100.

I haven't tried it since it specifically states that it won't work with the G520+.

However, I actually got driverloader from linuxant working!

Now I am able to run your script, but the output is:

```
corinthian init.d # ./net.eth1 restart

 * Bringing eth1 down...

 * Configuring wireless network for eth1...

 * Scanning for Access Points

 * Found peters

 * Connecting to peters

/sbin/runscript.sh: line 46: [: =: unary operator expected

 * Bringing eth1 up...  
```

The output from ifconfig looks like this:

```
eth1      Link encap:Ethernet  HWaddr 00:80:C8:2D:1E:1D

          UP BROADCAST MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:4 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:100

          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
```

and iwconfig:

```
eth1      IEEE 802.11-DS  ESSID:"peters"  Nickname:"unknown"

          Mode:Managed  Frequency:2.437GHz  Bit Rate=54Mb/s   Tx-Power=0 dBm

          RTS thr:off   Fragment thr:off

          Encryption key:off

          Power Management:off

          Link Quality:1/1  Signal level:-52 dBm  Noise level:-200 dBm

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

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

As you see I don't get an ipadress for some reason...

Btw, I'm temporarly running without encryption just to test things out.

Any ideas?

----------

## bruor

ive just tried your scripts out and while they look promising i have some questions.   

theres a link that says its supposed to be /etc/init.d/net.ath0  but when i try to start it it says it doesnt exist in /etc/conf.d/net...   so i renamed the iface_eth1 to iface_ath0.   is this the right thing to do? 

after trying that it tries to bring up ath0 but it doesnt seem  to work.   

im using a linksys wpc55ag  with the madwifi driver.   

any help you can give would be greatly appreciated

----------

## UberLord

 *bruor wrote:*   

> ive just tried your scripts out and while they look promising i have some questions.   
> 
> theres a link that says its supposed to be /etc/init.d/net.ath0  but when i try to start it it says it doesnt exist in /etc/conf.d/net...   so i renamed the iface_eth1 to iface_ath0.   is this the right thing to do? 

 

Yeah thats right.

Kinda silly really. I made the net script on my lappy and forgot to change the interface back to ath0 for my workstation :/

I've changed mt net script to reflect this

 *Quote:*   

> 
> 
> after trying that it tries to bring up ath0 but it doesnt seem  to work.   
> 
> im using a linksys wpc55ag  with the madwifi driver.   
> ...

 

If you're not getting a DHCP address then try doing this

```
dhcpcd ath0
```

Sometimes the dhcp daemon doesn't fire as the script thinks the link is already "up". I'll look into this some more if this is the case

----------

## bruor

ok i did what you said and,   at the accesspoint at work,   all went well.  

i had to disable the encryption though... 

when i run commands like

```
iwconfig ath0 essid essidname

```

i get this out 

```
Error for wireless request "Set ESSID" (8B1A):

     SET failed on device ath0 ; Invalid argument.

```

id like to get it going with encryption but i if i try to set the key i also get the same output.  am i doing something wrong? 

thanks for your help

----------

## ryandlugosz

I've tweaked the original script a bit... I use ndiswrapper (0.4)  to make my TrueMobile 1300 (Broadcom) wifi work.  I found that I always had to start net.wlan0 (what I had renamed the script to) *twice* before it would successfully connect.

I've attributed this to the fact that before the kernel module is loaded, the iwconfig command does not have an entry for the interface that you're looking for.  Because of this, the setup_ or associate_ wireless commands are skipped over and then the ifconfig $IFACE stuff happens.  This (of course) causes the kernel module to get loaded, but the iwconfig commands (scanning for the essid, key setup, etc) won't have happened (causing dhcpcd to fail).  The second time you run the net.wlan0 start command, iwconfig will have the interface listed since the kernel module have been loaded.  Now the setup_ and associate_ wireless methods will execute and the wireless stuff will work correctly.

My solution was to check to see if the ndiswrapper module has been loaded inside the setup_env method, just before we check to see if the wireless interface is listed in iwconfig.  Doing this makes the script work correctly on the first try.  I have not tested to see what happens when the network is unavailable... hopefully it will time out on it's own.   :Confused: 

Also, I added a line in stop that will remove the ndiswrapper kernel module after stopping all of the interfaces.  Note that before version 0.4 of ndiswrapper an rmmod like this would cause an oops and you're DOA.

Please respond if you can make any improvements / genericise this a bit.

My new version of the script

-Ryan

----------

## amphibious

 *bruor wrote:*   

> 
> 
> when i run commands like
> 
> ```
> ...

 

This is the EXACT error I'm getting... I just offered $10 to the first person that can fix it in this post.

----------

## amphibious

 *ryandlugosz wrote:*   

> 
> 
> Also, I added a line in stop that will remove the ndiswrapper kernel module after stopping all of the interfaces.  Note that before version 0.4 of ndiswrapper an rmmod like this would cause an oops and you're DOA.
> 
> Please respond if you can make any improvements / genericise this a bit.
> ...

 

Can you post the exact command lines you use to get everything working?

----------

## ryandlugosz

 *amphibious wrote:*   

> 
> 
> Can you post the exact command lines you use to get everything working?

 

First, download the latest version of ndiswrapper (0.4).  Install it by running ./install.sh as root.  During the install, give it the correct paths to the windows driver files.

IMPORTANT: When it asks you where to write the module config, write it to:

/etc/modules.d/ndiswrapper

DO NOT write it to modules.conf, because that will get overwritten eventually.  Now, as root run modules-update

Restart.  Now, put my net.wlan0 into your /etc/init.d and add the config lines from the /etc/conf.d/net file that is linked in the beginning of this thread.  Be sure to set the right values for your key that correspond to your essid.  The truemobile 1300 can scan, so you don't need to set an explicit essid.

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

as root & let me know what happens.

You can paypal ryan@dlugosz.net  (just kidding, it's not really necessary)  :Smile: 

-Ryan

----------

## amphibious

 *ryandlugosz wrote:*   

> 
> 
> Restart.  Now, put my net.wlan0 into your /etc/init.d and add the config lines from the /etc/conf.d/net file that is linked in the beginning of this thread.  Be sure to set the right values for your key that correspond to your essid.  The truemobile 1300 can scan, so you don't need to set an explicit essid.
> 
> run /etc/init.d/net.wlan0 start
> ...

 

Ok... well... it gives a pretty generic error:

```
* Bringing wlan0 up...                      [ !! ]

* Failed to bring wlan0 up
```

I added these lines to /etc/conf.d/net:

```
iface_wlan0="dhcp"

dhcpcd_wlan0="-h memory -D"

wireless_essid_wlan0="memory"

wireless_channel_wlan0="13"

wireless_mode_wlan0="auto"

wireless_rate_wlan0="auto"

wireless_rts_wlan0="off"

wireless_frag_wlan0="iff"

wireless_key_memory="dbb6d2a42d"
```

I'm not sure if I've entered the syntax of the key right... it's a 64bit WEP key, the iwconfig manpage is a little ambiguous as to how to enter different kinds of keys.

I'm serious about the money too...

----------

## ryandlugosz

 *amphibious wrote:*   

> 
> 
> wireless_key_memory="dbb6d2a42d"[/code]
> 
> I'm not sure if I've entered the syntax of the key right... it's a 64bit WEP key, the iwconfig manpage is a little ambiguous as to how to enter different kinds of keys.
> ...

 

Could you try putting your key in this format:

wireless_key_memory="restricted DBB6-D2A4-2D"

Then (if you're using my version of net.wlan0) do a /et/cinit.d/net.wlan0 stop and then a /etc/init.d/net.wlan0 start as root.  What happens?

-Ryan

----------

## UberLord

To load the kernel modules automatically, simply add them to /etc/modules.autoload.d/kernel-<version>

That way they should get loaded at boot, which means the you don't need to change the script.

This is the Gentoo recommended way (according to their docs) to configure networking  :Smile: 

----------

## ryandlugosz

 *UberLord wrote:*   

> 
> 
> That way they should get loaded at boot, which means the you don't need to change the script.

 

Hm... I must have missed that in the docs.  Wish I had known about it before changing the script!   :Cool: 

Meh - on the bright side, I probably save 59k or so of memory by removing the driver!   :Laughing: 

-ryan

----------

## ryandlugosz

Anyone have any thoughts on how to modify the script so that it will eventually timeout when connecting to the wireless?  I've been using this as a startup script and if the wireless isn't available it'll sit there for a long time (forever, I think).  

Any thoughts on this?  Is there a way that I can set it up so that if I pass an argument at boot time the network won't start?

Thanks,

Ryan

----------

## UberLord

 *ryandlugosz wrote:*   

> Anyone have any thoughts on how to modify the script so that it will eventually timeout when connecting to the wireless?  I've been using this as a startup script and if the wireless isn't available it'll sit there for a long time (forever, I think).  
> 
> Any thoughts on this?  Is there a way that I can set it up so that if I pass an argument at boot time the network won't start?
> 
> Thanks,
> ...

 

I'll put a timeout in there tomorrow.

The only place it needs to timeout is when trying to associate with an access point.

----------

## jshaw523

I just wanted to reply and say I love the script, much much better then the one I first put together.  I think I am going to modify it slightly so it'll post a specific error message when the network card doesn't support scanning, but other then that it works great.

----------

## UberLord

An error message is printed now  :Smile: 

My lappy doesn't scan, and it prints out an error message for me

Also, I've added the timeout to association (10 secs) and changed the header.

----------

## ryandlugosz

 *UberLord wrote:*   

> An error message is printed now :)
> 
> My lappy doesn't scan, and it prints out an error message for me
> 
> Also, I've added the timeout to association (10 secs) and changed the header.

 

Thanks.  I'll try it out... I tried putting "ndiswrapper" into my modules.autoload.d/kernel-2.6 file, but for whatever reason that causes wlan0 to be brought up really early in the boot sequence and causes lot of "run depscan.sh" errors.  It doesn't see to work correctly anyway.  I'll try using your sript vanilla instead of my changes and see if that fixes things...

BTW: In this iwlist section of the script, don't you want $IFACE instead of eth1?

```
# Initiate a scan

   ifconfig $IFACE up

   # Is scanning supported?

   scan_IFACE="$(iwlist eth1 scan 2>&1 | gawk '/Operation not supported/ { print "no" }')"

```

----------

## UberLord

 *ryandlugosz wrote:*   

> 
> 
> BTW: In this iwlist section of the script, don't you want $IFACE instead of eth1?

 

You're right   :Embarassed: 

I've updated it accordingly  :Smile: 

----------

## UberLord

 *ryandlugosz wrote:*   

> 
> 
> Thanks.  I'll try it out... I tried putting "ndiswrapper" into my modules.autoload.d/kernel-2.6 file, but for whatever reason that causes wlan0 to be brought up really early in the boot sequence and causes lot of "run depscan.sh" errors.  It doesn't see to work correctly anyway.  I'll try using your sript vanilla instead of my changes and see if that fixes things...
> 
> 

 

If my vanilla script has depscan.sh errors, please post them here or email me them so I can fix em  :Smile: 

----------

## fleed

Could this be incorporated into the baselayout? It looks good!

----------

## UberLord

 *fleed wrote:*   

> Could this be incorporated into the baselayout? It looks good!

 

When I'm happy that enough people are using it with a minimum of fuss, I'll submit it as a patch (ie create a diff file against the origonal /etc/init.d/net.etho and /etc/conf.d/net) to bugs.gentoo.org

Say, if there aren't anymore changes by the end of the week to this little script then I'll submit it.

Remember, baselayout is critical to a happily running gentoo, and gentoo really needs a working network!

----------

## Rhysem

It'd be nice if there was a way to specifiy access point's preferred order. In particular, I live on a college campus out in the apartement building area. There are currently probably 5-10 APs visible to me.

It'd also be nice to specify dhcp or an ip and router on a per-essid basis. Again, at home I use a static IP and encryption/mac addy filtering while on campus I connect to the campus DHCP+cisco vpn network.

I may hack at the script, but at the moment I'm more interested in hacking together a ndiswrapper ebuild. Been having issues with getting the driver compile to work (tries to jump out to the kernel source dir and build in the ndis dir, and it just dies. Probably easy to fix but haven't ever really delved into ebuilds that deeply before.)

----------

## UberLord

 *Rhysem wrote:*   

> It'd be nice if there was a way to specifiy access point's preferred order. In particular, I live on a college campus out in the apartement building area. There are currently probably 5-10 APs visible to me.
> 
> It'd also be nice to specify dhcp or an ip and router on a per-essid basis. Again, at home I use a static IP and encryption/mac addy filtering while on campus I connect to the campus DHCP+cisco vpn network.
> 
> 

 

I can add the dhcp / static ip + gateway options easily enough. Hopefully do that tomorrow! No promises though - I've gotta busy week of real work head :/

Not sure how to do a preffered order for AP's though. I'll think about it  :Smile: 

----------

## UberLord

OK - I've got assigning keys, iface, dhcpcd and gateway options to specific essid's working now  :Smile: 

However, the scanning code is currently broken and I won't be able to fix it until I get some free time @ home on my main pc as it's the only hw I've got that supports scanning.

Hopefully get a new version out later tonight ...

----------

## Rhysem

I'll look into possibly snagging it and playing with the code -- easy enough to test cause I've got plenty of APs around. ;-) I didn't get ndiswrapper working right, but I got a first shot at the ebuild and tossed it up as a bug.

----------

## Tripwire

 *preacher wrote:*   

> The output from ifconfig looks like this:
> 
> ```
> eth1      Link encap:Ethernet  HWaddr 00:80:C8:2D:1E:1D
> 
> ...

 

Same type of problem here. I've got a Netgear MA401 card. In XP it works fine. But under Gentoo it won't link up. I tried setting the ESSID to be the network name ("Wireless". Who came up with that I don't know. This is at school). 

My card gets named wlan0 by the kernel. It shows for ifconfig:

```

wlan0    Link encap:Ethernet    HWaddr: 00:09:5B:30:21:3C

         BROADCAST MULTICAST    MTU:1500     Metric:1 

         RX packets:0 errors:0 dropped:0 overruns:0 frame:0

         TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

         collisions:0 txqueuelen:100

         RX bytes:0 (0.0 b)      TX bytes:0 (0.0 b)

         Interrupt:3 Base address:0x100

```

iwconfig shows:

```

wlan0     IEEE 802.11b      ESSID:"Wireless"

          Mode:Master    Frequency:2.422GHz  Access Point: 00:09:5B:30:21:3C

          Bit Rate:11Mb/s   Sensitivity=1/3

          Retry min limit:8  RTS thr:off  Fragment thr:off

          Encryption key:off  

          Power Managment:off

          Link Quality:0 Signal level:0 Noise level:0

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

          Tx excessive retries: 0 invalid misc:35  Missed beacon:0

```

Looks like the driver is loaded ok but the card won't talk to the AP. It works fine under XP.

Any help is appreciated.

----------

## Rhysem

Check the frequency is right.

Also, check that the wifi card is on under linux. I relize it probably is otherwise you wouldn't be seeing wlan0 at all, but if the card was wierd and only turned off transmit that might cause issues.

Have you tried essid "any" to see if it can pick it up?

Might try doing things manually, and slowly. I've noticed driverloader and ndiswrapper sometimes need a few seconds between commands in order for the card to "get it".

Edit:

Arr! Post the code with the per-essid stuff, and I'll have a look at the scanning code.

----------

## UberLord

OK, I've now implemented an essid preference list - and it seems to work  :Smile: 

However, I've only got the one AP here, so I can't test it fully

Debugging this was a right PITA - as iwgetid doesn't work properly with the madwifi driver build I'm using :/

You'll need new init and config scripts.

Lemmie know how it works   :Cool: 

----------

## Tripwire

 *Rhysem wrote:*   

> Check the frequency is right.

 

How?

 *Quote:*   

> 
> 
> Also, check that the wifi card is on under linux. I relize it probably is otherwise you wouldn't be seeing wlan0 at all, but if the card was wierd and only turned off transmit that might cause issues.
> 
> 

 

I doubt that, but again, how would I check?

 *Quote:*   

> 
> 
> Have you tried essid "any" to see if it can pick it up?
> 
> 

 

Unfortunately the ANY settings is not supported. If I use any it gives an error, if I use a specific string, it works. Wireless is the network reported under XP.

 *Quote:*   

> 
> 
> Might try doing things manually, and slowly. I've noticed driverloader and ndiswrapper sometimes need a few seconds between commands in order for the card to "get it".
> 
> 

 

I'm not using driverloader or ndiswrapper. The card is being initialized by the Linux native pcmcia_cs & prism drivers. I tried driverloader and it never found the card.

 *Quote:*   

> 
> 
> Arr! Post the code with the per-essid stuff, and I'll have a look at the scanning code.

 

Was that for me? I don't know what you're referring to. Sorry but I'm a complete newbie at wireless.

----------

## Rhysem

I'm having trouble with it, but I'm unable to determin if the troubles are due mainly to your script, or mainly to ndiswrapper sucking.

It configured things right once... but wouldn't talk to anyone. I think there need to be sleeps in the configure script, otherwise the card doesn't quite 'get it' ya know?

----------

## UberLord

How about posting the script output? And does the iwconfig output match the required AP?

There's two sleeps in the script. A 2 second pause after the interface is brought up for scanning (you don't see this if you set the essid directly on the interface) and 20 half second sleeps whilst it associates with an AP.

If you don't get any errors with the script, then it should be setup OK for the specified configuration.

However, there is a bug with the generic gentoo script that handles dhcp loading and unloading. Sometimes is doesn't load dhcp so it has to be started manually.

If it looks OK but it's not talking then the chances are that the WEP key is not configured correctly.

----------

## UberLord

 *Tripwire wrote:*   

> 
> 
> iwconfig shows:
> 
> ```
> ...

 

This shows that you're not getting anything that the driver can understand. The link quality is 0 - which means you'll get nothing

Invalid misc:35 - means that it is getting something but the driver is not sure what.

Are you hardcoding the access points MAC address?

----------

## Rhysem

typhoon root # modprobe wlan0

Calling putdriver ioctl

Parsing the inf file.

Driver version: 06/11/2003,1.2.0.56

Calling startdriver ioctl

typhoon root # iwconfig

wlan0 ... settings look okay

typhoon root # /etc/init.d/net.wlan0 start

 * Configuring wireless network for wlan0...

 * Scanning for Acess Points

 * Found jbooth

 * Found decrepid13

 * Found linksys

 * Found Apt

 * Found #103

 * Connecting to jbooth... [ ok ]

 * Bringing wlan0 up... [ ok ]

 *    Setting default gateway... [ ok ]

typhoon root #

Looking through things:

iwconfig shows my essid, my bit rate, my key, my AP's hw addy. It has link at 0/100 signal level at -32dBm and noise at -256dBm. iwlist scanning however shows my qual at 0/100, signal level at 29/154 and noise at 0/154. (the laptop is about 1 meter from the AP)

The interface is up, it has the IP it should. Route has the routes it should in it.

Trying to ping anywhere gives: Destination Host Unreachable

Some notes:

Line 162: iwconfig $IFACE up - my wireless (intel pro/2100) doesn't need to be up to scan for APs.

General: there were almost no pauses with the script configuring things. I had a script I used to do this by-hand that worked. It takes about 10-15 seconds with the sleeps I have in it to work, but it brings up things correctly every time.

Line unsure: I edited the ath0 to wlan0 in the script... was one rogue one left.

I tried taking the interface down (ifconfig wlan0 down;rmmod ndiswrapper), then running my script. Interface came up without a hitch. I was going to try yours again but this time when it came up it decided it didn't like scanning (ndis does that on me after it's been loaded once).

----------

## Rhysem

Tried yours again. It scanned successfully this time again, but connected to the wrong AP! APs found in order: decpepid13, jbooth, linksys, Apt, #103. It chose decrepid13 when it's order is jbooth then UIUCNet.

----------

## paranode

If you are using the madwifi drivers and having problems with the card being recognized or giving unexpected errors, you need to download the CVS.  They have been constantly working on these drivers since the August release and they are much improved.  So give that a try first.

----------

## UberLord

 *Rhysem wrote:*   

> Tried yours again. It scanned successfully this time again, but connected to the wrong AP! APs found in order: decpepid13, jbooth, linksys, Apt, #103. It chose decrepid13 when it's order is jbooth then UIUCNet.

 

I have resolved this problem  :Smile: 

However, my server is currently down so I'm unable to post the fixed script.

Hopefully post a fixed version tonight

----------

## UberLord

 *Rhysem wrote:*   

> 
> 
> Line 162: iwconfig $IFACE up - my wireless (intel pro/2100) doesn't need to be up to scan for APs.
> 
> 

 

That was always in from faye's origonal script. I'll try taking it out on my machine and making sure it still works before removing it.

 *Quote:*   

> 
> 
> General: there were almost no pauses with the script configuring things. I had a script I used to do this by-hand that worked. It takes about 10-15 seconds with the sleeps I have in it to work, but it brings up things correctly every time.

 

Could you tell me where you have your sleeps? If sleeping is required then I will put some customisable defaults in!

I've made the sleep before scan customisable as well.

 *Quote:*   

> 
> 
> Line unsure: I edited the ath0 to wlan0 in the script... was one rogue one left.

 

Opps  :Embarassed: 

You did the right thing - this has been resolved in my script

----------

## Rhysem

I'll try to find where pauses are needed, but I'm at work at the moment which may make things more difficult. ;) We have wifi, but I won't be able to verify picking the right AP as there's only one in range.

----------

## Rhysem

I've been thinking some more about this and I'm not sure that a rc-script in etc is the right solution. It's better than where we were, for sure, but what you'd really like would be a daemon process that would keep scanning wifi networks if you lost the old one.

Like if you did suspend-to-disk, you'd want it to re-scan on boot, and I don't think it will with how things are done right now. Of course right now suspend-to-disk with wireless up (ndiswrapper) is better know as write-to-disk-so-you-can-crash-after-restore-on-network-use but hey.

Other script issues:

I don't think I want to set iface_wlan0 if I've got multiple networks I may swap between (one dhcp, one static ip). But if I don't set it, the script gets very unhappy due to checkconfig(). I can set it to dhcp and that works fine at work where we use dhcp, but I'm not sure that'll work at home. Setting it to dhcp is great at work, we'll see if that holds at home.

For what it's worth tho, the script works great at work! :-) *thumbs up!*

----------

## UberLord

 *Rhysem wrote:*   

> I've been thinking some more about this and I'm not sure that a rc-script in etc is the right solution. It's better than where we were, for sure, but what you'd really like would be a daemon process that would keep scanning wifi networks if you lost the old one.
> 
> Like if you did suspend-to-disk, you'd want it to re-scan on boot, and I don't think it will with how things are done right now. Of course right now suspend-to-disk with wireless up (ndiswrapper) is better know as write-to-disk-so-you-can-crash-after-restore-on-network-use but hey.
> 
> 

 

There are a few solutions for wired ethernet for this. I use ifplugd on my lappy which works great! Unplug cable and "net.eth0 stop" gets called. Plug it back in again and "net.eth0 start" gets called.

An rc-script is the correct solution for configuring wireless and networking. We just need a daemon for working out if a connection has been dropped to the AP and restarting the apprioprate net.xxx script.

 *Quote:*   

> 
> 
> Other script issues:
> 
> I don't think I want to set iface_wlan0 if I've got multiple networks I may swap between (one dhcp, one static ip). But if I don't set it, the script gets very unhappy due to checkconfig(). I can set it to dhcp and that works fine at work where we use dhcp, but I'm not sure that'll work at home. Setting it to dhcp is great at work, we'll see if that holds at home.

 

The new script - the one you have caters for this.

You can set wireless_iface_Home="dhcp" and wireless_iface_Work="192.168.0.1 broadcast 0.0.0.255 netmask 255.255.255.0" and it will flip between the two quite happily.

You don't even need to set iface_wlan0 if it can detect the correct SSID  :Smile: 

I've even implemented basic roaming when the driver doesn't support scanning. Just set wireless_essid_ath0="any" and off it trots!

 *Quote:*   

> 
> 
> For what it's worth tho, the script works great at work!  *thumbs up!*

 

Glad you like it  :Smile: 

Hopefully the next version I post will work even better   :Very Happy: 

----------

## UberLord

 *Rhysem wrote:*   

> I'll try to find where pauses are needed, but I'm at work at the moment which may make things more difficult.  We have wifi, but I won't be able to verify picking the right AP as there's only one in range.

 

You won't be able to test that until I post my new version - which I can't do atm as my home ADSL/server is down  :Sad: 

Hopefully I can bring it online when I get home tonight  :Smile: 

----------

## Tripwire

 *UberLord wrote:*   

> This shows that you're not getting anything that the driver can understand. The link quality is 0 - which means you'll get nothing
> 
> Invalid misc:35 - means that it is getting something but the driver is not sure what.
> 
> Are you hardcoding the access points MAC address?

 

Nope. In fact the MAC listed for the AP is actually the NIC's MAC. Nothing is hard coded except the network ID. I'm using the same laptop with the same card on the same network right now under XP to post this message. But if I boot into Gentoo, 0 link quality.

I have confirmed the network ID (SSID)  indeed is "Wireless", so I'm out of ideas.

Why can I see the network under XP, but if I do not change anything except booting under Gentoo, I cannot see the network. Even the position/locationh of the laptop is unchanged.

One thing that may be of point. iwconfig says sensitivitiy is 1/3 (one third of max, right?). Under XP I can connect but the signal strength is routinely very low (<20%).

Might it find things ok if I set the sensitivity higher? How do I do that?

----------

## UberLord

Try the following

```

ifconfig wlan0 down

iwconfig wlan0 essid "dddd"

ifconfig wlan0 up

iwconfig
```

The essid should now be "dddd" and the MAC address should be either FF:FF:FF:FF:FF:FF or 44:44:44:44:44:44

now do

```

iwconfig wlan0 essid any

ifconfig wlan0 up

iwconfig
```

Now, iwconfig should report the ESSID of the AP, it's MAC address and the signal quality. If this works, then don't panic - I have a new script to cater for this scenario.

If you're running DHCP you can now do 

```
dhcpcd wlan0
```

 and you should have working network!

----------

## UberLord

I've just spotted that the wireless mode you're running is "Master". It needs to be "Managed"

```
iwconfig wlan0 mode master
```

----------

## Tripwire

 *UberLord wrote:*   

> Try the following
> 
> ```
> 
> ifconfig wlan0 down
> ...

 

Ok... I'll try it..

 *UberLord wrote:*   

> 
> 
> now do
> 
> ```
> ...

 

I mentioned before that my driver does not support essid of "any".

I'll try this though...

Thanks!

----------

## UberLord

 *Tripwire wrote:*   

> 
> 
> I mentioned before that my driver does not support essid of "any".
> 
> 

 

Try

```
iwconfig wlan0 ap any
```

instead then

----------

## UberLord

New versions posted  :Smile:  I've added some more configuration options as well.

----------

## maj

heh - i was just thinking about trying to write a script to connect to found accesspoints in a specific order - quite glad i found this!! 

i only have one problem with it though - an access point name that i use has .'s in it - "rdg.ac.uk"...

```

./net.wlan0 start

/sbin/runscript.sh: line 66: wireless_iface_rdg.ac.uk=dhcp: command not found

/sbin/runscript.sh: line 67: wireless_dhcpcd_rdg.ac.uk=-h minimaj -D -t 5: command not found

```

havent tried connecting to this access point yet as am at home and not on campus, script continues to run fine and connect to the access point at home though  :Very Happy: 

cheers for it!

[edit]...

hrm have just emerged something and a load of errors appeared in the output regarding the above lines - for some reason it gives the error 3 times regarding both lines... meh!!![/code]Last edited by maj on Wed Jan 14, 2004 7:48 pm; edited 1 time in total

----------

## UberLord

 *maj wrote:*   

> i only have one problem with it though - an access point name that i use has .'s in it - "rdg.ac.uk"...

 

Hmmmmmmm

I'll see if I can fix this tomorrow. Now, I'm off for some fine food and some fine wine  :Smile: 

----------

## maj

 *UberLord wrote:*   

>  *maj wrote:*   i only have one problem with it though - an access point name that i use has .'s in it - "rdg.ac.uk"... 
> 
> Hmmmmmmm
> 
> I'll see if I can fix this tomorrow. Now, I'm off for some fine food and some fine wine 

 

heh, you have your priorities well laid out! good call!

----------

## Tripwire

 *UberLord wrote:*   

> Try the following
> 
> ```
> 
> ifconfig wlan0 down
> ...

 

after setting the mode to managed instead of master, which in turn enabled the essid any option to work, I have gotten this far.

 *uberLord wrote:*   

> 
> 
> now do
> 
> ```
> ...

 

After waiting litterally about 5 minutes  :Confused:  , yes it worked.   :Smile:  Signal strength is not bad compared to what I usually get under XP (16/92 in Gentoo, 14-22% under XP)  :Smile: 

So now all that is left is three things:

1) a way to automate things

2) a way to speed up the wireless connection (waiting 5 minutes is kinda nuts)

3) to find a tutorial on using an 802.11b nic in my server at home to act as an AP since I don't have the $$ to buy a full AP but can probably scrounge up enough for an OK PCI NIC.

Any help on any of those is greatly appreciated, as is your help to date!

----------

## viperlin

gonna try this tomorow with a friends WiFi card, set it up ok i think  :Smile:  got his driver support added into kernel, fingers crossed  :Very Happy: 

without the card in i get this in /var/log/messages

modprobe: cannot locate module ath0

not sure why though. i'll just hope for the best.  :Smile: 

----------

## Rhysem

Got the newest script. I tried setting delay to "1", but it's not having. It tries and fails to associate with my AP. It does select "jbooth" now out of the list of APs available, but fails to actually make the association. It looks like it's forgetting to set the wireless key.

Well it selects it sometime. Found (in order): decrepid13, linksys, jbooth, Apt, #103, NETGEAR. Chose to associate: decrepid13. Should have chose: jbooth. This happened when I had iface_wlan0 set to dhcp (see below). When I unset it, it cleared up and started using (but failing to associate) jbooth.

It gets upset if wlan0 isn't loaded to start with, complaining iface_wlan0 isn't set. If you set it, it loads the module but doesn't actually start a darn thing.

----------

## Rhysem

Argh. Okay, found the "why it won't pick jbooth"

Reason is you changed the spelling of preferred to have two rs (like it should, I think). The old script wanted only 1.

----------

## Rhysem

The reason it won't associate is because the key never gets set during the trying-to-associate phase.

Add in the keysetting lines right after setting the essid in associate_wireless() and it works great.

(keysetting lines I used:)

setup_essid_env

$IWCONFIG $IFACE key ${key_IFACE} 2>/dev/null || {

      if [ "${key_IFACE}" != "off" ]; then

            ewarn "${IFACE} does not support setting keys"

      fi

}

----------

## viperlin

for the Orinoco driver do i need to change all "ath0" to "eth1" or something? i wil not have my pcmcia network card in so will that make it eth0? (this could get confusing, i hope someone replys quickly so i can have it ready  :Smile: (bout 15 mins till midnight)

----------

## Rhysem

Added wlan0 to modules.autoload, put net.wlan0 as a default boot script and VOLA, I get net. :-)

Well, okay, I had to back off and reload the ndiswrapper module because it decided that this boot it didn't really want to be able to scan for APs. But after that and running net.wlan0 by hand, it worked!

Thanks for the help and the script. *woot*

----------

## Rhysem

 *viperlin wrote:*   

> for the Orinoco driver do i need to change all "ath0" to "eth1" or something? i wil not have my pcmcia network card in so will that make it eth0? (this could get confusing, i hope someone replys quickly so i can have it ready :-)(bout 15 mins till midnight)

 

Change ath0 to whatever the orinoco driver calls your wifi card. It'll list it in 'iwconfig'.

----------

## viperlin

 *Rhysem wrote:*   

>  *viperlin wrote:*   for the Orinoco driver do i need to change all "ath0" to "eth1" or something? i wil not have my pcmcia network card in so will that make it eth0? (this could get confusing, i hope someone replys quickly so i can have it ready (bout 15 mins till midnight) 
> 
> Change ath0 to whatever the orinoco driver calls your wifi card. It'll list it in 'iwconfig'.

 

thanks for that, i'm pretty sure it uses standard eth0 format, eth1 eth2, etc.

sadly this will clash with my normal network card settings and i cannot have 2 plugged in at once, oh well. i will just hope and work on it tomorow, i'll try and remember to post my results back.

----------

## UberLord

 *viperlin wrote:*   

> sadly this will clash with my normal network card settings and i cannot have 2 plugged in at once, oh well. i will just hope and work on it tomorow, i'll try and remember to post my results back.

 

No it won't.

I have ethernet and an orinoco card in my lappy.

Ethernet is eth0

Orinoco is eth1

There's no clash  :Smile: 

----------

## UberLord

 *Rhysem wrote:*   

> The reason it won't associate is because the key never gets set during the trying-to-associate phase.

 

You should never need a key to associate with the access point! At least, I don't @ home and work and both AP's have WEP enabled. WEP is purely for encrypting the traffic - not for association.

Besides, I can't do that for orinoco users as to get "any" essid to pickup an AP I have to set the key after the AP is found.

----------

## UberLord

 *maj wrote:*   

> i only have one problem with it though - an access point name that i use has .'s in it - "rdg.ac.uk"...
> 
> 

 

New versions posted which solves this problem!

See the net file for configuring this  :Smile: 

----------

## maj

 *UberLord wrote:*   

>  *maj wrote:*   i only have one problem with it though - an access point name that i use has .'s in it - "rdg.ac.uk"...
> 
>  
> 
> New versions posted which solves this problem!
> ...

 

 :Very Happy:  works brilliantly cheers, you update the net.ath0 script aswell? got the version on the site just now, changed name to net.wlan0 and it works better than before (removed all refrence to rdg.ac.uk from the files this morning, put my home and preferred essid into the correct var but it would only connect to rdg.ac.uk even though it saw the preferred AP) 

yay!

----------

## Rhysem

 *UberLord wrote:*   

>  *Rhysem wrote:*   The reason it won't associate is because the key never gets set during the trying-to-associate phase. 
> 
> You should never need a key to associate with the access point! At least, I don't @ home and work and both AP's have WEP enabled. WEP is purely for encrypting the traffic - not for association.
> 
> Besides, I can't do that for orinoco users as to get "any" essid to pickup an AP I have to set the key after the AP is found.

 

My intel pro/wireless 2100 and linksys wifi/router disagree with you. I can successfully set the essid to jbooth. IWconfig then reports ESSID: "" and AP: FF:FF...

Set the key with iwconfig (without setting anything else such as essid) and then; ESSID: "jbooth" and AP: 00:06:...

It doesn't matter if I set the essid first or the key first, I don't pick up the AP's mac addy until such time as I have the key and the essid set properly.

FWIW, I have WEP required on the AP, not just "allowed".

----------

## UberLord

 *maj wrote:*   

> 
> 
>  works brilliantly cheers, you update the net.ath0 script aswell? got the version on the site just now, changed name to net.wlan0 and it works better than before (removed all refrence to rdg.ac.uk from the files this morning, put my home and preferred essid into the correct var but it would only connect to rdg.ac.uk even though it saw the preferred AP) 
> 
> yay!

 

So does it work or doesn't it? I'm confused   :Confused: 

If it's not picking the correct AP, then post the wireless_* part of the /etc/conf.d/net and I'll have a look

----------

## UberLord

 *Rhysem wrote:*   

> 
> 
> My intel pro/wireless 2100 and linksys wifi/router disagree with you. I can successfully set the essid to jbooth. IWconfig then reports ESSID: "" and AP: FF:FF...
> 
> Set the key with iwconfig (without setting anything else such as essid) and then; ESSID: "jbooth" and AP: 00:06:...
> ...

 

Is your AP broadcasting it's SSID?

----------

## UberLord

Never mind - I've posted a new version that should fix that for you.

Do we still need to find where to put the sleeps?

----------

## viperlin

didn't work, when i plugged it in the light went on but nothing happened in dmesg or /var/log/messages to tell me, both ath0 and eth1 failed. oh well. i'll try again when i get the chance

----------

## Tripwire

 *Tripwire wrote:*   

> 
> 
> After waiting litterally about 5 minutes  , yes it worked.   Signal strength is not bad compared to what I usually get under XP (16/92 in Gentoo, 14-22% under XP) 
> 
> 

 

Ok. Now I'm confused. I edited the startup scripts to bring wlan0 up automatically. But it won't start up from the net.wlan0 script. dhcpcd times out. But if I run the exact same dhcpcd command from the command line it takes a couple of seconds at most before I get an IP address.

The net.wlan0 script is a hard link to the net.eth0 script, and my /etc/conf.d/net config file shows one entry for wlan0:

iface_wlan0="dhcp"

when I do /etc/init.d/net.wlan0 start, it sits for ~2 minutes, then gives up. If I do a ps ax | grep dhcpcd in another virtual terminal while it's waiting I see the command line:

/sbin/dhcpcd wlan0

if I run that from the script, it will fail, if I run that from the command line, it works fine.

Any ideas on this one?

 :Question:   :Confused: 

----------

## Rhysem

 *UberLord wrote:*   

> Never mind - I've posted a new version that should fix that for you.
> 
> Do we still need to find where to put the sleeps?

 

It decided at some point it didn't need sleeps -- I think it was related to picking up the wrong AP possibly, or may have been due to ndiswrapper just flak'in out.

----------

## Rhysem

 *Tripwire wrote:*   

>  *Tripwire wrote:*   
> 
> After waiting litterally about 5 minutes :? , yes it worked.  :) Signal strength is not bad compared to what I usually get under XP (16/92 in Gentoo, 14-22% under XP) :) 
> 
>  
> ...

 

I was having issues similar to that when I first stuck net.wlan0 in my rc-scripts, because when it invoked the script all it did was load the ndiswrapper module, not configure the inerface in any way. If you're having the same thing happen, maybe it's trying to dhcp on a down/unconfigured interface.

Have you added whatever module runs your wlan0 to /etc/modules.autoload.d/kernel-2.x?

----------

## Rhysem

 *UberLord wrote:*   

> Is your AP broadcasting it's SSID?

 

It has been, but I'd like to turn it back off. Windows doesn't have a problem associating with it or the other pref'd network even if it isn't broadcasting. Might require tweaking of the script tho, since I think the script tries to see if the preferred APs can are in the found list.

Perhaps if finding pref'd in the list doesn't work, then after that it should try configuring pref'd in order and see if any pick up.

----------

## maj

 *UberLord wrote:*   

>  *maj wrote:*   
> 
>  works brilliantly cheers, you update the net.ath0 script aswell? got the version on the site just now, changed name to net.wlan0 and it works better than before (removed all refrence to rdg.ac.uk from the files this morning, put my home and preferred essid into the correct var but it would only connect to rdg.ac.uk even though it saw the preferred AP) 
> 
> yay! 
> ...

 

sorry was doing a couple of things at the same time as replying - yeah this version works perfectly, the version i got yesterday just connected to the first access point it found rather than connecting in the preferred order, now it connects to a preferred one first - exactly as required  :Very Happy: 

----------

## UberLord

New version again.

I broke the scanning code for Athereos users - we need to bring up the interface before scanning.

----------

## UberLord

 *Rhysem wrote:*   

>  *UberLord wrote:*   Is your AP broadcasting it's SSID? 
> 
> It has been, but I'd like to turn it back off. Windows doesn't have a problem associating with it or the other pref'd network even if it isn't broadcasting. Might require tweaking of the script tho, since I think the script tries to see if the preferred APs can are in the found list.
> 
> Perhaps if finding pref'd in the list doesn't work, then after that it should try configuring pref'd in order and see if any pick up.

 

Done  :Smile: 

If no AP's are found then it tries to forceably connect to the preferred list.

----------

## Rhysem

Connects to the list fine, but I was still having the "everything is set right, I transmit but receive nothing back" issue.

Copying the iwconfig essid 5-line stanza in asociate_wireless after the keysetting (moving it after works as well as copying does) seems to work.

I'm not sure why it's the case, but multiple tests of both ways show key then essid works, essid then key doesn't work so well. Probalby ndiswrapper's fault, but I couldn't say for sure.

I'm not sure if you want to make a total copy of that block or want an option for potentially broken cards/drivers.

Other than that, works great. I turned off essid broadcast and it still picks it up correctly. :-)

----------

## UberLord

I have no problem with that change - works fine with my cards  :Smile: 

As such, I've posted a new version   :Cool: 

Anyone got any more problems or features they want   :Question: 

----------

## ryandlugosz

 *UberLord wrote:*   

> 
> 
> Anyone got any more problems or features they want  :?:

 

Sorry that it's been awhile... I Just loaded the new version this evening.  I'm using your vanilla script as net.wlan0.  I've set up the basics in conf.d/net

I'm using the ndiswrapper to load up the windows driver - using 0.4 of their software. I have the following in my modules.conf:

```
alias wlan0 ndiswrapper

options ndiswrapper if_name=wlan0

install ndiswrapper /sbin/modprobe --ignore-install ndiswrapper; /usr/sbin/loadndisdriver 14e4 4320 /lib/windrivers/bcmwl5.sys /lib/windrivers/bcmwl5.inf
```

Now, if I don't put  "ndiswrapper" into my modules.autoload, the first time net.wlan0 executes it fails, but then I can re-run net.wlan0 start and it will bring everything up as it should.  If I DO have "ndiswrapper" in my modules.autoload, I get "run depscan.sh" errors just after the system runs "Caching service dependencies".  

Any thoughts on why this is happeneing?  Thanks for the work on the script, btw.

-Ryan

----------

## UberLord

Best check that problem with Rhysem as he's got experience with the NDISwrapper whereas I have not  :Sad: 

----------

## Rhysem

I would have answered last night if I knew the answer. :-P

I never got depscan.sh errors. What I added to get it to autoload was:

/etc/modules.d/ndiswrapper --

```

alias wlan0 ndiswrapper

install ndiswrapper /sbin/modprobe --ignore-install ndiswrapper;/usr/sbin/loadndisdriver 8086 1043 /lib/windrivers/w70n51.sys /lib/windrivers/w70n51.inf

```

You have an updated version of the script, right, named the right thing? (don't have a missing net.ath0 in rc-startup somewhere?)

----------

## UberLord

That's a valid point.

Check /etc/runlevels/default and /etc/runlevels/boot for broken sym links.

----------

## ryandlugosz

 *Rhysem wrote:*   

> What I added to get it to autoload was:
> 
> /etc/modules.d/ndiswrapper --
> 
> 

 

Yeah - tried it with the script that was current as of yesterday evening.  So... do you have anything in your /etc/modules.autoload.d/kernel-2.6 file?  When I put ndiswrapper in there the depscan probs happen.  If I don't put it in there, then I get issues with the net.wlan0 script not connecting the first time through.  

Did you rename the script to net.wlan0, or just leave it as ath0?  It almost looks like something happens when that driver loads (when in modules.autoload) that causes the net.wlan0 script to be looked into prematurely?  I'm not exactly sure at this point what the relationship is...

----------

## ryandlugosz

 *UberLord wrote:*   

> That's a valid point.
> 
> Check /etc/runlevels/default and /etc/runlevels/boot for broken sym links.

 

I'll check that when I'm at home (the laptop forgot to come into work with me today) :)

Thanks

----------

## UberLord

 *ryandlugosz wrote:*   

> I'll check that when I'm at home (the laptop forgot to come into work with me today) 

 

You're positive you didn't forget it   :Razz: 

----------

## UberLord

 *Rhysem wrote:*   

> I've been thinking some more about this and I'm not sure that a rc-script in etc is the right solution. It's better than where we were, for sure, but what you'd really like would be a daemon process that would keep scanning wifi networks if you lost the old one.

 

Good news - this works fine with ifplugd!

This means that when the AP is out of range, the interface is brought down.

When it gets back in range of any AP, the interface is brought up.

However, I'm now getting the dependancy errors as noted above - but only when the script is invoked by ifplugd.  :Sad: 

I'll see if I can resolve the problem.

----------

## ryandlugosz

 *UberLord wrote:*   

> 
> 
> Good news - this works fine with ifplugd!
> 
> This means that when the AP is out of range, the interface is brought down.
> ...

 

I had tried this back in the day (last week) with ifplugd and also got the dependency issues... hopefully they're all related somehow.  

On a related note, has there been any thought to how turning off the wireless radio could be handled?  This is useful if you have an internal card and know that you want to stay off the lan (for either power or "radio silence" reasons).  This functionality may be handled best by a key-bound acpid action or something to that affect.

-Ryan

----------

## manny15

Just tried it and it seems to work! I've been looking for the "gentoo way" to configure wlans. I'm glad I found it! Will the scripts be added to gentoo? I'm working on an ebuild for atmel-based wlan cards (Links wusb11 2.6, etc)  :Smile: 

----------

## Rhysem

 *ryandlugosz wrote:*   

>  *Rhysem wrote:*   What I added to get it to autoload was:
> 
> /etc/modules.d/ndiswrapper --
> 
>  
> ...

 

I renamed the script net.wlan0, and I have "wlan0" in the autoload file. Sorry I didn't include that earlier.

----------

## Rhysem

 *ryandlugosz wrote:*   

>  *UberLord wrote:*   
> 
> Good news - this works fine with ifplugd!
> 
> This means that when the AP is out of range, the interface is brought down.
> ...

 

My laptop has Fn+F2 turn on and off the intel pro/wifi chipset. (Dell Inspiron 300m)

It didn't work untill I got BIOS A04 loaded on the machine. I'm not sure if the DSDT fix I did is related to that working or not, but I did do a DSDT fix as well. I'm running gentoo-dev-sources 2.6.1-r1 I think.

----------

## ryandlugosz

 *Rhysem wrote:*   

> 
> 
> It didn't work untill I got BIOS A04 loaded on the machine. I'm not sure if the DSDT fix I did is related to that working or not, but I did do a DSDT fix as well. I'm running gentoo-dev-sources 2.6.1-r1 I think.

 

Ah. I've got a dell 8500 & I've done the a05 bios dsdt fix.  Not sure if FN+F2 works as it should; I don't think I've tried it since getting the dsdt to work.  how can you tell if the radio is off?

----------

## Rhysem

iwconfig starts acting strange if the radio is off, that's been my observation.

You can also observe on/off status in the BIOS, but it might reset it every boot to on, not sure there.

----------

## UberLord

 *ryandlugosz wrote:*   

> 
> 
> I had tried this back in the day (last week) with ifplugd and also got the dependency issues... hopefully they're all related somehow.  
> 
> 

 

https://bugs.gentoo.org/show_bug.cgi?id=33418

Hasn't been worked on for a while though  :Sad: 

----------

## ryandlugosz

Yeah... that hasn't been touched in months.  Still, we may have a shot at figuring out what's going on...  Here's what happens when I boot up with wlan0 in my modules autoload... as you can see, the depscan errors and the problems seem to be happening way before the net stuff should ever be touched - in fact, it's before we're even in runlevel 3. I wonder what this 'softlevel' script is that it's looking for.  Maybe I'm missing something on my system...

```

* Calculating module dependencies...

* Using /etc/modules.autoload.d/kernel-2.6 as config:

* Loading module wlan0...

* Autoloaded 1 module(s)

* Checking all filesystems...

* Mounting local filesystems...

* Mounting USB device filesystem (usbfs)...

* Activating (possibly) more swap...

* Caching service dependencies...

* Dependency info is missing!Please run

 * # /sbin/depscan.sh

 * to fix this.

/sbin/runscript.sh: line 27: /var/lib/init.d/softlevel: No such file or directory

 Could not get dependency info for "net.wlan0"!

 Please run:

 # /sbin/depscan.sh

 to fix this.

 Could not get dependency info for "net.wlan0"!

 Please run:

 # /sbin/depscan.sh

 to fix this.

* Bringing wlan0 down... 

* Setting system clock to hardware clock [Local Time]...

 No Access Points found for wlan0

trying to force preferred 

* Setting DNS domainname to dlugosz.net... 
```

----------

## mroublic

Hi, I just got my a/b/g atheros card worknig with madwifi, and I would like to use this script or something like it.

The zippy.com link for the script download seems to be broken.. 

Thanks,

-Jim

----------

## UberLord

 *mroublic wrote:*   

> Hi, I just got my a/b/g atheros card worknig with madwifi, and I would like to use this script or something like it.
> 
> The zippy.com link for the script download seems to be broken.. 
> 
> Thanks,
> ...

 

So whats your question exactly?

The script has been posted - 1st message in this thread for download links.

----------

## UberLord

 *ryandlugosz wrote:*   

> Yeah... that hasn't been touched in months.  Still, we may have a shot at figuring out what's going on...  Here's what happens when I boot up with wlan0 in my modules autoload... as you can see, the depscan errors and the problems seem to be happening way before the net stuff should ever be touched - in fact, it's before we're even in runlevel 3. I wonder what this 'softlevel' script is that it's looking for.  Maybe I'm missing something on my system...

 

What version of baselayout do you have installed?

/var/lib/init.d/softlevel just contains the word default on my system

----------

## ryandlugosz

 *UberLord wrote:*   

> 
> 
> What version of baselayout do you have installed?
> 
> /var/lib/init.d/softlevel just contains the word default on my system

 

I've got sys-apps/baselayout-1.8.6.10-r1.  I'm pretty sure the softlevel thing is some type of generated file that is used to control the rc scripts.  Not really sure how it's used (or why it's necessary)... I'm not sure if that's the source of the problem or not.

I'll continue to play around and see if I can come up with any interesting ideas... maybe that old bug needs to get pinged to get some attention.

-Ryan

----------

## UberLord

What happens if you use a "skeletion" script for net.wlan0?

IE something like this

```

#!/sbin/runscript

depend() {

        use hotplug pcmcia

}

start() {

        ebegin "Script started"

        eend 0

}

stop() {

        ebegin "Script stopped"

        eend 0

}

```

I'd like to see if it's my script or something on your system causing wlan0 to be brought up on boot ...

----------

## ryandlugosz

 *UberLord wrote:*   

> What happens if you use a "skeletion" script for net.wlan0?

 

I get exactly the same results.  I don't think the problem is in your script.  I believe the problem is that some other gentoo script is seeing the wlan0 interface come up (when the module is loaded) and tries to run an associated net.IFACE script.  I'm not sure why it fails, but it does.

My solution to this is to revert to an approach similar to what I had done before: I've added a line in setup_env() that will load the ndiswrapper module and then (just for S&G's) I added a line at the end of stop() that will unload the module.  I then removed the wlan0 line from the modules autoload & set the net.wlan0 script to start in default.  This appears to work smoothly!

Maybe this isn't the Gentoo Way of loading a module, but it certainly seems to have better results...  :?   Perhaps this method could be genericized and the name of the module could become a parameter in conf.d/net?

in setup_env, I added:

```

einfo "loading module"

modprobe -q ndiswrapper &> /dev/null

```

and in stop, I added:

```

einfo "unloading module"

rmmod ndiswrapper

```

Perhaps not the ideal solution, but it works as far as getting the net running (which is my main goal here).  I haven't tried it with ifplugd yet... that may pose some issues depending on how it works.

----------

## UberLord

Hmmmmm

Shouldn't you have ndiswrapper loading in modules.autoload.d instead of wlan0?

----------

## ryandlugosz

 *UberLord wrote:*   

> Hmmmmm
> 
> Shouldn't you have ndiswrapper loading in modules.autoload.d instead of wlan0?

 

Yeah - tried it both ways & it doesn't seem to make a difference.  There's an alias from wlan0 to ndiswrapper in modules.conf, so it really does the same thing.  I've even tried to do it without an alias to wlan0, thinking that may be what causes the problems... doesn't matter.  Seems that *something* sees that the wlan0 interface is halfway ready to go & that *something* tries to do something about it.  

Note that you don't have any problems if you have no init.d script named net.wlan0... call it something else & you wont see the deps issue.  Definitely something trying to specifically load a script for that interface when the module is autoloaded.

----------

## UberLord

 *ryandlugosz wrote:*   

>  *UberLord wrote:*   Hmmmmm
> 
> Shouldn't you have ndiswrapper loading in modules.autoload.d instead of wlan0? 
> 
> Note that you don't have any problems if you have no init.d script named net.wlan0... call it something else & you wont see the deps issue.  Definitely something trying to specifically load a script for that interface when the module is autoloaded.

 

Well, the script doesn't get called automatically when my ath0 module is in autoload. I have to add it to the default run level.

I would try starting a new thread about this problem as it isn't due to my script. If no-one helps or resolves the issue in the new thread then post it to bugs.gentoo.org where a Gentoo dev should respond

----------

## UberLord

New version posted.

Remembers ESSID connected to in /var/run/net.IFACE.essid

This is needed when the interface is brought down and it was configured for DHCP and the ESSID is an empty string or "any" reported by iwconfig.

----------

## timfreeman

I would just like to say thankyou, it works very well here.  Good work!

----------

## Adamal

I am having no luck in getting my Centrino wireless working:

Intel Corp. PRO/Wireless LAN 2100 3B Mini PCI Adapter (rev 04)

I'm using the /etc/conf.d/net script from UberLord - modified of course.

```

iface_eth0="dhcp"

iface_wlan0="dhcp"

wireless_essid_wlan0="myhome"

wireless_channel_wlan0="6"

wireless_mode_wlan0="Managed"

wireless_sleep_scan_wlan0="0"

wireless_sleep_associate_wlan0="5"

wireless_key_myhome="restricted 1A96-AB23-E353-AF70-863A-549E-06"

wireless_iface_myhome="dhcp"

wireless_dhcpcd_myhome="-h uberpc -D -t 5 -N"

```

I am also using the /etc/init.d/net.wlan0 from ryandlugosz posted in the first page of this thread.

it fails to bring up the wlan0.  I have also noticed that I am unable to change the ESSID or the AP with the iwconfig command.  I am running 128-bit encryption and I have 4 keys set on my router and of course key 1 is selected which is the one I place conf.d/net file.  My router is a Dlink DI-614+.  Please help...

----------

## Adamal

here is a little extra info I just tried.  When I tried to set the rate I got the following error:

```
root@Nomad-Lin adam # iwconfig wlan0 rate 11M

Error for wireless request "Set Bit Rate" (8B20) :

    SET failed on device wlan0 ; No such device.

r
```

----------

## UberLord

Hi adamal - sounds like you don't have the module for your wireless card loaded - or it's using the wrong interface.

Could you post the output of iwconfig and lsmod please?

Also, your dhcp option is setting the hostname to "uberpc". I'm sure that "uberpc" isn't the hostname of your computer  :Wink: 

----------

## Adamal

I cought that uberpc bit after I posted...

here is my iwconfig:

```
eth0      no wireless extensions.

 

lo        no wireless extensions.

 

wlan0     IEEE 802.11b  ESSID:""

          Mode:Managed  Channel:0  Access Point: FF:FF:FF:FF:FF:FF

          Bit Rate=54Mb/s

          RTS thr=1600 B   Fragment thr=2344 B

          Encryption key:off

          Power Management:off

          Link Quality:0/100  Signal level:-98 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

```

```
root@Nomad-Lin conf.d # lsmod

Module                  Size  Used by

ndiswrapper            62440  0

radeonfb               21760  0

bcm5700               115460  0

```

Also if it means anything I'm running the 2.6.1-gentoo kernel from dev-sources and I installed the ndiswrapper using the install.sh script.

----------

## UberLord

I think that the ndiswrapper isn't talking to the windows driver correctly. Can you post all output from dmesg relating to ndiswrapper?

----------

## ryandlugosz

 *Adamal wrote:*   

> 
> 
> I am also using the /etc/init.d/net.wlan0 from ryandlugosz posted in the first page of this thread.
> 
> 

 

Well, first off, if you're going to modify the script as I did to load the module, don't use my version of the script that's on the first page... You should use UberLord's current release and add the two tweaks that I mention a few posts  up about adding the modprobe command in setup_env() and the unload in stop().

Get onto the current version of the script & then let's see what happens.

----------

## UberLord

New versions posted

I've removed my specific config and put an example config in with instructions about what to change.

Also, I've added power and txpower options.

This makes it pretty much complete now - I'm not going to implement the nwid option as it's not in the 802.11 specification.

I'm also not going to implement the retry option as it has many permutations and I'm not entirely sure how to go about it   :Confused: 

Enjoy   :Very Happy: 

----------

## Adamal

 *UberLord wrote:*   

> I think that the ndiswrapper isn't talking to the windows driver correctly. Can you post all output from dmesg relating to ndiswrapper?

 

here it is

```
ndiswrapper version 0.4 loaded

NdisWriteConfiguration --UNIMPLEMENTED--

NdisWriteConfiguration --UNIMPLEMENTED--

NdisWriteConfiguration --UNIMPLEMENTED--

NdisWriteConfiguration --UNIMPLEMENTED--

NdisInitializeString --UNIMPLEMENTED--

NdisWriteConfiguration --UNIMPLEMENTED--

NdisInitializeString --UNIMPLEMENTED--

NdisWriteConfiguration --UNIMPLEMENTED--

NdisInitializeString --UNIMPLEMENTED--

NdisWriteConfiguration --UNIMPLEMENTED--

NdisInitializeString --UNIMPLEMENTED--

NdisWriteConfiguration --UNIMPLEMENTED--

NdisInitializeString --UNIMPLEMENTED--

NdisWriteConfiguration --UNIMPLEMENTED--

NdisWriteConfiguration --UNIMPLEMENTED--

NdisInitializeString --UNIMPLEMENTED--

NdisWriteConfiguration --UNIMPLEMENTED--

NdisInitializeString --UNIMPLEMENTED--

NdisWriteConfiguration --UNIMPLEMENTED--

NdisWriteConfiguration --UNIMPLEMENTED--

wlan0: ndiswrapper ethernet device 00:04:23:48:98:ab

```

----------

## UberLord

Unless another ndiswrapper user can say otherwise, I think that it doesn't like the windows driver you're using with it  :Sad: 

----------

## Adamal

I used one of the drivers that was linked from their site.  I'll go ahead and try the other one...

----------

## Adamal

I got the same dmesg output even with the other drivers.  I am still unable to connect to my DI-614+ wireless router.  I'm wondering if the 2.6.1 kernel is the one causing the problems.  

Has anyone with the 2.6.1 kernel gotten the ndiswrapper working with the centrino wireless adapter?

----------

## UberLord

ndiswrapper howto

https://forums.gentoo.org/viewtopic.php?t=125627

Have you followed that to the letter - including using the drivers specified?

----------

## Adamal

 *UberLord wrote:*   

> ndiswrapper howto
> 
> https://forums.gentoo.org/viewtopic.php?t=125627
> 
> Have you followed that to the letter - including using the drivers specified?

 

yup.  I actually used the included install.sh which does most of what is listed and I double checked the install scripts work by hand.  Everything seems to be ok.  I am also now using your scripts with a few modifications to autoload the ndiswrapper or remove when shutting down the device.  I am using the drivers listed on the ndiswrapper site.  I'm thinking of trying linuxant's driver but I really don't want to have to pay just to get my wireless working.

BTW I want to say thanks for all your help so far.

----------

## Adamal

This might be an error with the 2.6.1 kernel.  I just viewed the ndiswrapper forums and someone else with similar hardware as me is have problems though not exactly the same.

https://sourceforge.net/forum/forum.php?thread_id=1010184&forum_id=323167

----------

## Adamal

Your not going to believe this but the reason I was unable to get it to work was because the wireless was turned off.  Looks like I hit the Fn+F2.  When I booted into windows I saw that it was disabled.  It works now, with your scripts.  Thanks.

----------

## ryandlugosz

 *Adamal wrote:*   

> 
> 
> Has anyone with the 2.6.1 kernel gotten the ndiswrapper working with the centrino wireless adapter?

 

I'm using ndiswrapper 0.4 with a 2.6.1 kernel, but with the broadcom drivers.  You're probably not going to find help on this one so deep into this thread - I think there's only two or three of us that see see updates.  

Your best bet is to start a new ndiswrapper / centrino thread here and also to join the ndiswrapper mailing list and ask around there.

Good luck!

-Ryan

----------

## Adamal

 *ryandlugosz wrote:*   

>  *Adamal wrote:*   
> 
> Has anyone with the 2.6.1 kernel gotten the ndiswrapper working with the centrino wireless adapter? 
> 
> I'm using ndiswrapper 0.4 with a 2.6.1 kernel, but with the broadcom drivers.  You're probably not going to find help on this one so deep into this thread - I think there's only two or three of us that see see updates.  
> ...

 

No its working great now.  It was due to me hitting Fn+F2 and disabling the wireless.  However I am now using a custom 2.6.1 kernel and not the one from portage.

----------

## TriGuN

Uberlord, I don't know what's up, but for some odd reason, the script wouldn't take my WEP key....

I'm not familiar with bash scripting so I can't help you on that part, but all I know is that in my /etc/conf.d/net I had "wireless_key_eth1="restricted 1234-1234...etc" or whatever, and when I started eth1, "iwconfig eth1" just showed "Encryption type: off" or something like that...

What's up with that?  :Sad: 

EDIT: Ah, n/m...I used wireless_key_eth1 instead of wireless_key_essid  :Smile:  nice script though  :Very Happy: 

----------

## Adamal

 *TriGuN wrote:*   

> Uberlord, I don't know what's up, but for some odd reason, the script wouldn't take my WEP key....
> 
> I'm not familiar with bash scripting so I can't help you on that part, but all I know is that in my /etc/conf.d/net I had "wireless_key_eth1="restricted 1234-1234...etc" or whatever, and when I started eth1, "iwconfig eth1" just showed "Encryption type: off" or something like that...
> 
> What's up with that? 
> ...

 

I believe the syntax is: 

```
wireless_key_<essid>="restriced ..."
```

not:

```
wireless_key_<eth#>="restriced ..."
```

----------

## UberLord

Yup, wrong config there.

New versions posted   :Idea: 

This version tries to force preferred ESSID's if the driver doesn't support scanning.

Handy when there's a more powerful WLAN ad-hoc device around and my lappy won't connect  :Smile: 

----------

## grayrest

I was just starting to write this when I found your script on the forum. Thanks muchly.

One request: Could you add a config line that would run a script upon connecting to an ESSID? My school network requires me to submit my schoolid/passwd on a web form before I can access the rest of the net while my home network does not. I have a script to do the form submission and it would be convenient to run it upon connection.

----------

## UberLord

I don't think I would want to do that, as any errors introduced by your script would cause the interface not to be brought up.

Besides, this script is purely for configuring wireless networking for Gentoo - nothing more and nothing less.

A better way would be to run your script in /etc/conf.d/local.start

You can get too see which ESSID you've connected to by parsing the output from iwgetid or by using the function or by using the following

```
essid=`${IWCONFIG} ${IFACE} | gawk -F\" '/ESSID/ {print $2}'`
```

----------

## Moofed

Great job on the script UberLord, it works great at home with my Netgear router.  However, it seems to have problems with ESSIDs that have a space in them.

When I try to connect to my uni's network (ESSID: "IU Wireless"), it will report twice as many APs than exist, each with half of its ESSID missing.  Ex.: Scanning finds three APs, all named "IU Wireless".  The script reports six APs: "IU", "Wireless", "IU", "Wireless", "IU", and "Wireless".  Then it fails to connect to them.  If I force the card to connect to "any" then it works fine, but makes it so I must edit the net file whenever i go to class.  The preferred wireless function also has problems with ESSIDs containing spaces.  I have a prism2.5 card using the hostap drivers, fyi.

Again, great work, hope to see it in baselayout.

----------

## UberLord

Yoiks! I didn't know that ESSID's could have spaces in them.

I'll see what I can do - but it may take time. Busy @ work   :Confused: 

----------

## smeets_marc

looks like some nices scripts! thank you for that. Pcmcia and wireless are both new to me. So it took me some time to get used to the new stuff. I was very happy to find these scripts.

But (there is always a but), I can't get it to work. /etc/init.d/net.eth1 start gives me a "Failed to bring eth1 up" 

/var/log/messages tells me that the firmware of my 3com officeconnect is loaded but a 

```

device soft reset timed out

dhcpStart: ioctl SIOCSIFFLAGS: Resource temporarily inavailable.

```

stops it from continuing

I'm not sure if it ha something to do with the script, but I'm also curious how to adjust the script so that it can use a passphrase text string to use the wep key of my Access Point. Also, is WPA possible with the script? if so, how to adjust?

Thanks in advance.

----------

## UberLord

 *smeets_marc wrote:*   

> 
> 
> ```
> 
> device soft reset timed out
> ...

 

That shows that the module isn't loading or isn't configured correctly - nothing my script can help with  :Sad: 

 *Quote:*   

> 
> 
> I'm not sure if it ha something to do with the script, but I'm also curious how to adjust the script so that it can use a passphrase text string to use the wep key of my Access Point. Also, is WPA possible with the script? if so, how to adjust?
> 
> Thanks in advance.

 

My script works within the limits of iwconfig. iwconfig does not support string passphrases. I think I saw a perl script that converted a passphrase into a WEP key. I'll look into it over the weekend  :Smile: 

WPA isn't possible yet. Fleed (a regular in these forums) is looking into WPA and feeding my info about it for inclusion in the script. But that was last week and he either can't get it working or he's forgotten about it/me.

I have no WPA capable hardware myself, so I can't really implement it.

----------

## brkdncr

I've copied the links for net.ath0 and net from the first post into the correct spots, but when I try and run them, as root, i get a "permission denied" error.

I've configured them to my needs.

What gives?

----------

## smeets_marc

did a chmod 755 on /etc/init.d/net.ath0 ?

did a chmod 744 on /etc/conf.d/net ?

----------

## soda_popstar

 *Adamal wrote:*   

> Your not going to believe this but the reason I was unable to get it to work was because the wireless was turned off.  Looks like I hit the Fn+F2.  When I booted into windows I saw that it was disabled.  It works now, with your scripts.  Thanks.

 

This might sound stupid, but how did you turn it back on?  I'm getting the exact same error as you were getting and if it's as simple as turning wireless on, then I'd like to know how.    :Razz: 

----------

## Robe

Thnaks so much UberLord..

I was pulling my hair out untill I downloaded your scripts.  After a few minor modifications to reflect my current config, I was able to finally get my Linksys router and AP to work !

Keep up the good work !

Rob

----------

## Quantum Skyline

Your script rocks...it works with the Linuxant driverloader.

----------

## UberLord

New version posted - spaces in ESSID names are now supported  :Smile: 

----------

## kritip

I have a question i couldn't seem to find answered definitavly in another thread so i i guess this is the best place to ask as i am using the modified scripts and it is to do with them.

When using my ethernet and wireless cards, i have interfaces eth0 and ath0. For the default gateway in /etc/conf.d/net what so i specify, eth0 or ath0?? If my wireless was working i wouldn't have the cable plugged in, if it dropped the signal, i'd wanna bring up the wired interface, but it only seems to work when i manually change the setting to the device i'd like to use and restart the interfaces?? Am i doing this corectly, or can i leave this #'ed? I know i can specify both!

On another note, I have a D-Link dwl-520 with the Atheros chipset, when i ran windows, i would get ~90% signal but in linux using the latest madwifi-driver ebuild i only get ~13/94 strength most of the time and it looses the base after a few mins and will only rejoin after many attempts of restarting net.ath0

I disabled WEP to make sure that wasn't the problem, but i don't broadcast my essid.

```
ath0      IEEE 802.11  ESSID:"KriTip-WiFi"

          Mode:Managed  Frequency:2.437GHz  Access Point: 00:40:05:5A:8F:B1

          Bit Rate:54Mb/s   Tx-Power:off   Sensitivity=0/3

          Retry:off   RTS thr:off   Fragment thr:off

          Encryption key:off

          Power Management:off

          Link Quality:11/94  Signal level:-77 dBm  Noise level:-95 dBm

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

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

```

```
ath0      Link encap:Ethernet  HWaddr 00:0D:88:8B:A2:22

          inet addr:192.168.0.153  Bcast:192.168.0.255  Mask:255.255.255.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:9283 errors:141906 dropped:0 overruns:0 frame:141900

          TX packets:590 errors:20 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:199

          RX bytes:1198361 (1.1 Mb)  TX bytes:75903 (74.1 Kb)

          Interrupt:17 Memory:ea136000-ea146000

```

Anyone else get poor results in linux but ok in windows with this card or an Atheros based card?? I know this is probably just a driver issue, but im curious if others get the same??

Cheers,

Kristian[/code]

----------

## UberLord

Not sure that is all a driver issue - but from the same place, my SMC 2362W in my lappy (kernel 2.6.1 native) get a better signal to my AP than my Netgear W311 (madwifi - 200401 cvs). But the signal quality for the W311 is the same whether in Windows or Linux.

----------

## Moofed

 *UberLord wrote:*   

> New version posted - spaces in ESSID names are now supported 

 

Thank you UberLord!  I tested it out and while I couldn't get the preferred essid to work with spaces, setting preferred to my home essid and just letting it default to the scanned APs works for me.   :Smile: 

----------

## UberLord

 *dlpierce wrote:*   

>  *UberLord wrote:*   New version posted - spaces in ESSID names are now supported  
> 
> Thank you UberLord!  I tested it out and while I couldn't get the preferred essid to work with spaces, setting preferred to my home essid and just letting it default to the scanned APs works for me.  

 

You can substitute a space with 

```
_____
```

Not ideal atm, but I'll see if I can do better

----------

## yakapiece

For me the script seems to start correctly but when its bringing up ath0 it hangs, then fails

I believe that I might be having a problem with dhcpcd ath0, reason i say that is because i can scan and see other wireless networks however I can not connect to one when I specify an essid and enc (key).

iwconfig ath0 essid ID enc xxxKeyxxx

those values get stored correctly but when I dhcpcd it just hangs

I also noticed if I scan and find a cell, take that freq and set it as well, it picks up the AP MAC address yet still even when I dhcpcd ath0 it just hangs.

Does anyone have any suggestions? I've read through a lot of the other forum posts with no luck on this.

btw: checking dmesg it seems the driver loads without a problem

Thanks

----------

## UberLord

I get that with my main PC at home.

Solution are to increase the dhcpcd timeout or use a static IP.

The best solution is to get a better signal from the AP by moving closer to it or positioning the PC so there's less in the way - like walls.

Or, if it still isn't working then the WEP key may be wrong. Try using wireless without WEP and see if that helps.

----------

## trapperjohn

 *yakapiece wrote:*   

> 
> 
> I also noticed if I scan and find a cell, take that freq and set it as well, it picks up the AP MAC address yet still even when I dhcpcd ath0 it just hangs.
> 
> 

 

Did you already try to set an IP manually? Try it and temporarily disable  WEP, Mac-filtering etc. .

----------

## dopey

This is cool.  I had originally posted a net.eth0 script i was using for my wireless network and I started implementing support for preferred wireless network lists.  Then, I found your script  :Smile: .  I like it.  I made a few minor changes that are specific for supporting the prism54 driver.

The unified diff can be found at the following URL:

http://www.moonteeth.com/~dopey/net.ath0.diff

Basically I made the following changes:

1) setup_wireless_env() , the prism54 driver doesn't display the same IEEE string with iwconfig if the interface is down.  Because of that I added ifconfig up and downs around it.

Also, in personal testing, I've noticed that iwconfig outputs "no wireless extension" to stderr.  Given this, it's probably okay to just test if iwconfig ${IFACE} outputs anything at all to stdout.  If so, then assume that wireless extensions exist if not, then no.  What do you think?  My original script made that assumption.

2) the prism54 driver uses MAC address of 00:00:00:00:00:00 as an interim MAC address while probing for an AP.  I added this to the associate_wireless() function

3) in setup_wireless() you remove - and " characters. from the scanned ESSIDs.  This prevents ESSIDs with -'s in them from working properly.  I removed the check for - from the sed expression.  I'm not sure why it was in there to begin with, especially since setup_essid_env() already replaces invalid characters with _ anyways.  (one of my access points at home and my work access points both need -'s in their ESSIDs).

Otherwise, I only have one question.  Why use /var/run/net.${IFACE}.essid?  It seems a little redundant and should something go wrong with the system, and the wireless script doesn't remove the script, it could make it difficult to associate to another ESSID.

Anyways, thanks for the great script though.  I even learned something totally new from it :

I didn't know [:word:] could be used in a search and replace expression  :Smile: 

----------

## UberLord

 *dopey wrote:*   

> 
> 
> Basically I made the following changes:
> 
> 1) setup_wireless_env() , the prism54 driver doesn't display the same IEEE string with iwconfig if the interface is down.  Because of that I added ifconfig up and downs around it.
> ...

 

Sounds resonable  :Smile: 

Personally, I have put in a different test - check if IFACE outputted to stdout.

 *Quote:*   

> 
> 
> 2) the prism54 driver uses MAC address of 00:00:00:00:00:00 as an interim MAC address while probing for an AP.  I added this to the associate_wireless() function
> 
> 

 

Fair enough. Bloody silly really - why can't drivers use the same bloody MAC for this stuff?

 *Quote:*   

> 
> 
> 3) in setup_wireless() you remove - and " characters. from the scanned ESSIDs.  This prevents ESSIDs with -'s in them from working properly.  I removed the check for - from the sed expression.  I'm not sure why it was in there to begin with, especially since setup_essid_env() already replaces invalid characters with _ anyways.  (one of my access points at home and my work access points both need -'s in their ESSIDs).

 

That was a hang-over from Fayes origonal script. I now have something much better  :Smile: 

 *Quote:*   

> 
> 
> Otherwise, I only have one question.  Why use /var/run/net.${IFACE}.essid?  It seems a little redundant and should something go wrong with the system, and the wireless script doesn't remove the script, it could make it difficult to associate to another ESSID.
> 
> 

 

If you set the ESSID to "any" the driver picks up the first AP and sets the ESSID accordingly. So iwconfig now reports the correct ESSID. However, if the AP goes out of range or the connection drops, the ESSID becomes "". So we store the value in file

This is important as when we take the interface down, we need to know the last ESSID associated with so we can drop DHCP and gateway if assigned. Also, it states that an IFACE has been set otherwise the generic gentoo script complains that it isn't.

Thanks for the feedback - hopefully I'll post a new version today or tomorrow  :Smile: 

----------

## UberLord

Instead of using a file, I'm now using get_options and save_options which is proper gentoo stuff  :Smile: 

----------

## UberLord

New versions posted

You'll need to change your preferred lists slightly - use tabs instead of spaces to seperate the ESSID's as a space is a valid ESSID character and a tab is not. Well, not on my AP anyway.

----------

## UberLord

NEW VERSIONS POSTED

After a quick test, the new script accepts ANY character in an ESSID that isn't a tab or a newline. Those where the only two characters I couldn't stick in my AP's ESSID.

Hopefully this covers everything again, and if no new problems are found I will submit this to bugs for inclusion in baselayout   :Smile: 

----------

## dopey

aahh.  now saving to a file makes sense  :Smile: .

One thing missing, you didn't add the extra check for 00:00:00:00:00:00 MAC address in your script.  Was that intentional or just missed it?

Otherwise, the script works perfectly for me now with just that one change (and even then, that one change is timing dependent.  Sometimes it's fast enough picking up the correct MAC and other times the script is faster).

Including this in baselayout would totally rock  :Smile: .

----------

## Kavika

Thanks! Great script, once I figured out what I was doing.  That _eth1 mixed in /etc/conf.d/net and the use of _ath0 all over the place confused the heck outa me, cause I've got an orinoco_pci card, so I thought it was going to automatically alias ath0 to eth1 or something crazy like that =)

So this script is essentially a replacement for /etc/inid.d/net.eth0?  Assuming I'm right, you might want to add stuff to /etc/conf.d/net to explicitly say that you just put "ath0" or "eth0" or "wlan0", or whatever your card is called when you type "iwconfig", and also to make sure to emerge wireless-tools =)  There should probably be changes to the Gentoo install guide, as well.

----------

## Kavika

Oh a couple more nit-picks. I have my /etc/conf.d/net set up like so:

```
iface_eth0="dhcp" #some other card...

iface_eth1="dhcp"

wireless_essid_eth1="any"

wireless_sleep_scan_eth1="0"

wirelsss_sleep_associate_eth1="5"

wireless_key_kavnetwork="restricted 1234-1234-1234-1234-1234-1234-12" # yeah, masked out ;)

wireless_iface_kavnetwork="dhcp"

wireless_preferred="kavnetwork"
```

When I run /etc/init.d/net.eth1 start, I get this:

 *Quote:*   

> * Configuring wireless network for eth1...
> 
> * Connecting to
> 
> * Failed to associate with the access point
> ...

 

It works fine, but the output seems a bit sloppy and possibly confusing.  Maybe a -z test might help?

There's also a few typos and out of sync stuff in the comments of the code.  Line 115 shoudn't say "after 10 seconds", should say "user-defined number of seconds" or "specified by sleep_associate_<IFACE>".  Line 291 says "Check that eth0 was not brough up by the kernel ..." and should say "Check that <interface> was not brought up by the kernel ..." or something like that.  Notice the typo on "brought," too.

Again, great script! =)

----------

## pompe

Nice script!  :Very Happy: 

My settings looks like this 

I use a hostap with  a netgear 311 card.  

```
iface_wlan0="dhcp"

wireless_mode_wlan0="Managed"

wireless_key_videgatan 5="5555555555"

wireless_iface_videgatan 5="dhcp"

wireless_preferred="videgatan 5"
```

the rest of the lines in /etc/conf.d/net are comment out

I have also replaced all ath0 with wlan0 in the config file and renamed net.ath0 to net.wlan0.

When I run net.wlan0 start it looks like this. 

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

/sbin/runscript.sh: line 50: wireless_key_videgatan: command not found

/sbin/runscript.sh: line 51: wireless_iface_videgatan: command not found

 * Configuring wireless network for wlan0...

 * Scanning for access points

 * Found videgatan 5

 * Connecting to videgatan 5                                              [ ok ] * 

Bringing wlan0 up...

(Here it hangs and I wait...and then press CTR-C)

 * Failed to bring wlan0 up                              

```

and 

```

iwconfig wlan0

wlan0     IEEE 802.11b  ESSID:"videgatan 5"

          Mode:Managed  Frequency:2.437GHz  Access Point: 00:30:AB:21:C8:2A

          Bit Rate:11Mb/s   Sensitivity=1/3

          Retry min limit:8   RTS thr:off   Fragment thr:off

          Encryption key:off

          Power Management:off

          Link Quality:12/92  Signal level:-88 dBm  Noise level:-99 dBm

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

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

```

There are no problem to setup the wlan manually with 

iwconfig wlan0 key "55555555555" etc. But if I just set the key manually and then run the script it don't work becouse the script resets the key to "off".

So maybe there are some problem with seting the key when your essid include a "space" or are  my net file wrong?  :Question: 

----------

## dopey

```
iface_wlan0="dhcp"

wireless_mode_wlan0="Managed"

wireless_key_videgatan 5="5555555555"

wireless_iface_videgatan 5="dhcp"

wireless_preferred="videgatan 5"
```

This is where you went wrong  :Smile: .  spaces don't work in variable names.   instead of a space, use _ between videgatan and 5.

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

/sbin/runscript.sh: line 50: wireless_key_videgatan: command not found

/sbin/runscript.sh: line 51: wireless_iface_videgatan: command not found

 * Configuring wireless network for wlan0...

 * Scanning for access points

 * Found videgatan 5

 * Connecting to videgatan 5                                              [ ok ] * 

Bringing wlan0 up...

(Here it hangs and I wait...and then press CTR-C)

 * Failed to bring wlan0 up                              

```

the two "command not found" errors are the pointer to the problem.  Once you get rid of the space in your /etc/conf.d/net file and replace them with _ you should be good to go.

----------

## UberLord

 *Kavika wrote:*   

> 
> 
> * Connecting to
> 
> * Failed to associate with the access point
> ...

 

Fixed. It should say any

 *Quote:*   

> 
> 
> It works fine, but the output seems a bit sloppy and possibly confusing.  Maybe a -z test might help?

 

If you have any ideas about how the output should look then submit some ideas!

 *Quote:*   

> 
> 
> There's also a few typos and out of sync stuff in the comments of the code.  Line 115 shoudn't say "after 10 seconds", should say "user-defined number of seconds" or "specified by sleep_associate_<IFACE>".  Line 291 says "Check that eth0 was not brough up by the kernel ..." and should say "Check that <interface> was not brought up by the kernel ..." or something like that.  Notice the typo on "brought," too.
> 
> Again, great script! =)

 

Fixed that stuff. However  the comment about being brought up by the kernel was made by the person who wrote the net.eth0 script - it's not my comment.

----------

## UberLord

 *dopey wrote:*   

> One thing missing, you didn't add the extra check for 00:00:00:00:00:00 MAC address in your script.  Was that intentional or just missed it?

 

Missed it   :Embarassed: 

It's in now

NEW VERSIONS POSTED

----------

## chockymonster

Great script, 

after sorting AP configuration (needed to be automatic WEP, not the default of Challenge Response) I'm happily browsing using my WG511T.

Only issues to sort are mixed mode working   :Confused: 

At home using wireless it takes ages to boot as eth0 is trying for dhcp, but isn't plugged in. 

The ath0 interface won't get a dhcp address so I've set it manually, but can't figure out where to set the gateway just for that adapter so I manually add a route after boot.

Apart from that I'm happily wireless again  :Smile: 

----------

## UberLord

You can emerge ifplugd which will monitor the eth0 device for when a cable is inserted/removed. It will bring up/down the appropriate interface instead of you having it in a runlevel. That solves that  :Smile: 

As to the routing problem, I have no idea about how to solve that as AFAIK the routing table can only have one default gateway - and that applies to all interfaces :/ But I'm no routing expert. The routing stuff you see is the generic Gentoo. I just slapped wireless config in it.

----------

## UberLord

NEW VERSION POSTED

Fixed a long standing issue where the script was complaining about the interface not being set in the config file when a pcmcia wifi card was removed.

If you don't have PCMCIA wifi then you don't need the new version, otherwise I would grab it if I were you!

----------

## UberLord

NEW VERSIONS POSTED

Faster scanning code! A scan is only done once instead of twice.

Better handling of scanning code - I'm pretty sure that the message "Scanning not supported" will only appear when scanning isn't supported by the driver now.

Option to run iwpriv commands before and after scanning. This is needed for HostAP users that require scanning. Check the config file for details

Tried and tested with an orinoco pcmcia card - kernel 2.6.2 with the orinoco scanning patch.

----------

## sedorox

Hello,

    First and foremost I want to tell everyone who has helped create this script (and of course the main dude :-p) What a wonderful job you have done. I noticed that you had some ESSID specific stuff. I wanted to expand on this idea, and about 2 revisions ago (now anyway) I made it so I added wireless_ESSID_dns and wireless_ESSID_dnsdomain to it, where you could have different dns servers and search domains. This came to me because I use my laptop at my house, church, and possibly soon school. All these have different (internel mostly) DNS servers. So if you want, I can send you a diff of what I have.   

 Details:

   It looks in the config file for the above mentioned lines. If it finds them, it first locates to see if there is a /etc/resolve-ESSID.conf file, if so, it moves the current one to /etc/resolv-orgin.conf, and moves the ESSID one in place of the norm. If it has the lines, but no file, then it moves the orginal, and re-creates the the file with the info provided. Then on a down of the interface, it moves the ESSID resolv file to /etc/resolv-ESSID.conf (mainly if it isn't there.. but copys over otherones anyway...), and puts the orgin back in place.

  Could use:

  I didn't figure out how to do the multiple entries on one line for more then one DNS server, right now it only does one.

     Let me know if you could either implament this (was fairly easy for me and I haven't done gentoo start scripts before) or if you want me to send what I have so far...

   HTH,

     Brandon (sedorox)

----------

## UberLord

Hi sedorox.

What you are wanting is DHCP running at each of the sites as this takes care of all that for you.

However, not all sites run DHCP, so your idea isn't all bad. Post a diff against my current version and I'll think about it.

----------

## UberLord

NEW VERSION POSTED

The interface is correctly brought down if configured for DHCP and the DHCP server returns an infinite lease time. This was a problem with the generic Gentoo script.

The paths for IWCONFIG et all are now hardcoded instead of locating them with the which command.

Indented the output to make it clearer on bootup.

----------

## Biggles

I have a 3Com PCMCIA card that uses the prism54 driver. I named the net.ath0 script net.eth1, since that's what the driver calls the interface. It then works perfectly when I insert my PCMCIA card. The problem I'm having is when I boot up with the PCMCIA card inserted. Gentoo seems to pick it up first and name it eth0, and makes my wired connection eth1. As a result, the wireless connection tries to come up with the net.eth0 script (which works fine until it can't get an IP because it doesn't have the WEP key configured) and eth1 just fails miserably, trying to configure wireless settings on a wired connection. It also makes a mess of my modules for some reason (the natsemi module can't be loaded, as well as the ATI and AGP ones - no idea why they fail, they shouldn't even be related).

So my question is, how do I stop it getting confused and ensure that eth1 is always the wireless interface so that the script will work properly?

----------

## mortonimus

Hi, just want to say thanks for this great thread, its gotten me real close to getting my network up and running.  I'm still having some difficulty though.  Here's my conf.d file:

```

iface_eth0="dhcp"

iface_eth1="dhcp"

wireless_essid_eth1="PyrieNET12"

wireless_channel_eth1="3"

wireless_sleep_scan_eth1="1"

wireless_sleep_associate_eth1="5"

```

And I copied the net.ath0 code and put it in my net.eth1 file.  When I boot up it seems to connect to PyrieNET12 alright, but it doesn't seem to actually work for using the internet.

Heres what iwconfig said

```

lo        no wireless extensions.

 

eth0      no wireless extensions.

 

eth1      IEEE 802.11-DS  ESSID:"PyrieNET12"  Nickname:"HERMES I"

          Mode:Managed  Frequency:2.422GHz  Access Point: 00:06:25:F6:3B:1A

          Bit Rate:11Mb/s   Tx-Power=15 dBm   Sensitivity:1/3

          Retry limit:4   RTS thr:off   Fragment thr:off

          Encryption key:off

          Power Management:off

          Link Quality:57/92  Signal level:-34 dBm  Noise level:-91 dBm

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

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

```

LSMOD

```

Module                  Size  Used by    Not tainted

orinoco_cs              4852   0

orinoco                42168   0  [orinoco_cs]

hermes                  6192   0  [orinoco_cs orinoco]

ds                      7316   2  [orinoco_cs]

i82365                 45296   2

pcmcia_core            47584   0  [orinoco_cs ds i82365]

```

If I change the wireless_essid_eth1="PyrieNET12" to - "any" and then make PyrieNET12 the preferred then it always connects to PyrieNET8 and says eth1 cannot specify channel or something on boot.  PyrieNET8 however does work internet stuff but its another apartments router and is a little slower.

Also, if I do a '/etc/init.d/net.eth1 restart' then it brings down eth1 but then gives an error bringing it back up.

I hope this was enough info.  I'm new to this stuff (and linux in general) so I hope I didn't just do something stupid. Thanks!

Edit: I got PyrieNET12 to work by removing the channel specification.  BUT, I still can't do a Stop and Start or a Restart of eth1, it never can bring it back up after bringing it down.  Why is that?

----------

## UberLord

 *Biggles wrote:*   

> 
> 
> So my question is, how do I stop it getting confused and ensure that eth1 is always the wireless interface so that the script will work properly?

 

Try compiling the wired network module into the kernel.

Aside from that - I don't know. My lappy has everything compiled into the kernel instead of using modules.

----------

## UberLord

 *mortonimus wrote:*   

> Edit: I got PyrieNET12 to work by removing the channel specification.  BUT, I still can't do a Stop and Start or a Restart of eth1, it never can bring it back up after bringing it down.  Why is that?

 

When the interface is brought up - correctly - could you check to see if dhcpcd is running (ps ax | grep dhcpcd) for the interface?

If it's not running then check your logs to see why it's not running. Sometimes it configures your interface and then quits straight away if the IP lease time is infinite.

----------

## dopey

 *UberLord wrote:*   

>  *Biggles wrote:*   
> 
> So my question is, how do I stop it getting confused and ensure that eth1 is always the wireless interface so that the script will work properly? 
> 
> Try compiling the wired network module into the kernel.
> ...

 

One other suggestion:

Since /etc/init.d/pcmcia starts up the necessary daemon processes to detect pcmcia cards, prior to this running load your wired ethernet adapter drivers (for example in /etc/modules.autoload.d/kernel-2.x)

There is a drawback here.  If you aren't using dhcp and using static instead, you may have to manually down the eth0 interface, since hotplug will automatically run net.eth0 start.

The other thing you can do prevent problems if you are using static addresses is to modify the net.agent script in /etc/hotplug to tell it to ignore eth0.

This can be done in the

case $INTERFACE in

statement toward the beginning of the file.  Just add |eth0 to it and that will do it.

----------

## woody77

(sorry if this comes out ugly, using links....)

If I turn off WEP, then everything works great, but if I turn WEP on, then it's a no-go.

Using a Netgear WG511T card and a Netgear WGT624 ap.

The WEP settings in the ap are Authentication type: Auto, encryption strength 128, and the key is generated from a passphrase.  I then take the hex form of the generated key, and use that in /etc/conf.d/net:

```

wireless_key_ESSID="1234-1234-1234-1234-1234-1234-12"

```

I can associate with the AP, but dhcp addressing times out.

If I use the restricted keyword, the AP is never found by iwlist.

Anyone else with this ap/card pair gotten WEP working right?  Even better would be WPA-PSK, but I think that's probably not an option with the wirelestools stuff, at this point.

----------

## woody77

bleah, typo in the WEP key.  So, if I hard-code the essid, and turn on WEP, then it all works correctly.  However, it still can't seem to correctly scan and find the network.  It seems to go into scan mode, and then it won't ever leave it.  I can watch the channel continually changing, even when I try to force it to use 6 again:

```

iwconfig ath0 freq 6

```

This is sorta a problem, because I need to be able to switch networks easily (tend to roam between about 4 different wireless networks, some with, some without WEP).

It seems that as soon as I use iwlist to scan for ap's that the card becomes useless.  It won't find anything, even if I tell iwconfig to forcibly associate with the MAC of the AP, it still won't stay on a steady channel.

In order to get it to stop scanning, I have to pop the card out of it's pcmcia slot.  Downing the interface with ifconfig doesn't seem to do it, and nothing that I send to it from iwconfig seems to have any effect in actually stopping it from scanning.

----------

## UberLord

Are you using the madwifi-driver woody?

I use that driver on my NetGear311 at home and have no problems scanning. Don't need to do anything special to get it to scan either.

Can you try and get it to scan manually? You would need to down the interface and pop the card, then rename the net.ethx script to something else (net.xxx) so pcmcia doesn't bring it up. Then insert the card again, and simply type "iwlist eth1 scan". You may have to bring the interface up (ifconfig eth1 up), but I don't have to with my card.

If you can get a sure-fire way of scanning and associating with your card and driver I can bundle this into my script.

Only problem I have with the driver is that it sometimes locks up and net connection drops for a few seconds. This is resolved if I move the PC closer to the AP.

----------

## dopey

Hm. the "turbo" cards are supported now by the madwifi driver?  Last I saw they weren't yet.  Is it possible that they just haven't implemented all the features?  The problems you're describing sound very much like driver/hardware glitches.

----------

## woody77

The turbo cards I thought were supported, but not in turbo mode (ie limited to 54Mbps 802.11g).

uberlord, yes, the madwifi driver.  I don't have hotplug setup yet to automatically detect and bring up the card on insertion.  If I pop out the card, and then pop it back in, and then do:

```

ifconfig ath0 up

iwlist ath0 scan

```

nothing gets found.  The card will start rotating through channels forever.  So long as I don't issue the scan command, it will stick on a channel.  If I do the following after a scan, still no go

```

iwconfig ath0 ap 00:09:....:CA

iwconfig ath0 freq 6

iwconfig essid MY_ESSID

```

If issue those commands before doing a scan, then it associates with the ap immediately.

I wouldn't be surprised it dopey is right, and it IS an issue with the turbo-capable card not being handled correctly by the software.  If I do:

```

#iwlist ath0 rate

ath0  8 available bit-rates :

    1Mb/s

    2Mb/s

    5Mb/s

    6Mb/s

    9Mb/s

    11Mb/s

    12MB/s

    18Mb/s

    Current Bit Rate:36Mb/s

```

This is across the house from the ap, and is about what I get in windows, but I'm surprised that it doesn't list rates higher than 18Mb/s, yet is connected at 36...

I'll inquire with the madwifi folks and see if they know of any issues.

----------

## woody77

checked with the madwifi site, and from their links, it's implied that the WG511T is supported, but it's vague.

I just rsynch'd last night, and see that there was an updated madwifi-drivers, so I just emerge -u'd those.  However, after removing the card, rmmod'ing everything, and re-inserting the card and modprobing, still no-go on scanning, but if I hardcode the essid, then it all works.

from dmesg:

```

ath_pci: driver unloaded

ath_hal: driver unloaded

wlan: drvier unloaded

ds:  cb_alloc(bus 6): vender 0x168c, device 0x0013

PCI: Enabling device 06:00.0 (0000 -> 0002)

ath_hal: 0.9.6.11

wlan: 0.7.3.1 BETA

ath_pci: 0.8.5.2 BETA

ath_pci: cache line size not set; forcing 32

ath0: mac 5.6 phy 4.1 5ghz radio 4.5

ath0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps

ath0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps

ath0: 802.11 address: 00:09:5b:89:8f:a7

ath0: Atheros 5212: mem=0x21000000, irq=11

```

And if I do a iwlist ath0 ap after associating, I get the following:

```

ath0      Peers/Access-Points in range:

    00:09:5B:86:BC:CA : Quality:35/94  Signal level:-60 cBm Noise level:-95dBm (updated)

```

However, it also doesn't see the other laptop that has one of the same cards in it, and is running Win2K and attached to the same AP when I do an "iwlist ath0 peers"

----------

## woody77

Ok, this will work, and let me scan and connect, BUT it doesn't work with your script just quite yet.  I'm going to dig into it, and see what I can do to make it work.  If nothing else, I'll write something in perl that can do this, but I'd rather help make your script handle this scenario.

The problem is that scanning doesn't seem to work under managed mode.  The card needs to be switched to Ad-Hoc mode for the scan, and then switched to Managed for the AP association.

```

ifconfig ath0 up

iwconfig ath0 mode Ad-Hoc

iwlist ath0 scan

# parse scan results into essid:ap mac id pairs

iwconfig ath0 mode Managed

iwconfig ath0 essid MY_ESSID

iwconfig ath0 key 1234-1234-1234-1234-1234-1234-12

iwconfig ath0 ap 01:23:45:67:89:AB

dhcpcd ath0

```

That sequence seems to work.

In my /etc/conf.d/net I've put:

```

#wireless_ath0_essid=""  #commented to force a scan

wireless_ath0_mode="Ad-Hoc"

```

And with a few changes to the script, it now works.

I added a mode-change to ad-hoc before the scan, and I added a mode-change before setting the essid for the found network.

I also made it really chatty, for debugging.  here's the diff:

```

110a111,114

>       #@AW Switching back to Managed mode for associating

>       einfo "  Switching to Managed Mode to associate with \"${essid_IFACE}\""

>       ${IWCONFIG} ${IFACE} mode managed

>       einfo "  Setting key for \"${essid_IFACE}\" to \"${key_IFACE}\""

116a121

>    einfo "  Setting essid to \"${essid_IFACE}\""

218c223

<       einfo "  Scanning for access points"

---

>       einfo "  Bringing up interface"

220a226,230

>       #@AW set ad-hoc mode for scanning

>       einfo "  Switching to Ad-Hoc Mode for scanning"

>       ${IWCONFIG} ${IFACE} mode ad-hoc

>       #@AW perform the scan

>       einfo "  Performing the scan

```

and here's the results on the command-line:

```

madmax root # /etc/init.d/net.ath0 start

 * Configuring wireless network for ath0...

 *   Bringing up interface

 *   Switching to Ad-Hoc Mode for scanning

 *   Performing the scan

 *     Found "MyNetwork"

 *   Switching to Managed Mode to associate with "MyNetwork"

 *   Setting key for "MyNetwork" to "1234-1234-1234-1234-1234-1234-12"

 *   Setting essid to "MyNetwork"

 *   Connecting to "MyNetwork"                                                                                                                                             [ ok ]

 * Bringing ath0 up...             

```

----------

## sedorox

I'm redoing it right now for the latest baselayout and latest script. I don't use DHCP in either location (more secure in my opinion). I figured others have this same kinda setup where they need to go from one area to another with no dhcp and change dns's, along with IP's and such... will have the diff up in a little bit

----------

## UberLord

NEW VERSIONS POSTED

You can now configure a mode to be in before a scan using wireless_scan_mode_ath0

The mode is changed back to Managed unless one is defined with wireless_mode_ath0

The only extra setup you're doing is forcing the AP's MAC address - something I'm not really wanting to do.

Hope this works for you sedrox  :Smile: 

----------

## UberLord

NEW VERSIONS POSTED

Cleanup of configuration. Basically there are less options to configure now as I'm forcing you to know the iwconfig command.

You will need to change your existing configuration with the new script

By default you shouldn't need to force ANY configuration unless you're running as an Access Point or repeater or something.

ESSID and Mode are still set seperately though.

If you're running in anything other than Managed mode then a scan is never done on startup and you have to force your ESSID.

----------

## woody77

Uberlord,

After I made the changes that I did, I was able to drop having to force the AP's mac id.  Which was nice, that definitely felt like a hack.

----------

## UberLord

Cool  :Cool: 

Does the new script work for you?

----------

## woody77

Haven't had a chance to try it yet (no wireless at work).  Question, though.  If I want to pick up a new wireless network (say a coffee-shop network), it's basically do it myself on the command-line, or add it to the preferred essids list, right?

----------

## fjorderus

Oh man, great script.  After some frustration, it works like a charm.  Here's the strange part:  if I "/usr/init.d/net.eht1 restart" I get the following:

```
 * Bringing eth1 down...                                                                      [ ok ]

 * Bringing eth1 up...

 * Failed to bring eth1 up                                                                    [ !! ]

```

 and in /var/log/messages

```
Feb 17 17:29:27 turin dhcpcd[11032]: dhcpStart: ioctl SIOCSIFFLAGS: No such device

Feb 17 17:29:27 turin rc-scripts: Failed to bring eth1 up
```

It does the same with stop and start as well.

HOWEVER, it does just fine if I remove the card and plug it back in!    :Rolling Eyes: 

Needless to say this took me a while to figure out   :Embarassed: 

Ok, anyway great stuff.  Your effort here is much appreciated by many I'm sure.

----------

## woody77

I've seen similar problems with dhcpcd.  It's a funky program, and it doesn't seem to quite be happy with adding/removing interfaces to/from it's control.  Kinda like doing an ifconfig eth0 down instead of running the init script.  The script gets a little confused.

I think that dhcpcd usually terminates on it's own as the interface is brought down by the system, but it might need to be explicitly killed on that interface during the stop init script, to ensure that it does come down correctly, and quickly enough.

----------

## sedorox

Ok, its finally done against the latest one (today's).... Works fine for me.. the only thing I wish I would have done is something like your preferred list where you can add more then one dns server.. right now it just does the one... but anyway:

dns.diff : http://www.spaceservices.net/~brandon/dns.diff

for the /etc/conf.d/net, the only thing you have to add is:

wireless_dns_ESSID="dns server"

wireless_dnsdomain_ESSID="dns domain"

thats it... let me know what you think and if you can/will include it... (you might want to clean it up, LOL)

----------

## slimflem

why why why do I continue to get

"Please make sure that /etc/conf.d/net has $iface_ath0 set"

????????

my output from /etc/init.d/net.ath0 is ....

* Configuring wireless network for ath0

*    "channel 6 freq 2.437"

*  Connecting to "gnet"

* Please make sure that /etc/conf.d/net has $iface_ath0 set

I have been looking at this so long.  All my modules load properly, the access point is found, channel and freq are set.  This error is happening in the checkconfig() function of net.ath0.

please help.

what other info do you need?

----------

## slimflem

here is my net file....right now i have it set for my nforce nic, but please examine it and see if i have messed something up.  i changed all the eth0 to ath0 in the wireless section to match my init.d/net.ath0 script name.

```

# /etc/conf.d/net:

# Global config file for net.* rc-scripts

# This is basically the ifconfig argument without the ifconfig $iface

#

#iface_ath0="192.168.1.52 broadcast 192.168.0.255 netmask 255.255.255.0"

iface_eth0="192.168.1.53 broadcast 192.168.0.255 netmask 255.255.255.0"

# For DHCP set iface_eth? to "dhcp"

# For passing options to dhcpcd use dhcpcd_eth?

#

#iface_eth0="dhcp"

#dhcpcd_eth0="..."

#iface_ath0="dhcp"

#dhcpcd_ath0="..."

##############################################################################

#                             Wireless settings                              #

##############################################################################

# Hard code an ESSID to an interface

# This needs to be done when the driver doesn't support scanning

# Set to "any" to connect to any ESSID

# This may work for drivers that don't support scanning but you need automatic AP association

wireless_essid_ath0="gnet"

# Set the mode of the interface. Managed is default

#wireless_mode_ath0="Managed"

# Setup any other config commands. This is basically the iwconfig argument

# without the iwconfig $iface

wireless_config_ath0="channel 6 freq 2.437"

# Set private driver ioctls. This is basically the iwpriv argument without

# the iwpriv $iface

#wireless_priv_ath0="mode 3"

# Some drivers need to scan in Ad-Hoc mode

# After scan, the mode is reset to the one defined above

#wireless_scan_mode_ath0="Ad-Hoc"

# We define various timeouts here

#wireless_sleep_scan_ath0="1"

#wireless_sleep_associate_ath0="5"

# Below you can define private ioctls to run before and after scanning

# Format is the same as the wireless_priv above

# This is needed for the HostAP drivers

#wireless_priv_scan_pre_ath0="host_roaming 2"

#wireless_priv_scan_post_ath0="host_roaming 0"

# Define a WEP key per ESSID

# IMPORTANT: any characters that are NOT in a_z A_Z 0_9 should be

# replaced with the _ character. For example #123 becomes _123

# wireless_key takes the same parameters as the key function in iwconfig

# You can also set iface, dhcpcd and gateway options per ESSID

# If they aren't set then the defaults for the interface are used

# IMPORTANT: don't set an interface for wireless gateway - just use an IP address

# The below examples use ESSID - change it to yours.

# You can't use "any" for an ESSID here

#wireless_key_ESSID="restricted 1234-1234-1234-1234-1234-1234-56"

# or you can use strings. Passphrase IS NOT supported

#wireless_key_ESSID="s:foobar"

#wireless_iface_ESSID="gnet"

#wireless_dhcpcd_ESSID="..."

wireless_gateway_ESSID="192.168.1.1"

# This lists the preferred ESSIDs to connect to in order

# ESSID's can contain any characters here as they must match the broadcast

# ESSID exactly

# Seperate the ESSIDs with tabs - NOT spaces

# If the first ESSID isn't found then it moves onto the next

# If this isn't defined then it connects to the first one found

#wireless_preferred="ESSID1   ESSID2   ESSID3   ESSID4"

##############################################################################

#                            End Wireless Settings                           #

##############################################################################

# For adding aliases to a interface

#

#alias_eth0="192.168.0.3 192.168.0.4"

# NB:  The next is only used for aliases.

#

# To add a custom netmask/broadcast address to created aliases,

# uncomment and change accordingly.  Leave commented to assign

# defaults for that interface.

#

#broadcast_eth0="192.168.0.255 192.168.0.255"

#netmask_eth0="255.255.255.0 255.255.255.0"

# For setting the default gateway

#

#gateway="ath0/192.168.1.1"

gateway="eth0/192.168.1.1"

```

----------

## slimflem

i guess my next part of the question should be, do I need to create a symlink to eth0 for ath0?  i did not do this...i simply made a new file for net.ath0.  thanks.

----------

## UberLord

Thats an easy one  :Smile: 

You need to configure a default setting

```
iface_ath0="dhcp"

dhcpcd_ath0="-t 5"
```

Or per ESSID. In your case

```
wireless_iface_gnet="dhcp"

wireless_dhcpcd_gnet="-t 5"
```

You didn't change ESSID to gnet (which is your ESSID)

----------

## UberLord

NEW VERSIONS POSTED

You can now specifiy nameserver and domain per ESSID

Note, setting this will overwrite /etc/resolv.conf and NOT restore it. This mimics the behaviour of DHCP

```

wireless_nameserver_UberNET="192.168.0.2"

wireless_domain_UberNET="ubernet"

```

----------

## UberLord

 *fjorderus wrote:*   

> 
> 
> It does the same with stop and start as well.
> 
> HOWEVER, it does just fine if I remove the card and plug it back in!   
> ...

 

Not sure what to do about that :/

----------

## slimflem

thank you.  after your post, your conf.d/net file makes more sense.  for some reason it just wasn't clicking before.  everything works great now.

question:  what would happen if I set both eth0 and ath0 to start using rc-update?  i would like the wireless to enable if not plugged into the built-in nic and vice versa.  i've read a lot of the posting and it seems like ifplugd is for this.  is it easy to configure?

thanks.

----------

## woody77

ifplugd is used to bring interfaces up/down when they have a good link.  this works great for wired interfaces, but doesn't work right for wireless, at least not right off the bat.

With my wireles interface, you don't get what qualifies as a good connection until the interface is actually up, and then that kinda defeats the purpose.

With a bit of work, however, you could probably create a set of scripts that continually scanned for networks, and brought up the interface whenever a "more preferred" network was found.  This is essentially what my windows drivers use, but getting this to work under linux is a bit more "interesting".  Ripping your hair out ahead of time might save you some effort... 

I think that my problems stem from the fact that my card seems to need to be driven by another app to perform the scanning.  Hmm.  This actually wouldn't be a hard app to write in C.  I just would need to learn how to write a daemon that receives signals.

Basically sit in a loop, and scan, until a network is found, and then connect.  Then, when you lose the network, continue scanning again.  The difficult bit would be scanning for other networks while still attached to a network (my card seems to bork at this).

----------

## Remillard

Okay, I think things are working alright from a kernel module aspect.  I get this from dmesg.

```

wlan: 0.7.3.1 BETA

ath_hal: module license 'Proprietary' taints kernel.

ath_hal: 0.9.6.11

ath_pci: 0.8.5.2 BETA

ath0: mac 5.6 phy 4.1 5ghz radio 1.7 2ghz radio 2.3

ath0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps

ath0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps

ath0: 802.11 address: 00:09:5b:96:44:ae

ath0: Atheros 5212: mem=0xde020000, irq=18

```

And I think that all looks fine and dandy.  I do have a question about the scripts.  It seems like everything is sort of munged together for /etc/conf.d/net, hardline and wireless together.  Am I understanding this correctly?  From a configuration standpoint, I don't see a problem, but I don't know if this is suited to a machine with both 10/100 eth and wifi.  

I have a 10/100 eth0 on the machine.  Currently that is eth0.  Do I need to rename the wireless init.d script 'eth1' so that I don't conflict?  It seems like I must, but I'm getting the eth's and the ath's mixed up potentially.

Regards,

Remillard

----------

## fjorderus

 *Quote:*   

> I have a 10/100 eth0 on the machine. Currently that is eth0. Do I need to rename the wireless init.d script 'eth1' so that I don't conflict? It seems like I must, but I'm getting the eth's and the ath's mixed up potentially. 

 

Remillard:

You should have something like net.eth0 in your /etc/init.d directory.  To add interfaces, just add the stuff in /etc/conf.d/net like you did and then "ln -s net.eth0 net.eth1" in your /etc/init.d directory.  That is, the script will be the same as eth0...it just looks at the runname to get the iface name.

Then if you want to add net.eth1 to the default runlevel do "rc-update add net.eth1 default"

Best,

F

----------

## woody77

However, if you have both wireless and wired, as I do, then you have two different interfaces:

eth0  <-- wired

ath0  <-- wireless

Now, you'll want to use the gentoo-supplied init-script for eth0, and you'll want to use the script at the start of this thread for ath0.  Copy the script to "/etc/init.d/net.ath0".

Then do the above command for rc-update:

```

rc-update add net.ath0 default

```

This will automatically bring up the wireless adapter along with the wired adapter at startup.  Use ifplugd to control the wired adapter (ie, don't bring it up if it's not connected), and then this script will control the wireless adapter.  My wireless adapter doesn't seem to want to automagically scan, so that option is out for me, so I have to kind manually run the script to bring it up/down, but it's not much pain.

----------

## UberLord

waproamd is made by the same author who wrote ifupd.

waproamd is great - however it does have a few caveats

1) It can't associate with AP's which do not broadcast their ESSID

2) It has no easy way of changing from DHCP to static IP's and/or setting new nameservers

3) If you're in range of 2 or 3 networks which you have configured, there's no way of saying which one you would prefer.

I've decided to start work on a more simple daemon. It just looks at the link quality. When it drops to zero it will restart the interface. That's all it will do.

Besides, it's a good way to brush up on my C skills. And I've never written a process on Linux before  :Smile: 

If waproamd ever gets the above functionality then I would recommend it over my own scripts any day.

----------

## woody77

See, what I was thinking was something very much like what you suggest, but which executes configurable commands instead of forcibly doing anything.

Sounds like waproamd could be a good starting point.

I've got plenty of C/C++ experience, the problem is writing daemons.  Something I've not done.

----------

## UberLord

 *woody77 wrote:*   

> I've got plenty of C/C++ experience, the problem is writing daemons.  Something I've not done.

 

I've got little C/C++ experience and have never written a daemon before. I am, however a very competent VB and PHP developer.

Until today that is .........

I've got a working daemon that monitors links quality and then resets the interface if it drops below a configurable level. It also logs to syslog. Doesn't have any kernel interaction - just reads /proc/net/wireless.

The internet is an excellent resource  :Smile: 

----------

## woody77

excellent!

Where'd you find good (or passable) instructions on writing a daemon?  and traping the signals sent to shut it down/restart?

----------

## Remillard

Okay, I'm trying to set up the /etc/conf.d/net file and having a bit of trouble mapping the things that are on the wireless router to the items in the file.  The Router is the Netgear WGR614.  The card is the Netgear WG311 PCI card.

The madwifi drivers emerged, compiled, and have insmodded successfully into the kernel.

So in /etc/conf.d/net I have the following bits:

```

#eth0 is hardline 

iface_eth0="dhcp"

#eth1 is the wireless

iface_eth1="dhcp"

wireless_essid_eth1="mySSIDfromrouter"

# fairly certain mode and scan is correct

wireless_mode_eth1="Managed"

wireless_scan_mode_eth1="Ad-Hoc"

```

Here's where I run into trouble though, with the WEP.  The router is set up to do 64(48) bit encryption, and authentication type "automatic".  I think the type says the router will figure it out.  So anyway onto the confusion.  The net file says I can define a WEP key per ESSID.  On the router it has a place for 4 keys though. 

So, from the net documentation I can put in one key:

```

wireless_key_100acrewoods="abcdef1234"

```

And then where do the other 3 keys go?  I suppose I'm not certain what all the keys are for.  When this link gets set up, does the card and router have to match all 4 keys, or do they sort of slide them against each other til at least one hits a match?

I should note that I'm not too concerned about signal strength here, because the distance will be roughly 2-3 meters at most.  This is done mostly so my wife doesn't have to walk over a cable on the tile floor ;-) (plus the laptop uses the wireless too).

Another question, the net config file has a line for a couple of timeouts.  Is the number in minutes, or seconds?  I'm kind of figuring minutes at the moment, but I'm not entirely sure.

So I think that about covers it.  The machine doesn't move, and I only have the one SSID to connect to, so I don't need to define the multiple site lines, and it's a DHCP connection, so gateway and nameserver, etc should be given.

Can someone check out the bits I have done already and give me a pointer or three on how to handle the WEP keys?

Thanks.

Remillard

----------

## milkypostman

I am using your script and i like it except in running it i found that it was getting called from the pcmcia.  Well, basically, cardmgr calls /etc/pcmcia/network (as per the /etc/pcmcia/config file) and from there it calls the /etc/pcmcia/wireless script and then calls /etc/init.d/net.eth1 (from the network script.  it appears that rather than using your script you can edit /etc/pcmcia/wireless.opt and put in the ESSID and other information there.  

However, i decided not to do this, i edited /etc/pcmcia/config and instead of setting the class to "network" i set it to "shared" which doesn't call any other scripts.  

The pcmcia script is required for operation of the network card (loads the modules) and while i haven't tried their configuration utility i'll try it and see how it goes.  Basically what it looks like it will do is set the ESSID and all he other parameters and THEN call net.eth1 (gentoo version not yours) and handle the actual interface configuration there.  Going to give it a shot tommorrow.  Too tired from digging through the files to see what was going on.

----------

## UberLord

 *Remillard wrote:*   

> 
> 
> So, from the net documentation I can put in one key:
> 
> ```
> ...

 

AFAIK, only one key can be active at any time. You can put other keys in there though if you want to check the iwconfig manual for how to do multiple keys on one line. Just remember that the script puts "iwconfig iface key" in front of the string.

 *Quote:*   

> 
> 
> Another question, the net config file has a line for a couple of timeouts.  Is the number in minutes, or seconds?  I'm kind of figuring minutes at the moment, but I'm not entirely sure.

 

Seconds - I'll update the documentation

----------

## UberLord

 *milkypostman wrote:*   

> 
> 
> The pcmcia script is required for operation of the network card (loads the modules) and while i haven't tried their configuration utility i'll try it and see how it goes.  Basically what it looks like it will do is set the ESSID and all he other parameters and THEN call net.eth1 (gentoo version not yours) and handle the actual interface configuration there.  Going to give it a shot tommorrow.  Too tired from digging through the files to see what was going on.

 

Thats basically correct.

For my lappy, I just editied wireless.opts in /etc/pcmcia and removed the defaults.

I'm more than happy when the net.ethx script is started and stopped when the card is removed  :Smile: 

----------

## UberLord

 *woody77 wrote:*   

> excellent!
> 
> Where'd you find good (or passable) instructions on writing a daemon?  and traping the signals sent to shut it down/restart?

 

Trapping signals

http://www.enderunix.org/docs/eng/daemon.php

I used the daemon command instead of fork though

"man daemon" for more info.

----------

## milkypostman

I don't know much about the script you wrote... its full of fun lines but it doesn't appear to have any place in it for leap authentication.  I wouldn't mind contributing and i know the procedure to get it going.  Any chance you could throw something in there to handle it?  Like extra parameters based off ESSID?

----------

## funkmankey

UberLord: many thanks.

I am using a ralink 2460 based minipci card in my toshiba appliance server, and it is very picky about the order in which various ifconfig/iwconfig values are assigned. whether by luck or by design, this script works perfectly.

----------

## giannifive

Thanks UberLord.  This wireless setup should be a standard part of Gentoo!

----------

## MrDooM

My wirless lan works now very fine. Thank you.

I've only one problem. After some hours of running (Filesharing for example) i come back to my computer and see this:

Link Quality:0/94

My net.ath0 is offline and i have no connection.

If i do a /etc/init.d/net.ath0 restart everything is ok for the next hours.

I use the scripts from uberlord, my card is a netgear 311 pci card. 

Under win xp everything works fine mor than days, so the card is not defect.

Has anyone this problems too or can anyone help me?

I use the newest CVS madwifi drivers.

Thx

----------

## UberLord

Mr DOOM - I have the exact same problem with my 311 card as well. It has to be a madwifi-driver problem

----------

## UberLord

 *milkypostman wrote:*   

> I don't know much about the script you wrote... its full of fun lines but it doesn't appear to have any place in it for leap authentication.  I wouldn't mind contributing and i know the procedure to get it going.  Any chance you could throw something in there to handle it?  Like extra parameters based off ESSID?

 

No, there's nothing in there for leap authentication. I've never actually heard of it   :Embarassed: 

How about you post up the procedure for getting it going. And does it need to be done before or after association?

----------

## milkypostman

Procedure is as follows:

1) associate to the ESSID

2.a [optional]) run /opt/cisco/bin/bcard (this sets up saved cisco settings, i don't personally use it)

2.b) run /opt/cisco/bin/leapscript <user> <password> (yeah unfortunatly plain text)

3) run dhcpd or setup static ip settings.

----------

## truth

For some reason my Wep key doesnt show in iwconfig after this script runs, And  therefore does not connect to the AP. However  I can get the wireless NIC running if i use: iwconfig eth1 essid truth; iwconfig eth1 enc 123456789; dhcpcd eth1. When running the script i get t he following:

```
  * Configuring wireless network for eth1...

           * Connecting to "truth"

           * Failed to associate with the access point truth

           * Failed to configure wireless for eth1                                  [ !! ]

```

My /etc/conf.d/net is as follows:

```
 

# /etc/conf.d/net:

# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/conf.d/net,v 1.7 2002/11/18 19:39:22 azarah Exp $

iface_eth0="dhcp"

iface_eth1="dhcp"

#dhcpcd_eth0="..."

wireless_mode_eth1="Managed"

#wireless_config_eth1="ap any"

wireless_essid_eth1="truth"

wireless_eth1_truth="restricted 9AC0-81B5-9203-2281-B3E7-74CE-88"  #key has been changed to protect the innocent.

#wireless_eth1_truth="dhcp"

```

I have also tried changing the format in which i set the wireless_eth1_truth="restricted 12345768797" i have also done wireless_eth1_truth="123456789ABCDEF" and "open 123456789ABCDEF"  none have worked. Evertime i run iwconfig after /etc/init.d/net.eth1 the essid is set to truth correctly but Encryption Key is set to "off". If i use iwconfig eth1 esid truth; iwconfig eth1 key 12345467ABCDEF; dhcpcd eth1 it comes up fine. I am using 2.6.2 kernel, pcmcia is built into the kernel, the wireless pcmcia NIC is a cisco aironet 350 which is compiled as a module and is loaded in /etc/modules.autoload.d/kernel-2.6 before pcmcia is loaded. So i guess i need to understand why it says "failed to associate with the access point truth" and why it doesnt seem to set the key correctly from /etc/conf.d/net

Any suggestions? I would rather not remove WEP.

----------

## UberLord

WEP and ESSID are reset to nothing by my script if it cannot associate with an AP which explains your last point.

For WEP problems, I would recommend trying to associate without WEP. When that works - and you can use the wireless correctly - then apply the WEP settings.

A common problem with WEP is a typo - but most times you can associate with an invalid WEP key. Which is why I recommend trying without WEP first.

----------

## UberLord

 *milkypostman wrote:*   

> Procedure is as follows:
> 
> 1) associate to the ESSID
> 
> 2.a [optional]) run /opt/cisco/bin/bcard (this sets up saved cisco settings, i don't personally use it)
> ...

 

So this is a cisco specific thing? Not sure that I would want to do that, but I suppose I could launch an external script after association.

----------

## truth

As i suspected it connects fine with WEP disabled. However i would like WEP enabled, I have tried more than one key and triple checked the key to make sure it isnt a typo. Maybe my config is missing something? Guess im not particularly clear about the association process. Like i mentioned in my previous post WEP works fine when i use iwconfig to bring up the wireless NIC.

Any Suggestions anyone?

----------

## truth

I went through the script and found key_iface so i changed /etc/conf.d/net to read wireless_key_<essid>="restricted 123456789ABCDEF"  instead of wireless_iface_<essid>="restricted 123456789ABCDEF"  and it worked. Not sure if this is correct but if it is then i misread your example conf. What would i need to do to have it scan for available AP's?

Thx for the response earlier Uber.

----------

## xenocide2

the new version seems to be broken, only breaks with essid's in the wireless_preferred option:

```

 * Configuring wireless network for eth1...

 *   Scanning for access points

 *   eth1 does not support scanning

 *   No preferred Access Points found for eth1 - trying to force preferred

/sbin/runscript.sh: line 314: [: missing `]'

 *   Failed to associate with any preferred access points

 * No Access Points found for eth1

 * Failed to configure wireless for eth1                                  [ !! ]

```

i assume it is probably an easy fix, but since my card doesnt support scanning i like to use the wireless_preferred option. Thanks.

----------

## UberLord

 *xenocide2 wrote:*   

> 
> 
> i assume it is probably an easy fix, but since my card doesnt support scanning i like to use the wireless_preferred option. Thanks.

 

Yeah, it was.

Sorry about that   :Embarassed: 

NEW VERSION POSTED

----------

## UberLord

 *truth wrote:*   

> I went through the script and found key_iface so i changed /etc/conf.d/net to read wireless_key_<essid>="restricted 123456789ABCDEF"  instead of wireless_iface_<essid>="restricted 123456789ABCDEF"  and it worked. Not sure if this is correct but if it is then i misread your example conf.

 

That is indeed correct.

wireless_iface_<essid> is exactly like the iface_<iface> - it controlls wether to use static IP or DHCP

 *Quote:*   

> 
> 
>  What would i need to do to have it scan for available AP's?
> 
> Thx for the response earlier Uber.

 

It should scan automatically. If it doesn't then it may be a driver problem. For example, my orinoco needs a kernel patch to support scanning. However, if you set the wireless_essid_<iface> to "any" then it should pickup the first available access point ok - even if the driver doesn't support scanning directly.

Another option is to force APs through the wireless_preferred list.

HTH

----------

## milkypostman

 *UberLord wrote:*   

>  *milkypostman wrote:*   Procedure is as follows:
> 
> 1) associate to the ESSID
> 
> 2.a [optional]) run /opt/cisco/bin/bcard (this sets up saved cisco settings, i don't personally use it)
> ...

 

it is cisco specific but a lot of people use it i think it would be usefull.  i agree though, you wouldn't need to actually support that specific script.

----------

## dopey

I've noticed something kind of odd, and I dn't remember when this started happening, but at some point, the net.eth0 script is now running in the foreground when hotplugging picks up the device rather than running in the background.

i notice this becuase for some weird reason when dhcpcd gets an address at work, then i go home it takes a few minutes to get an address at home.  since i use localhost to do most of its own communications getting an address immediately isn't vital..

anyone know if this is a result of the new hotplug version or something changed with this wireless script that's causing this behavior?

----------

## xenocide2

 *UberLord wrote:*   

>  *xenocide2 wrote:*   
> 
> i assume it is probably an easy fix, but since my card doesnt support scanning i like to use the wireless_preferred option. Thanks. 
> 
> Yeah, it was.
> ...

 

no need for sorrys, thanks a LOT for the script.. will it be included in the next release?

----------

## UberLord

 *xenocide2 wrote:*   

> no need for sorrys, thanks a LOT for the script.. will it be included in the next release?

 

Erm - I released a new version of the script yesterday with a fix in for you if that's what you meant.

----------

## UberLord

 *dopey wrote:*   

> I've noticed something kind of odd, and I dn't remember when this started happening, but at some point, the net.eth0 script is now running in the foreground when hotplugging picks up the device rather than running in the background.
> 
> i notice this becuase for some weird reason when dhcpcd gets an address at work, then i go home it takes a few minutes to get an address at home.  since i use localhost to do most of its own communications getting an address immediately isn't vital..
> 
> anyone know if this is a result of the new hotplug version or something changed with this wireless script that's causing this behavior?

 

I can't think of anything that could cause that switch. Maybe you turned strict net checking on and parallel startup off.

----------

## dopey

 *UberLord wrote:*   

> I can't think of anything that could cause that switch. Maybe you turned strict net checking on and parallel startup off.

 

I haven't done anything that I know of beyond updated hotplug on the 14th, and update your script a few times when you posted them.  Oh well, the long delay just gave me an excuse to actually figure out why it's happening.  Read the dhcpd docs more closely, reconfigured the server to be authoritative and now the problems gone and I actually like that the script is run in the foreground on boot. I can see quickly what access point I associated with  :Smile: 

----------

## UberLord

In that case I would summerize that hotplug is no longer starting up the network script   :Laughing: 

Personally I think that hotplug starting any network device is a bad idea - the possible exception being usb-nic's.

----------

## robertmcpeak

I'm having some trouble with the scanning part of net.eth0.  I get the following:

```

 * Configuring wireless network for ath0...

 *   Scanning for access points

 *   ath0 does not support scanning

 *   No preferred Access Points found for ath0 - trying to force preferred

 *   Connecting to "robs_home"

```

When I manually run

```

iwlist ath0 scan

```

I get

```

ath0      Scan completed :

          Cell 01 - Address: 00:A0:C5:41:E0:26

                    Mode:Master

                    Encryption key:off

                    Quality:48/94  Signal level:-47 dBm  Noise level:-95 dBm

                    Mode:Master

                    ESSID:"Wireless"

                    Frequency:2.437GHz

                    Bit Rate:1Mb/s

                    Bit Rate:2Mb/s

                    Bit Rate:5Mb/s

                    Bit Rate:11Mb/s

          Cell 02 - Address: 00:40:96:2A:28:E7

                    Mode:Master

                    Encryption key:****-****-****-****-****

                    Quality:28/94  Signal level:-67 dBm  Noise level:-95 dBm

                    Mode:Master

                    ESSID:"KC-DEFAULT"

                    Frequency:2.437GHz

                    Bit Rate:1Mb/s

                    Bit Rate:2Mb/s

                    Bit Rate:5Mb/s

                    Bit Rate:11Mb/s

          Cell 03 - Address: 00:40:96:58:1E:60

                    Mode:Master

                    Encryption key:****-****-****-****-****

                    Quality:25/94  Signal level:-70 dBm  Noise level:-95 dBm

                    Mode:Master

                    Frequency:2.437GHz

                    Bit Rate:1Mb/s

                    Bit Rate:2Mb/s

                    Bit Rate:5Mb/s

                    Bit Rate:11Mb/s

          Cell 04 - Address: 00:02:2D:92:9F:16

                    Mode:Master

                    Encryption key:off

                    Quality:28/94  Signal level:-67 dBm  Noise level:-95 dBm

                    Mode:Master

                    ESSID:"keyon_hotspot"

                    Frequency:2.457GHz

                    Bit Rate:1Mb/s

                    Bit Rate:2Mb/s

                    Bit Rate:5Mb/s

                    Bit Rate:11Mb/s

 
```

Any ideas?

Rob

----------

## dopey

 *UberLord wrote:*   

> In that case I would summerize that hotplug is no longer starting up the network script  
> 
> Personally I think that hotplug starting any network device is a bad idea - the possible exception being usb-nic's.

 

I did enough tinkering to get this far:

1) /etc/init.d/hotplug start detects the device and loads the proper module for it via the pci.rc script.

2) The module load triggers the kernel's hotplug mechanism to call /sbin/hotplug on the netdevice which calls net.agent.

3) net.agent calls net.eth0 and fires up the wireless script.

Somewhere in the chain of events is causing net.eth0 output to be printed out in the console during boot with the hotplug service starts.

Maybe this weekend when I have time I'll try to figure out where it's happening.

----------

## dopey

typo in latest net.eth0 script.

line 91:

        if [ -n "${wirless_dhcpcd_IFACE}" ]; then

should be wireless right  :Smile: 

Prevents interface specific ESSID specific dhcpcd options from being used.

----------

## gua

Thanks for the great script - though it doesn't work anymore. I was initially using your script, but I had to do some debugging with my wireless card and had to go back to inserting commands manually. Now I wanted to switch back to the script, but it gives me errors with the sleep-option. There seems to be some sort of incompatibility problem that probably needs to be fixed. I haven't touched the sleep-options in the config file at all because I don't need them. The version of the sleep on my machine is 5.0.91, if that's any use. Ask for more info...for now I can't come up with anything else.

```
bash-2.05b# /etc/init.d/net.ath0 start

 * Configuring wireless network for ath0...

<mapping sub-ioctl mode to cmd 0x8BE0-2>

 *     "mode 3"

 *   Connecting to "[maskedessid]"

sleep: invalid time interval `0.5'

Try `sleep --help' for more information.

sleep: invalid time interval `0.5'

Try `sleep --help' for more information.

sleep: invalid time interval `0.5'

Try `sleep --help' for more information.

sleep: invalid time interval `0.5'

Try `sleep --help' for more information.

sleep: invalid time interval `0.5'

Try `sleep --help' for more information.

sleep: invalid time interval `0.5'

Try `sleep --help' for more information.

sleep: invalid time interval `0.5'

Try `sleep --help' for more information.

sleep: invalid time interval `0.5'

Try `sleep --help' for more information.

sleep: invalid time interval `0.5'

Try `sleep --help' for more information.

sleep: invalid time interval `0.5'

Try `sleep --help' for more information.

sleep: invalid time interval `0.5'

Try `sleep --help' for more information.

sleep: invalid time interval `0.5'

Try `sleep --help' for more information.

sleep: invalid time interval `0.5'

Try `sleep --help' for more information.

sleep: invalid time interval `0.5'

Try `sleep --help' for more information.

sleep: invalid time interval `0.5'

Try `sleep --help' for more information.

sleep: invalid time interval `0.5'

Try `sleep --help' for more information.

sleep: invalid time interval `0.5'

Try `sleep --help' for more information.

sleep: invalid time interval `0.5'

Try `sleep --help' for more information.

sleep: invalid time interval `0.5'

Try `sleep --help' for more information.

sleep: invalid time interval `0.5'

Try `sleep --help' for more information.

 *   Failed to associate with the access point [maskedessid]

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

----------

## UberLord

 *robertmcpeak wrote:*   

> Any ideas?

 

Try the following setting

```

wireless_sleep_scan_ath0=10

```

If that works, lower the value until it fails and then increase it by one

----------

## UberLord

 *dopey wrote:*   

> typo in latest net.eth0 script.
> 
> line 91:
> 
>         if [ -n "${wirless_dhcpcd_IFACE}" ]; then
> ...

 

Oopsie

NEW VERSION POSTED

----------

## UberLord

 *gua wrote:*   

> 
> 
> ```
> 
>  * Configuring wireless network for ath0...
> ...

 

You shouldn't need to set any ioctls with the mad-wifi driver

 *Quote:*   

> 
> 
> ```
> 
>  *   Connecting to "[maskedessid]"
> ...

 

Could you post up the sleep part of your config and the output of 

```
sleep 0.5
```

Thanks!

----------

## robertmcpeak

 *UberLord wrote:*   

> 
> 
> Try the following setting
> 
> ```
> ...

 

Thanks!  It was a bit flakey with wireless_sleep_scan_ath0=2 (Didn't always detect all of the APs), and works fine with wireless_sleep_scan_ath0=3

Rob

----------

## robertmcpeak

My dual band card (a/b/g) occasionally drops out of the 2.4 gig band, and goes into the 5 gig band after being plumbed @ 2.4...As you can imagine, that's rather annoying.

Is there a way to set the band per ESSID?  I have no way of knowing the operating channel ahead of time, since it changes.

Rob

----------

## xenocide2

 *UberLord wrote:*   

>  *xenocide2 wrote:*   
> 
> i assume it is probably an easy fix, but since my card doesnt support scanning i like to use the wireless_preferred option. Thanks. 
> 
> Yeah, it was.
> ...

 

Actually i ment in the next rls. of gentoo..  :Smile: 

----------

## gua

I took out the ioctl. It however makes no difference. No luck with sleep....

```
 bash-2.05b# sleep 0.5

sleep: invalid time interval `0.5'

Try `sleep --help' for more information.
```

```

bash-2.05b# sleep --help

Usage: sleep NUMBER[SUFFIX]...

  or:  sleep OPTION

Pause for NUMBER seconds.  SUFFIX may be `s' for seconds (the default),

`m' for minutes, `h' for hours or `d' for days.  Unlike most implementations

that require NUMBER be an integer, here NUMBER may be an arbitrary floating

point number.

      --help     display this help and exit

      --version  output version information and exit

Report bugs to <bug-coreutils@gnu.org>.

```

I tried sleep 0,5 and it worked. So instead of a period I have to use a comma for sleep. Go figure...

And the config part:

```
# We can define various timeouts in seconds here

#wireless_sleep_scan_ath0="1"

#wireless_sleep_associate_ath0="5"
```

----------

## UberLord

 *xenocide2 wrote:*   

>  *UberLord wrote:*    *xenocide2 wrote:*   
> 
> i assume it is probably an easy fix, but since my card doesnt support scanning i like to use the wireless_preferred option. Thanks. 
> 
> Yeah, it was.
> ...

 

Heck if I know.

I'm going to submit this script to bugs.gentoo.org and see what happens. But I'm only going to do that after I can go for a week without any fixes/additions to the it.

----------

## UberLord

NEW VERSIONS POSTED

Sleep fixed for non-english langs (like German for example)

You can now run an external script if you wish - check the config file for details

----------

## UberLord

 *milkypostman wrote:*   

> Procedure is as follows:
> 
> 1) associate to the ESSID
> 
> 2.a [optional]) run /opt/cisco/bin/bcard (this sets up saved cisco settings, i don't personally use it)
> ...

 

You'll be please to know that you can now configure a script to run after association and before dhcp/static ip.

You can also configure a script to run when the interace is brought down as well

It can be configured per IFACE and/or ESSID

I decided to take this approach as I didn't want to put IHV specific stuff in there.

----------

## UberLord

 *robertmcpeak wrote:*   

> My dual band card (a/b/g) occasionally drops out of the 2.4 gig band, and goes into the 5 gig band after being plumbed @ 2.4...As you can imagine, that's rather annoying.
> 
> Is there a way to set the band per ESSID?  I have no way of knowing the operating channel ahead of time, since it changes.
> 
> Rob

 

If the channel changes, then so does the frequency (operating band). I can only assume that the card drops into the 2.4 range due to 2.4 devices/APs connecting

You could try experimenting with the "iwconfig freq" command (man iwconfig for info). This would need to be run after my script.

If that works for you, I can easily add something to my script for it to work - like a post association iwconfig command per essid/iface.

----------

## gua

The script works now, after modifying the line 161: from sleep 0.5 to sleep 0,5. I didn't touch anything else. I'm using ISO 8859-15 maps and all the Finnish stuff there is. So therefore a comma is the correct format for me to express a decimal number. I guess that's what my system thinks too  :Smile: 

Thanks anyway.

----------

## UberLord

 *gua wrote:*   

> The script works now, after modifying the line 161: from sleep 0.5 to sleep 0,5. I didn't touch anything else. I'm using ISO 8859-15 maps and all the Finnish stuff there is. So therefore a comma is the correct format for me to express a decimal number. I guess that's what my system thinks too 
> 
> Thanks anyway.

 

Could you try the new script please, as it should work for you

----------

## Naughtyus

Does anyone know how I might be able to convert these scripts for use with Debian?

----------

## UberLord

 *Naughtyus wrote:*   

> Does anyone know how I might be able to convert these scripts for use with Debian?

 

A valid question. However, I have no idea how Debian handles init scripts.

I would ask this question in the Portage and Programming forum or in a Debian forum or in a Debian/Gentoo irc channel.

----------

## Thrifty

The script worked first time for me!!!!

Problem is that my card seems to go to sleep every 10-20 seconds, e.g. if I am pinging one out of every 10 pings with go missing.  

19 packets out of 31 were received in my last test.

I have a DWL-G520 with Atheros AR5212A chipset on it, and it's over a distance of about 4 meters to a DWL-900AP+ 

I was previously mucking around with a Prism 2.5 card with the WLAN-NG drivers which worked flawlessly.

Any ideas what is making it pause would be really good, it's a pain in the ass trying to use SSH over it.

I also noticed when copying that when it happens the data rate drops from 4000kbps to 10kbps then goes back up.

----------

## truth

UberLord i just wanted to take a second to Thank you for giving your time and creating this script. I appreciate it.

----------

## xaphod

Heya,

Brilliant script ! Worked the first time for me!

However... I need to not use DHCP (don't ask!), and therefore I need to set the gateway and DNS and such. The DNS setting is workign great (doing it by ESSID), but the gateway is broken.

One probable reason why it's broken; open up the current (feb 25 2004) version of the net.eth0 and search for the word gatewatey (that's not a typo in my msg, that's a typo in the script).

But, after "fixing" that typo, it still doesn't work for me, so it's further broken.  My line is:

wireless_gateway_blythwood="192.168.0.1" ... where blythwood is my ESSID.

Thanks in advance!

X

----------

## UberLord

NEW VERSION POSTED

Gateway option per ESSID fixed

----------

## UberLord

 *Thrifty wrote:*   

> The script worked first time for me!!!!
> 
> Problem is that my card seems to go to sleep every 10-20 seconds, e.g. if I am pinging one out of every 10 pings with go missing.  
> 
> 19 packets out of 31 were received in my last test.
> ...

 

I would bet money that it's a driver problem as I see the same thing with my Athereos based card.

----------

## Thrifty

Damn it, oh well I will post a bug to the madwifi bug list and hope that someone fixes it.

I wish the companies making these cards would think about the consumer and write official drivers for their chipsets, or at least release the full specs to a team of people willing to write a driver.

I mean the fact of that matter is that IF this had worked properly due to the drivers being better I would have purchased another 5 of these cards.  But since it doesn't I wont be and hence Atheros and D-Link are losing money.

----------

## gua

 *UberLord wrote:*   

>  *gua wrote:*   The script works now, after modifying the line 161: from sleep 0.5 to sleep 0,5. I didn't touch anything else. I'm using ISO 8859-15 maps and all the Finnish stuff there is. So therefore a comma is the correct format for me to express a decimal number. I guess that's what my system thinks too 
> 
> Thanks anyway. 
> 
> Could you try the new script please, as it should work for you

 

I downloaded the most recent script available yesterday just before posting that so back then the script was not working (same error.) I don't know how you tried to fix it (temporarily changing some global variable?), but it didn't work. If it is of any help for you, I could post information about the values set in my system when I get home.

----------

## milkypostman

Uberl0rd,

So i saw the updates you made to the script to allow external scripts to be run.  There are two things.  First, you shouldn't echo what script is being run.  Its a security risk as in my case i make the net file root only rwx.  The other thing is that in my case the script needs to be run specific to ESSID and not specific to the adapter.  I wrote my own update to a previous script if you'd like to see, but basically in the associate_wireless() function here is the snippet.

```

        einfo "  Connecting to \"${display_essid}\""

        # Wait for the system to associate

        # If no associaton after a user defined time, fail

        ${IFCONFIG} ${IFACE} up >/dev/null

        # added by melki

        if [ -n "${wireless_script_IFACE}" ]; then

                einfo "  Running Setup Script"

                ${wireless_script_IFACE} >/dev/null ||

                        eerror "  Error running \"${display_essid}\" setup script"

        fi

        local counter=0

        while ((${counter} < ((${sleep_associate_IFACE} * 2)))); do

```

wireless_script_IFACE is setup in the essid_env() function.  I didn't know how you layed out your variables.  If you don't want to implement something like this let me know, no hard feelings.

/edit: what i did is made wireless_script_IFACE = wireless_script_ESSID just to clarify. (I just didn't want to insert the whole script here and since you updated i didn't keep an original and didn't want to diff with the never version.)

----------

## xaphod

Excellent, thank you!  That was quick. I'll try it out tonight - if I don't post again, presume it worked for me  :Smile: 

X

 *UberLord wrote:*   

> NEW VERSION POSTED
> 
> Gateway option per ESSID fixed

 

----------

## UberLord

NEW VERSION POSTED

Decided to scrap waiting per 0.5 seconds to associate in favour of 1 second.

This should deffo fix the sleep problem

What preifup/down script is being run is no-longer displayed

@milkypostman - you can set a script for the interface AND/OR the ESSID

----------

## gua

 *UberLord wrote:*   

> NEW VERSION POSTED
> 
> Decided to scrap waiting per 0.5 seconds to associate in favour of 1 second.
> 
> This should deffo fix the sleep problem
> ...

 

Thanks. I'm not going to download the new script yet though...this works way too flawlessly, IÃ¤m afraid to touch it  :Smile: 

Now I just need to get the link to stay on...it drops after some time of heavy load, but when I'm away it works  :Sad: 

----------

## UberLord

 *gua wrote:*   

> Thanks. I'm not going to download the new script yet though...this works way too flawlessly, IÃ¤m afraid to touch it 

 

 :Idea:  Keep a backup then   :Rolling Eyes:   :Laughing: 

----------

## milkypostman

Ok, issues still arising with the script issue.  I hope this isn't bothering you, i figure you want to make this script badass as can be and there are plenty leap users that might find it usefull.  ANYWAYS! on to the problem.

in the associate_wireless function you test the Access Point: property to make sure its not FF:FF:FF:FF:FF:FF or 00:00:00:00:00:00.  Problem is that on leap systems the card will NOT change the NIC address until after it has authenticated.  I don't know why this is but it doesn't.  So because of this i had to move the part that runs the ESSID specific script to above that test (as i posted above).  Your script does 'iwconfig <dev> essid <essid>' and then does 'ifconfig <dev> up'.  Right after that and before the test is where i have to run the script   :Rolling Eyes:  .  damn you cisco!

----------

## UberLord

So you need a script to run before each ESSID association attempt?   :Question: 

You're right BTW - I do want this net.xxx script to be the baddest swiss army knife out there   :Razz: 

----------

## milkypostman

 *UberLord wrote:*   

> So you need a script to run before each ESSID association attempt?  
> 
> You're right BTW - I do want this net.xxx script to be the baddest swiss army knife out there  

 

yes, here is how i see it going down.

you have your normal scripts associated with interfaces.

then you have scripts associated with an essid.  

in the first case you have the script run where you have it runnig currently.  if its a script associated with an essid you have it run in that associate_wirless function.  you see my sample code and know where that is?  thats where i need my leap script run.   :Wink: 

//edit:  its kind after the association.  you do the association "iwconfig <iface> essid <specifiied_essid>" then your script tests.  so technically its after the association but before you test the NIC address.  you with me here? i feel like i'm not explaining this well or being a jerk.

----------

## UberLord

NEW VERSION POSTED

New configuration variable - wireless_preassociate_ESSID="/run/this/script"

That should sort out LEAP users  :Smile: 

----------

## milkypostman

 *UberLord wrote:*   

> NEW VERSION POSTED
> 
> New configuration variable - wireless_preassociate_ESSID="/run/this/script"
> 
> That should sort out LEAP users 

 

my hero!

----------

## UberLord

 *milkypostman wrote:*   

> 
> 
> my hero!

 

 :Embarassed:   :Embarassed:   :Embarassed: 

----------

## viperlin

links are down on first post btw i'm setting it up in a bit so mirror please, or server back up  :Smile: 

----------

## UberLord

Sorry about that - my server looks a little hosed. Methinks the upgrade to hardened 2004.0 fekked up :/

/me whips out a liveCD and starts a stage1 rebuild

----------

## viperlin

i'm willing to host the files until you finish, just email them me for now

(see email button below  :Smile: )

----------

## UberLord

Emailed

----------

## viperlin

Mirror:

[censored by Viperlin]

please use links on front page now  :Smile: Last edited by viperlin on Mon Mar 08, 2004 10:32 am; edited 1 time in total

----------

## UberLord

Updated 1st page post - thanks  :Smile: 

----------

## pandaxiongmao

Uberlord, I am wondering if this script could work during Gentoo installation; thus wireless net installation would be possible.

----------

## UberLord

Provided that the wireless-tools package was installed and any necessary kernel modules on the CD, then it should work.

----------

## Klavs

Bug in latest version:

/etc/init.d/net.wlan0 restart

gawk: cmd. line:2: $0 ~ /Link/ { if ($1

gawk: cmd. line:2:                      ^ unexpected newline or end of string

gawk: option requires an argument -- v

Usage: gawk [POSIX or GNU style options] -f progfile [--] file ...

[SNIP rest of GAWK help]

/sbin/runscript.sh: line 2: { if ($1 == IFACE) print "yes" }: command not found

tr: two strings must be given when translating

/sbin/runscript.sh: line 2: [:lower:]: command not found

/sbin/runscript.sh: line 2: ${wireless_sleep_associate_wlan0}: command not found

 * Bringing wlan0 down...                                                                                                    [ ok ]

gawk: cmd. line:2: $0 ~ /Link/ { if ($1

gawk: cmd. line:2:                      ^ unexpected newline or end of string

gawk: option requires an argument -- v

[SNIP rest of GAWK help]

/sbin/runscript.sh: line 2: { if ($1 == IFACE) print "yes" }: command not found

tr: two strings must be given when translating

/sbin/runscript.sh: line 2: [:lower:]: command not found

/sbin/runscript.sh: line 2: ${wireless_sleep_associate_wlan0}: command not found

what is up here?

----------

## Klavs

For some odd reason my old script now gives me this when starting up:

 Configuring wireless network for wlan0...

 *   Connecting to "KLAVSWLAN"

 *   Failed to associate with the access point KLAVSWLAN

 * Failed to configure wireless for wlan0

and when I look in the code I can see that it checks iwconfig for MAC - which returns 00:00:00... (which I suppose is the none-existing AP's Mac) and thus says its not connecting.

Only the weird thing is, that this worked before - and I've set it to Ad-hoc mode - so it could sit and listen, and play AP (it's an Atmel - doesn't support HostAP drivers) - but that suddenly doesn't work with the script  :Sad: 

Any ideas what's up? I'll try your latest script, as soon as it's fixed  :Smile: 

----------

## UberLord

Sorry, but I have a little problem with my hosting server, and the lines got wrapped when emailing the scripts to the current temporary host.

I'll see if I can have them available tomorrow

----------

## viperlin

UberLord, feel free to email the new scripts un-wrapped  :Smile:  i'll put them on ASAP but timezones may cause delay.

maybe you should put versions on this  :Smile:  like in the filenames.

----------

## UberLord

Emailed

Versions in filenames? Maybe you haven't noticed, but I've been updating the header in /etc/init.d/net.eth0 for a while now with mod dates  :Smile: 

----------

## viperlin

Mirrored, they are still not fully un-wraped,

 there is a gawk line 

```

 wireless_IFACE="$(${IWCONFIG} ${IFACE} 2>/dev/null | gawk -v

IFACE=${IFACE} '{ if ($1 == IFACE) print "yes" }')"

```

those are 2 seperate lines, are they suposed to be? etc

----------

## viperlin

new version posted, i think i fixed the wrap errors in net.eth0

----------

## Klavs

Not entirely - but I got the last ones -and put it up here:

http://vsen.dk/files/net.eth0  :Wink: 

Unfortunately it fails like the old script just started doing:

 * Bringing wlan0 down...                                                                                                    [ ok ]

 * Configuring wireless network for wlan0...                                                                                                                 [ ok ]

 *   Connecting to "KLAVSWLAN"

 *   Failed to associate with the access point KLAVSWLAN

 * Failed to configure wireless for wlan0

I would be very happy if you could help me debug this.

It worked earlier today - I tried connecting from another client it worked fine.

the used options in /etc/conf.d/net are:

iface_eth0="192.168.x.x broadcast 192.168.x.255 netmask 255.255.255.0"

iface_wlan0=10.y.y.y broadcast 10.y.y.255 netmask 255.255.255.0"

wireless_essid_wlan0="KLAVSWLAN"

wireles_mode_wlan0="Ad-Hoc"

wireless_key_KLAVSWLAN="restricted s:fooba"

gateway="eth0/myip"

the exact ones as worked earlier  :Sad: 

----------

## UberLord

I'm now hosting the scripts directly again after a quick(ish) server rebuild

Thanks to viperlin for temporary hosting  :Smile: 

----------

## UberLord

Klavs - could you try the scripts from my server please? Check the 1st page post for links.

If it still fails, postup the output of

```
iwconfig wlan0

iwlist wlan0 scan
```

Thanks

----------

## Klavs

didn't work - same bug as before.

#iwconfig wlan0

wlan0     IEEE 802.11-DS  ESSID:"KLAVSWLAN"  Nickname:"okuwlan"

          Mode:Managed  Channel:10  Access Point: 00:00:00:00:00:00

          Bit Rate:11Mb/s

          RTS thr:off   Fragment thr:off

          Encryption key:off

          Power Management:off

          Link Quality:0  Signal level:0  Noise level:0

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

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

#iwlist wlan0 scan

wlan0     Interface doesn't support scanning : Operation not supported

This is not new. The card worked fine - and probably will again, if I manually configure it. I used it the other day - even with WEP enabled it worked fine  :Smile: 

But as said - the script suddenly won't work and I can't figure out what changed  :Sad: 

----------

## UberLord

could you postup the following

```
ifconfig wlan0 up

iwlist wlan0 scan
```

Also, could you try configuring to managed mode? I think that should work. If it does, it looks like I have some more work to do!

----------

## Klavs

ifconfig wlan0 ups the device just fine:

wlan0     Link encap:Ethernet  HWaddr 00:08:A1:52:F8:CF

          inet6 addr: fe80::208:a1ff:fe52:f8cf/64 Scope:Link

          UP BROADCAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

if I do ifconfig wlan0 ip netmask nm up it would have gotten that address  :Smile: 

and the driver still does not support the iwlist interface - and thus not scanning! it also said that when it worked fine with the startup script.

----------

## UberLord

 *Klavs wrote:*   

> 
> 
> wireles_mode_wlan0="Ad-Hoc"
> 
> 

 

Shouldn't that be

```

wireless_mode_wlan0="Ad-Hoc"

```

You missed an "s"

----------

## MrDooM

Uberlord it told you some pages ago about my problem with my netgear 311 pci card. The wireless lan works well, but after some hours of filesharing I have a lost connection to the router. A "/etc/init.d/net.ath0 restart" and it works again. Do you have found a solution in the last days for this problem? I posted a thread on cvs madwifi bugs. But i got no answer. 

Maybe you have more luck than I.

Thx

MrDooM

----------

## UberLord

Not yet as I don't use my PC with my Athereos card in too much as part of the problem is that i has to get past 3 walls to the AP. When I move house in a month or so I should be able to play with it more.

If it is a problem with my script - which I strongly doubt, then I can fix it.

In the meantime, I recommend looking into ifplugd and/or waproamd as they may fix your problem.

----------

## Klavs

Uberlord - thank you for spotting that  :Wink:  - I don't know If I edited it wrong and caused this - or it was the version of conf.d/net file I got, that had it - but after I fixed it, it worked as usual.

----------

## Vivid5500

Does anybody have a problem with getting the script and module to autoload when they compile a new kernel?

I tried to switch over to the love sources and I couldn't get the ndiswrapper to load back up. Maybe I'm missing the easy fix to get it running again. It took me ages to get the script to run automatically the last time, I'm tempted just to stick it out with the 2.6.2 kernel.

----------

## UberLord

You get the module to autoload by editing the file /etc/modules.autoload.d/kernel-version

Or just compile it right in.

----------

## ^Sporting^

I was trying to install my PCMCIA wireless based on chipset RT2400/RT2460 as like dmesg say to me following the instructions of this post. but when I do 'modprobe rt2400' I receive this output:

```
invalid operand: 0000

CPU:    0

EIP:    0010:[<c68f80c9>]    Not tainted

EFLAGS: 00010286

eax: c1168e76   ebx: c690799c   ecx: c1168c00   edx: fffffffb

esi: 00000000   edi: c1168c00   ebp: c219def0   esp: c219de84

ds: 0018   es: 0018   ss: 0018

Process modprobe.old (pid: 1342, stackpage=c219d000)

Stack: 000071ec c01ba295 c1168c00 c1168c00 c219deb0 c02fc318 c1168c00 0000003f

       c1168c00 00000000 c1168c00 c219dec0 c1168c00 c6907ca0 c1168c00 c219def0

       c68f8096 c1168c00 c6907c60 c6907c60 c02fc84a c1168c00 c6907c60 00000000

Call Trace:    [<c01ba295>] [<c02fc318>] [<c6907ca0>] [<c68f8096>] [<c6907c60>]

  [<c6907c60>] [<c02fc84a>] [<c6907c60>] [<c6907ca0>] [<c02fc8d9>] [<c6907ca0>]

  [<c68f8943>] [<c6907ca0>] [<c01c61b9>] [<c68f8060>] [<c01b10c7>]

Code: 0f 45 d8 e8 6f 24 9e f9 89 44 24 14 85 c0 0f 84 28 02 00 00
```

 and then the only thing I can do it's to reboot my notebook.

Does someone have any idea?

I'm on Gentoo with gentoo-sources (2.4.22-gentoo-r7)

Hardware info:

Amd K6-2 333 Mhz

ram 96 Mb

----------

## flaZh

Using the latest script works for me.

But I get an error when shutting down my comp.

It's bringing down all eth's. And then cardmgr tries to stop eth1(my wlan), then failes because it's not up. Any ideas?

----------

## UberLord

 *^Sporting^ wrote:*   

> I was trying to install my PCMCIA wireless based on chipset RT2400/RT2460 as like dmesg say to me following the instructions of this post. but when I do 'modprobe rt2400' I receive this output:[code]invalid operand: 0000
> 
> Does someone have any idea?
> 
> I'm on Gentoo with gentoo-sources (2.4.22-gentoo-r7)
> ...

 

Thats deffo a kernel/module problem that has nothing todo with these scripts.

Try using a 2.6 kernel. I use development-sources myself and they work great

----------

## UberLord

 *flaZh wrote:*   

> Using the latest script works for me.
> 
> But I get an error when shutting down my comp.
> 
> It's bringing down all eth's. And then cardmgr tries to stop eth1(my wlan), then failes because it's not up. Any ideas?

 

Thats a known problem with the PCMCIA scripts working with Gentoo rc scripts. I'm not sure when thats going to be fixed - but it's only a visual error as the interface is taken down.

----------

## ^Sporting^

 *UberLord wrote:*   

> Thats deffo a kernel/module problem that has nothing todo with these scripts.
> 
> Try using a 2.6 kernel. I use development-sources myself and they work great

 I have already tried with a kernel 2.6.3-r2, but I have not been able to compile the modules, too much complicated for me to modify sources. If the sources exist already modified for being it compiles for kernel the 2.6, for me it's better. otherwise a patch to apply to sources that do it all automagically. I haven't still used your script, just why loading the modules it has not happened.

Bye!

----------

## viperlin

tryed my freinds wifi card (it lights up when i plug it in) however dispite having all hermes drivers compiled into the kernel it would not exist. (wlan0)

i re-compiled with hermes as modules thinking that might make it work however i did not get another chance to try and wont for at least another week.    :Crying or Very sad: 

it uses the chipset beginning with O if i remember correcly (hermes driver options according to kernel help)

looking at the modules i would assume i have to modprobe orricino_cs for the driver (sorry for poor spelling of that driver name, it will not stick in my memory)

----------

## UberLord

Orinoco is what you're looking for.

If it's a PCMCIA card, then you need to emerge the pcmcia-cs kit as well

----------

## viperlin

 *UberLord wrote:*   

> Orinoco is what you're looking for.
> 
> If it's a PCMCIA card, then you need to emerge the pcmcia-cs kit as well

 

my D-Link 8139too Network card (PCMCIA) works fine so i know it's not pcmcia  :Smile: 

thinking of getting this:

http://www.planetmicro.co.uk/product_info.asp?stockcode=M000109

to try and get it working, it's very similar to my freinds if not the exact same one.

when plugging the card in, in /var/log/messages it mentioned no modules found for the card, something about PCI, i forget now, laptops just going on charge now.

----------

## ^Sporting^

OK guys,

in the end i made my pc card to work with the driver rt2400_linux_2.6_mod.tar.gz.tar and kernel 2.6.4-rc1 (vanilla development-sources)

i'm so happy   :Laughing: 

and now....

emerge sync ; emerge -u world   :Wink: 

Gentoo Rulez!!!

Bye!

----------

## UberLord

NEW VERSION POSTED

Code cleanup

Added a check to see if wireless-tools has been emerged if any wireless settings have been made

Please test this out as it's going to be submitted to bugs.gentoo.org for inclusion in baselayout if no-one reports back with any problems in say a week or so.

----------

## UberLord

Bump for testing

----------

## symbiat

After a week of trying to figure out the wireless PCMCIA stuff, these scripts, in conjunction with help from another wireless PCMCIA user (Thanks Nick!) have finally got my wireless card working automagically (as they should).

Any plans to make these scripts part of the base Gentoo packages? (if not, they should be!).

----------

## viperlin

little tip to users of linuxant: dont set the clock back to beat 30 day trial, it's not worth it, now my laptop sets a random time on bootup (correct in bios before grub, soon as gentoo's booted up the time is something random, i can't get it to stick even using date and hwclock --systohc, grrr, where's setting the time wrong?????

----------

## UberLord

 *symbiat wrote:*   

> Any plans to make these scripts part of the base Gentoo packages? (if not, they should be!).

 

I'll be submitting these scripts Real Soon Now for inclusion into Gentoo baselayout

----------

## viperlin

good, i just ordered my AccessPoint, it'll be here in 4 days  :Very Happy: 

just updating the net.eth0 script, maybe the net one too for any new features/comments  :Smile: 

----------

## viperlin

BUG:

cannot use full stops or other such characters in an ESSID when setting:

wireless_key_R'lyeh="open s:foobar"

the ' is not liked, neither are fullstops. this happens with all essid settings in the wireless settings such as gateway per essid.

wlan: R'lyeh

nickname: Cthulhu

 :Laughing:  (mythological fiction rules for names)

----------

## UberLord

Sigh

There are comments about using ESSID's in the /etc/conf.d/net file

Basically any characters that are NOT a-z or A-Z HAVE to be changed to the _ character

wireless_key_R'lyeh="open s:foobar"

becomes

wireless_key_R_lyeh="open s:foobar"

However, you can use any characters in ESSID for the wireless_preferred option.

----------

## viperlin

 :Sad:  sorry  :Sad:  vims colour scheme makes comments hard to read on my laptop (blue wallpaper, transparent aterm)

sorry   :Embarassed: 

----------

## UberLord

No problem  :Cool: 

Almost two weeks without a bug or a change now  :Smile: 

----------

## saint

Well, just because I like to cause trouble... hehe. I have a problem with your setup scripts (well, maybe it's just a problem with me...). Regardless, I have it set to what I believe to be the correct settings for my hardware; (i'm using the linuxant wrapper)

 * Configuring wireless network for eth1...

 *   Scanning for access points

 *     Found "default"

 *     Found "Laura1"

 *   Connecting to "Laura1"                                                [ ok ]

 * Bringing eth1 up...

 * Failed to bring eth1 up                                                 [ !! ]

I'm almost certain I have the 'net' set correctly, copied and pasted the key from my roomies' wireless router config. I notice you say replace anyting that's not a-z or A-Z with an '_', but I assume that the numbers are also valid. Any insight on this??

Thanks for your time!

Scott

----------

## UberLord

 *saint wrote:*   

> 
> 
>  *   Connecting to "Laura1"                                                [ ok ]
> 
>  * Bringing eth1 up...
> ...

 

That shows that it's connecting to the AP, but not getting a DHCP address. This can be caused by incorrect WEP settings, MAC filtering blocking your card or just a faultly DHCP server. Try using a static IP.

Numbers are valid - the latest /etc/conf.d/net script I posted says this.

----------

## schmoboy

I am using your scripts to fire up my SMC2802 card.

I get the following error when running the script.  I'm not sure what the SIOCSIFFLAGS message means.  I have the isl3890 (taken and renamed from my Win driver CD) in /usr/lib/hotplug/firmware....

```

bash-2.05b# /etc/init.d/net.eth1 start

 * Configuring wireless network for eth1...

 *     "channel 1"

 *   Connecting to "default"

SIOCSIFFLAGS: No such file or directory

 *   Failed to associate with the access point default

 * Failed to configure wireless for eth1                                  [ !! ]

```

I am new to linux so I don't know where to look to see why this is happening.  Any help would be appreciated.

Here's my iwconfig output...

```

eth1      NOT READY!  ESSID:"default"

          Mode:Managed  Channel:1  Access Point: FF:FF:FF:FF:FF:FF

          Tx-Power=31 dBm   Sensitivity=0/200

          Retry min limit:0   RTS thr=-1 B   Fragment thr=-1 B

          Encryption key:off

          Link Quality:0  Signal level:0  Noise level:0

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

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

```

I am running gentoo-2.6.3-r1 kernel with the prism54 compiled in.  Should it really be a module?  Is that the problem?

Thanks!!!!!

----------

## saint

Mmmm, indeed, the wep was wrong! The fix was rather simple, I just did it from the command line. I did a 'iwconfig eth1 key $key open' and then 'iwconfig eth1 essid Laura1' and all went well... I guess my problem was trying to overcomplicate things hehe. Not quite as automated, but I can probably whip up a quick script to do that I think, hehe. Thanks for your response though! much help!!

Scott

----------

## schmoboy

UPDATE:  I needed to 'emerge hotplug' to make it work.  It was missing the needed scripts in /etc/hotplug.

Once I did that, everything just "clicked".

Thanks for the scripts, worked flawlessly with Gentoo kernel 2.6.3-r1 and prism54 drivers.

----------

## damianfrancis

Is there a howto for using this script to start a lan interface? If not, I was wondering if UberLord would mind explaning howto use and tweek the scripts a bit.  Exactly what does one need to do to  begin using these scripts to startup a wired or wireless nic?  This alters the script for bringing up eth0 right, will it also bring up wlan0?  Do I need to use another script to start wlan0, if so do I have to add both eth0 and wlan0 to default if I want one of them to startup at boot?  If I do that how can I make it so it doesn't take forever to figure out that nothing should be started when my laptop is plugged into a lan or within a wan?

----------

## thechosen0ne

These are some beastly scripts, thank you UberLord for the blessings which you have bestowed upon us, the Gentoo users. Anyway, things work wonderfully. I've noticed problems with WEP tend to be user problems (happened in my case  :Rolling Eyes:  ). This is an extremely well-done approach using the "gentoo method"... seems very comsistent with the way they like to do things.

As for a HOWTO on using these scripts... it's pretty straightforward to people who have messed with gentoo scripts before, but a little unusual to some users.

Quick HOWTO for using UberLord's scripts:

1. Get your wireless NIC working. This means get it so you can run iwconfig and have it recognize the card and wireless extensions. For this you need to compile the right driver/module and have it working as an interface. These scripts assume you already have this done. For more help, check out The Gentoo Handbook or browse around on the forums

2. #nano -w /etc/conf.d/net  Go through the file (as modified by UberLord) and follow the examples. This shouldn't be too bad if you only have one access point. Even WEP is easy, but TYPE IT IN RIGHT OR IT WILL NOT WORK! Also make sure you include "open" or "shared" depending on which type of WEP setup you have (if applicable)

3. #/etc/init.d/net.ath0 start  (ath0 = the name of your interface - mine is eth0, some people have wlan0). 

If all goes well it should give you a bunch of "OK"s and you're good to go. You can check that it set everything right by typing "ifconfig ath0" and seeing that you have an IP address and "iwconfig ath0" to make sure that the script set everything as you wanted it. 

Note: if you have eth0 (wired) and wlan0 (wireless), call this file net.wlan0 and leave net.eth0 alone. As far as I can tell (I hope), this script works for wired cards too, so people using a PCMCIA wired and wireless card can just name the script net.eth0 and use it for either card.

One note (bug?)... I'm using an 128-bit WEP key and when i try to set the wep using the s:passphrase option, it generates a different hex value (viewed using iwconfig) than the one my AP generates. See below

"iwconfig eth0 enc s:passphrase" result 0cf6-e541-3e1f-454d-5923-1db6-bd

AP generated 7061-7373-7068-7261-7365-0000-00

I saw something in the man page for iwconfig about passphrase not being supported... what the heck is the s: option enabled for then? While this is not a problem with the scripts (does the same in straight iwconfig, no script), I hope someone can clarify. Thanks! Also, how do you get it to be wlan0 instead of eth0? Does it have to do with compiling as module/in kernel? Thanks!

Integrate this baby into baselayout so that this thread can rest in peace!

----------

## damianfrancis

ok well I actually got the script to work.  It took me a minute to realize that since my wireless interface in wlan0 I need to copy your eth0 to my wlan0, and that I needed to changed the permissions to be able execute, and that I need to add something in ~net for wlan0 to resolve with dhcp.  But now it seems to be using the script to bring up wlan0 so I guess I can jsut add it to default and enjoy it at boot.  How do I get it to time out faster if there is no wan available to connect to?

----------

## damianfrancis

I just noticed somthing odd about my card I do not think this has anything to do with the script but it may.  I have the broadcom bcm94306 chipset on my card, and I am using the ndiswrapper to load drivers.  I noticed just now that if I try to start the wlan0 interface with the script and it fails cause of no AP, then it will contintue to fail even if an AP becomes present.  But if after an AP becomes available I unload and reload the ndiswrapper module, then I can use the script to bring up wlan0.

----------

## UberLord

 *damianfrancis wrote:*   

> How do I get it to time out faster if there is no wan available to connect to?

 

Don't force an ESSID against the interface and don't use a preferred list.

If it can't find one then it's OK.

You could also try lowering wireless_sleep_scan value. I find that a value of zero (no wait) can cause problems, but a value of 1 works 100% of the time with my cards and drivers.

----------

## UberLord

 *damianfrancis wrote:*   

> But if after an AP becomes available I unload and reload the ndiswrapper module, then I can use the script to bring up wlan0.

 

You could solve this by using the preifup_wlan0 setting to point to a script that unloads and then loads the module.

----------

## Zb7

This is being mean to me. I really don't understand this at all.

At boot, eth0 searches for an AP but can never find one, and when I bring up eth0 while I am in my WM (XFCE) it finds my AP and works fine, I don't get it. Also eth0 isn't even supposed to be my wireless, it is my hard line. I have it set so that eth1 is the one that looks for my AP in /etc/conf.d/net but it doesn't listen. Please help because I really don't know what I am doing at all.

----------

## UberLord

 *Zb7 wrote:*   

> This is being mean to me. I really don't understand this at all.
> 
> At boot, eth0 searches for an AP but can never find one, and when I bring up eth0 while I am in my WM (XFCE) it finds my AP and works fine, I don't get it. Also eth0 isn't even supposed to be my wireless, it is my hard line. I have it set so that eth1 is the one that looks for my AP in /etc/conf.d/net but it doesn't listen. Please help because I really don't know what I am doing at all.

 

If the output from "iwconfig" shows that eth0 has wireless extensions, then it HAS wireless extensions regardless of what you want. Maybe eth1 is the hardwire.

----------

## UberLord

NEW VERSION POSTED

Only change is that when DHCP fails, it tells you that it's failed instead of just saying "Failed to bring the interface up".

This is a very good indication that wireless config has worked and the problem is either WEP not configured correctly, a crappy driver (like the madwifi-driver + my netgear 311 card) or there's "something else" causing signal drops. Like a brick wall for example.

----------

## UberLord

Submitted to https://bugs.gentoo.org for inclusion into Gentoo  :Smile: 

https://bugs.gentoo.org/show_bug.cgi?id=45483

----------

## Grilo

I am trying to get my SMC 2802w card working and i have the prism54 drivers in the kernel(built in) and wireless tools installed when i type iwconfig i get this

```
 iwconfig

lo        no wireless extensions.

 

eth0      no wireless extensions.

 

eth1      NOT READY!  ESSID:off/any

          Mode:Managed  Channel:6  Access Point: 00:00:00:00:00:00

          Tx-Power=31 dBm   Sensitivity=0/200

          Retry min limit:0   RTS thr=0 B   Fragment thr=0 B

          Encryption key:6361-706F-6569-7261-726F-6461-31   Security mode:restricted

          Link Quality:0  Signal level:0  Noise level:0

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

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

```

when i try to emerge linux-wlan-ng i get an access violation. i have the script in the /etc/init.d folder but it says it cannot find wlan0

any help would be greatly appreciated.

Thank you

----------

## thechosen0ne

Strange... I am at a library and they have free, open wireless here. However, the scripts seem to be failing... Here is my output:

```

# /etc/init.d/net.eth0 start  

 * Configuring wireless network for eth0...

 *   Connecting to "any"

 *   Connected to "InternetOnly"                                          [ ok ]

 * Bringing eth0 up...                                                    [ ok ]

 *   Setting default gateway...

SIOCADDRT: Network is unreachable

 * Failed to bring eth0 up                                                [ !! ]

 * Bringing eth0 down...                                                  [ ok ]

```

However, running a simple #ifconfig eth0 up and #dhcpcd eth0 makes everything work. I wonder what could be the problem? This is a case where the old gentoo scripts would have worked fine as no wireless extensions are needed to simple use the "any" ssid with no security settings.

Update: It seems that if I disable lines 516-519 in the net.eth0 script, it at least doesn't bring the interface back down. However, it does say "network unreachable" when I try to ping something. Here is my modified code... not sure if it will help, but hopefully this narrows it down a tad.

```

[b]/etc/init.d/net.eth0[/b]

                ebegin "  Setting default gateway"

                # First delete any existing routes if it was setup by kernel ..

                ${ROUTE} del default dev ${gateway%/*} &>/dev/null

                ${ROUTE} add default gw ${gateway#*/} dev ${gateway%/*} \

                        netmask 0.0.0.0 metric 1 >/dev/null || {

                        local error=$?

        #               ${IFCONFIG} ${IFACE} down &>/dev/null

        #               eend ${error} "Failed to bring ${IFACE} up"

        #               stop

        #               return ${error}

                }

                eend 0

```

Update 2: It seems this may not really be a problem with the scripts, per se. As the ssid "InternetOnly" might imply (which i just now noticed) the library seems to only allow connections on port 80. I tried loading up GAIM and found that I could not connect. Then I tried Xchat... same deal. In fact, I can't even get a ping response form www.google.com Far as I can tell, the scripts are trying to use a network feature or port that the library net admins have disabled.Last edited by thechosen0ne on Tue Mar 23, 2004 6:48 pm; edited 3 times in total

----------

## UberLord

Well, looks like the interface should be eth1 and not wlan0

You'll neet to reflect this by linking /etc/init.d/net.eth0 to /etc/init.d/net.eth1 and configuring /etc/conf.d/net appropriately

----------

## Grilo

eth0 is my wired card. so i am not sure what i should do to link it. i have two net.eth files 

net.eth0 is my wired card

and net.eth1 is the script for my wireless

do i need linux-wlan-ng?

----------

## thechosen0ne

Check and make sure your /etc/conf.d/net file is properly set so that eth1 has the settings it needs for the wireless options. This may be where the "wlan0" is coming from. Otherwise, make sure that your card is eth1 (which it seems to be from your iwconfig outout) and make sure the modified script file is called "net.eth1". That should be all you need. I actually uninstalled the wlan-ng drivers because all those extra wlan config files in my /etc was giving me a headache. Happy to say you don't need it.

----------

## Grilo

from this thread i did the following to my /etc/conf.d/net

```

iface_eth1="dhcp"

dhcp_eth1="-h Biowireless -D"

                                                                                

wireless_essid="Biowireless"

wireless_channel_eth1="6"

wireless_mod_eth1="auto"

wireless_rate_eth1="auto"

wireless_rts_eth1="off"

wireless_frag_eth1="iff"

                                                                                

wireless_key_Biowireless="dbb6d2a42d"                                                                    

```

and i did not alter the script just mv it to /etc/init.d/net.wlan0 then to net.eth1 after the last advice.

when i run the script it says 

```

 /etc/init.d/net.eth1 start

 * Loading module for interface: eth1

FATAL: Module eth1 not found.

 * Bringing eth1 up...

 * Failed to bring eth1 up                                                [ !! ] 

```

but i built everything into the kernel. the other thing i noticed is when i run iwconfig it says not ready where everyone else's says IEEE 802?

thank you all for your help

----------

## thechosen0ne

OK, now you seem to be down to the real problem... I think the script is trying to load the driver as a module, but you said you compiled it into the kernel. Perhaps the scripts could use a check to see if the driver is already compiled into the kernel. 

For a quick-fix, however, you should be able to recompile your kernel but with your wireless driver as a module. This way you can modprobe/rmmod the driver if you are having any problems. For me this is pretty necessary because I have a laptop and pcmcia wants card drivers as modules. Maybe this is the way UberLord wrote it too since he appears to have a laptop as well.

----------

## UberLord

 *Grilo wrote:*   

> from this thread i did the following to my /etc/conf.d/net
> 
> ```
> 
> wireless_channel_eth1="6"
> ...

 

The above code is invalid with the current script. It needs to be moved into wireless_config_eth1

Example

```
wireless_config_eth0="channel 6 rts off frag off"
```

----------

## UberLord

 *thechosen0ne wrote:*   

> For me this is pretty necessary because I have a laptop and pcmcia wants card drivers as modules. Maybe this is the way UberLord wrote it too since he appears to have a laptop as well.

 

I do have a laptop - and I also have the wifi drivers compiled into the kernel.

I got it working by making the cardbus option in /etc/conf.d/pcmcia an empty string - ie don't load modules!

 :Cool: 

----------

## Grilo

ok so i recompiled the prism54 drivers to modules and this is what i get now.

```
Orion linux # /etc/init.d/net.eth1 start

 * Loading module for interface: eth1

FATAL: Module eth1 not found.

 * Bringing eth1 up...

 * Failed to bring eth1 up                                                [ !! ] 

Orion linux # modprobe prism54

Orion linux # lsmod

Module                  Size  Used by

prism54                46008  -

Orion linux # /etc/init.d/net.eth1 start

 * Loading module for interface: eth1

FATAL: Module eth1 not found.

 * Bringing eth1 up...

 * Failed to bring eth1 up                                                [ !! ] 

```

i checked on the prism54.org and my SMC 2802w card is supported... so I am not sure but everytime i do a iwconfig i get the card but it says NOT READY! where almost everyone is IEE802

is there anything i might have missed.. compiled wlan not ham into kernel and the prism54 drivers.. (mm-sources rc5 2.6 kernel) and then i emerged wireless tools

it's weird that it can see the card but not do anything with it.

----------

## Grilo

i also emerged prism54 from net-wireless to see what it would do but it does not seem to do anything either...

----------

## UberLord

 *Grilo wrote:*   

> 
> 
> is there anything i might have missed.. compiled wlan not ham into kernel and the prism54 drivers.. (mm-sources rc5 2.6 kernel) and then i emerged wireless tools

 

You also need CONFIG_NET_RADIO configured in the kernel. If it's not configured you may need to re-emerge wireless-tools

----------

## Grilo

I am unable to find the net_radio option in the make menuconfig. and i reemerged wireless-tools and still am unable to find the option.

something else i noticed is that it is trying to load the eth1 module; is that going to be associated with the prism drivers that the kernel loads? it does not seem to use those.

[ found]

ok realized where the config net radio was and it is compiled into the kernel.

it just seems like the driver is not getting linked to eth1

[found]

i did  a dmesg and found this

```

Loaded prism54 driver, version 1.0.2.2

eth1: prism54 driver detected card model: SMC2802W

```

so eth1 is being linked.. now my only problem is still when i run iwconfig i get this

```

eth1      NOT READY!  ESSID:off/any

          Mode:Managed  Channel:6  Access Point: 00:00:00:00:00:00

          Tx-Power=31 dBm   Sensitivity=0/200

          Retry min limit:0   RTS thr=0 B   Fragment thr=0 B

          Encryption key:off

          Link Quality:0  Signal level:0  Noise level:0

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

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

```

all other posts say IEE802 where mine says Not ready. i just don't get it. and when i run the script is says it can't find the modules eth1 .

Success

the probelm was WEP i had it on 128 and when i turned it off it all worked.. is there a setting for at least 64 bit?

thank you so much for the help and the script

----------

## UberLord

 *Grilo wrote:*   

> Success
> 
> the probelm was WEP i had it on 128 and when i turned it off it all worked.. is there a setting for at least 64 bit?

 

Sure - you use a key with 5 bytes

 *Quote:*   

> 
> 
> thank you so much for the help and the script

 

No problem  :Smile: 

----------

## Grilo

my wireless seems to connect as mentioned but i am unable to connect to anything. i get an ip and everything if i run ifconfig or iwconfig but mozilla or gaim or even the router i can not connect to.

----------

## UberLord

 *Grilo wrote:*   

> my wireless seems to connect as mentioned but i am unable to connect to anything. i get an ip and everything if i run ifconfig or iwconfig but mozilla or gaim or even the router i can not connect to.

 

Is this using WEP?

----------

## Grilo

yes it is but i am currently turning it off to make sure that is it. 

I have noticed that with wep enabled and i run iwconfig it says encription :cd security restriced.

in the /etc/conf.d/net script where the wep section is.. does it go like this

wireless_key_ESSID:"Biowireless ahahahahaha" or what format should the key the ahahah in this case be. my router gives me capital letters should i be using lowercase? or put the spaces in?

thank you very much with all your help

----------

## UberLord

If the essid is Biowireless then the command is

wireless_key_Biowireless="restricted s:fooba"

Of course, you could change restricted to open or leave it out entirely and let the driver decide.

----------

## Grilo

ok thank you ben using the iwconfig command essid then enc 

it connects but then just dies and will not even register teh eth1 if i do a iwconfig.. could that be my signal?

----------

## god8y

Weird, I've finally found the problem why I couldn't connect to the AP.

I have to set my channel with iwconfig manually and then start my eth1 device, any idea's how to fix this ?

----------

## UberLord

 *god8y wrote:*   

> Weird, I've finally found the problem why I couldn't connect to the AP.
> 
> I have to set my channel with iwconfig manually and then start my eth1 device, any idea's how to fix this ?

 

```

wireless_config_eth0="channel 6"
```

Change interface and channel number accordingly

----------

## UberLord

 *Grilo wrote:*   

> ok thank you ben using the iwconfig command essid then enc 
> 
> it connects but then just dies and will not even register teh eth1 if i do a iwconfig.. could that be my signal?

 

Is it still working without wep? If so, your WEP config may still be causing problems. Remember, that passphrase is not supported, just the key.

----------

## Grilo

i have wep running at 64bit and am using a key and not a parpass. not sure... i am looking into ways of boosting my router's signal. its' an smc 7004vwbr

----------

## god8y

Some other problem I bumped on now, I can 'connect' to the AP with a HEX WEP key (128bit) but I cannot ping anything or get pinged, assume the key is 01234567890123456789012345

I should set 

wireless_key_De_Coninck="open 0123-4567-8901-2345-6789-0123-45"

right?

problem is: I can connect to the AP but i have to manually set the WEP key again to make it possible the machine can be accessed

----------

## UberLord

 *god8y wrote:*   

> Some other problem I bumped on now, I can 'connect' to the AP with a HEX WEP key (128bit) but I cannot ping anything or get pinged, assume the key is 01234567890123456789012345
> 
> I should set 
> 
> wireless_key_De_Coninck="open 0123-4567-8901-2345-6789-0123-45"
> ...

 

If you manually set the WEP key and it works, put exactly what you type after "iwconfig eth0 key" in the wireless_key_De_Coninck field.

----------

## god8y

 *UberLord wrote:*   

>  *god8y wrote:*   Some other problem I bumped on now, I can 'connect' to the AP with a HEX WEP key (128bit) but I cannot ping anything or get pinged, assume the key is 01234567890123456789012345
> 
> I should set 
> 
> wireless_key_De_Coninck="open 0123-4567-8901-2345-6789-0123-45"
> ...

 

So if i type in:

iwconfig eth1 enc 01234567890123456789012345 

I have to use:

wireless_key_De_Coninck="enc 01234567890123456789012345" ?

then i get: 

eth1 doesn't support setting keys , so i guess it freaks on the enc thing.

I've set the wireless_key to

wireless_key_De_Coninck="open 01234567890123456789012345"

but it gives the same as first posted then, i have to reset the key manually with iwconfig to get it working on the network.

----------

## UberLord

 *god8y wrote:*   

> 
> 
> So if i type in:
> 
> iwconfig eth1 enc 01234567890123456789012345 
> ...

 

Aha

key is the same as enc

so simply do

wireless_key_De_Coninck="01234567890123456789012345"

----------

## god8y

If I use that as setting it won't even let me connect to it, seems like it needs the word open or restricted   :Crying or Very sad: 

----------

## haven

I just wanted  to post up a quick thank-you. Last night I was running my DWL-AG650 Card under windows and I had no idea what linux wifi entailed.

Tonight I am posting this via the same laptop booted under gentoo  :Smile: 

Thanks for the very helpful information found on here combined with notes from the url below:

http://www.linuxquestions.org/hcl/showproduct.php?product=675

Now I just need to figure out WPA but that can wait until another night.

Ta once more guys.

----------

## hänse

hi

this script is great, now i can configure my various wlans easily. but i have two questions

1. where can i set the nick (like "iwconfig wlan0 nick NAME" does)

2. where can i set the timeout for scanning for network "any"

thx  :Wink: 

----------

## UberLord

 *god8y wrote:*   

> If I use that as setting it won't even let me connect to it, seems like it needs the word open or restricted  

 

If you don't specify the type (open or restricted) then the driver should make a best guess.

To clarify - it works when you do it manually?

----------

## UberLord

 *hï¿½nse wrote:*   

> hi
> 
> this script is great, now i can configure my various wlans easily. but i have two questions
> 
> 1. where can i set the nick (like "iwconfig wlan0 nick NAME" does)
> ...

 

1. In the setting wireless_config_wlan0="nick NAME"

You can also put other stuff in there like "channel 6 rate auto" for example

2. You can't set a timeout for individual ESSID's

However, you can set timeouts for

wireless_sleep_scan_wlan0       - Timeout before scanning

wireless_sleep_associate_wlan0         - Timeout to associate with an AP

If that's not enough, you can force timeouts by executing a script that just sleeps using

preifup_eth0="/run/this/script"

----------

## UberLord

 *haven wrote:*   

> Thanks for the very helpful information found on here combined with notes from the url below:
> 
> http://www.linuxquestions.org/hcl/showproduct.php?product=675

 

I doubt that my config script works with Faye's original script  :Twisted Evil: 

 *Quote:*   

> 
> 
> Now I just need to figure out WPA but that can wait until another night.

 

I don't know of anyone who's tried/tested WPA with my scripts - I don't have the hardware  :Sad: 

Lemmie know how it works out for you

 *Quote:*   

> 
> 
> Ta once more guys.

 

Welcome  :Smile: 

----------

## hänse

thx it works great   :Very Happy: 

----------

## Phylroy

I think I'm close but not quite...

I've set up the net scripts and It fails, I think at the dhcpcd part. 

I try to start the script and I get this result..

```

bash-2.05b# /etc/init.d/net.eth1 restart

 * Configuring wireless network for eth1...

 *   Connecting to "any"

 *   Connected to "USR8054"                                               [ ok ]

 * Bringing eth1 up...

 * Failed to start DHCP on eth1

```

My output from my dmesg is 

```

hub.c: new USB device 00:10.0-2, assigned address 2

usb.c: USB device 2 (vend/prod 0x77b/0x2219) is not claimed by any active driver.

usb.c: registered new driver usbvnetr

usb vendor/product=77b/2219

vnet_kernel.c: Reseting Usb Device

vnet_kernel.c: Reset completed.

Reg Domain

usbvnetr: driver version 1.0.1, compiled Mar 22 2004 19:41:48 (dbg_mask x0)

MAC addr 00:06:25:B0:99:C1 firmware 1.103.2.164

divert: allocating divert_blk for eth1

Multicast is enabled

divert: allocating divert_blk for eth1

divert: freeing divert_blk for eth1

vnetusba.c: usb eth1 initialized and registered

usbdevfs: USBDEVFS_CONTROL failed dev 2 rqt 128 rq 6 len 18 ret -6

usbdevfs: USBDEVFS_CONTROL failed dev 2 rqt 128 rq 6 len 18 ret -6

eth1: no IPv6 routers present

vnetusba.c: Device eth1 closed

```

I thought it may be an IPv6 issue...(maybe it is anyways) but I was able to connect using my wired eth0

```

eth0      Link encap:Ethernet  HWaddr 00:0C:6E:C7:FE:D3

          inet addr:192.168.123.100  Bcast:192.168.123.255  Mask:255.255.255.0

          inet6 addr: fe80::20c:6eff:fec7:fed3/64 Scope:Link

          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:2966 errors:0 dropped:0 overruns:0 frame:0

          TX packets:1240 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:100

          RX bytes:1430622 (1.3 Mb)  TX bytes:167447 (163.5 Kb)

          Interrupt:23

lo        Link encap:Local Loopback

          inet addr:127.0.0.1  Mask:255.0.0.0

          inet6 addr: ::1/128 Scope:Host

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:10 errors:0 dropped:0 overruns:0 frame:0

          TX packets:10 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:576 (576.0 b)  TX bytes:576 (576.0 b)

```

But it is strange because it picked up all my AP's information 

```

bash-2.05b# iwconfig eth1

eth1      ATMEL RFMD503A  ESSID:"USR8054"  Nickname:"USR8054"

          Mode:Managed  Channel:11  Access Point: 00:C0:49:CC:A1:94

          Bit Rate:11Mb/s

          RTS thr=65535 B   Fragment thr=65534 B

          Encryption key:off

          Link Quality:100  Signal level:5  Noise level:0

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

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

```

Any ideas?

I'm running the 2.4.22-gentoo-r7 kernel with the atmel driver.

----------

## UberLord

If you're connected to the AP ok, not getting a DHCP address really only be one of the following

1) No DHCP server available - or it's handing out conflicting IP's

2) WEP incorrect

3) MAC filtering

4) Firewall blocking DHCP

5) Signal isn't strong enough

Have you tried using a static IP and switching off WEP and MAC filtering?

----------

## god8y

Hey, 

Uberlord I think i came to a bug in the script orso, because when i set the wireless_wep_De_Coninck="open 01234567890123456789012345" It always fails for me to connect and get eth1 up, if I set it to restricted i can connect to it, but I have to reset the key again and with mode: open

any ideas?

----------

## UberLord

Don't use open or closed in the key setting and let the driver decide?

Sounds more like a driver issue to me

----------

## god8y

if I let the driver decide it keeps the same :s

dammit stupid drivers  :Smile: 

----------

## UberLord

 *god8y wrote:*   

> if I let the driver decide it keeps the same :s
> 
> dammit stupid drivers 

 

Put the command to set the key in an script file.

When you get that working, put the path to it in the setting below

wireless_preifup_ESSID=/path/to.file

Now it should work  :Smile: 

----------

## god8y

Doesn't he launch the script then before the device is up ? It has to be started after it though, I will try  :Smile: 

----------

## t_2199

Works great for me with the first try!

 THANX!

saved me alot of time

----------

## UberLord

 *t_2199 wrote:*   

> Works great for me with the first try!
> 
>  THANX!
> 
> saved me alot of time

 

Welcome  :Smile: 

----------

## Grilo

I am having some difficulty with the script/network. In windows my machine sees a very good signal and will connect disconnect off and on from the wireless network. so I moved the router and now seem to get a steady signal. with longer wires i will move it closer still. 

but in linux i have the script set up and when i boot it will not connect. but if i type everything manually into iwconfig it will connect and then disconnect and not reconnect. 

i have the line:

```
wireless_key_Biowireless="open 1453-B132-10"
```

but it will not work. if i type 

iwconfig eth1 essid Biowireless enc 1453-b132-10 it works great. but not for long. also when i try to restart the script it tells me no module was found goes on about the ndiswrapper not found and other things. i'm not using those so why would it look for them.

could it be the prism drivers?

[EDIT] ok I went through and set staic ips for the network.. seem to have a very stable connection after that. only problem is the key does not seem to work. no matter what format i put it in it does not work unless i put it in manually.

----------

## UberLord

Grilo, new script posted for you with some new stuff in

create the file /testnetkey

```

#!/bin/bash

iwconfig eth1 enc 1453-b132-10

```

Make the script executable

```

chmod +x /testnetkey

```

Use the new value in /etc/conf.d/net

```

wireless_postifup_Biowireless="/testnetkey"

```

See how that works

----------

## Grilo

ok thank you will do..

also found something else out. checked the logs to see if there were any problems. it tells me that the connection times out. i noticed in the script that there where settings for this but i do not know which aspect of the connection is timing out.

will put up an example in two seconds

----------

## iverson0881

For the WEP key putting the dashes in as well caused me all sorts of problems. Try it without the dashes.

----------

## Grilo

everything seems to work.. until a point.. then when ever i check dmesg or any logs it says tx que is full and then it times out. 

and then the iwconfig says no extentions.

any idea?

----------

## IronMan

I think I've got a basic problem trying to set up my wireless. I've loaded the madwifi and have a WG311 PCI card. When I try to do a net.ath0 start, it hangs for about a minute and I get:

```

ironring Downloads # /etc/init.d/net.ath0 start

 * Bringing ath0 up...

 * Failed to bring ath0 up                                                [ !! ] 

```

And from iwconfig and lsmod:

```

ironring Downloads # iwconfig

lo        no wireless extensions.

 

eth0      no wireless extensions.

 

ath0      no wireless extensions.

 

ironring Downloads # lsmod

Module                  Size  Used by    Tainted: P

ath_pci                31264   0

wlan                   41120   1  [ath_pci]

ath_hal               111792   1  [ath_pci]

sd_mod                 10156   0  (autoclean) (unused)

sr_mod                 12184   0  (autoclean)

vfat                    9332   1  (autoclean)

fat                    29336   0  (autoclean) [vfat]

sg                     25356   0  (unused)

ide-scsi                7536   0

usb-storage            22000   0  (unused)

scsi_mod               51764   4  [sd_mod sr_mod sg ide-scsi usb-storage]

emu10k1                51240   1

ac97_codec              9448   0  [emu10k1]

soundcore               3524   4  [emu10k1]

8139too                13992   1

mii                     2096   0  [8139too]

keybdev                 1792   0  (unused)

mousedev                3860   1

hid                     8504   0  (unused)

usbmouse                1848   0  (unused)

input                   3136   0  [keybdev mousedev usbmouse]

printer                 6592   0

```

So what am I missing?  Thanks for any leads.

--

Marc

----------

## UberLord

 *IronMan wrote:*   

> 
> 
> So what am I missing?  Thanks for any leads.
> 
> 

 

Looks like Wireless extensions aren't compiled into your kernel. You'll need to select that option, compile install and reboot with the new kernel and then re-emerge wireless-tools against it.

Or wireless-tools aren't installed to start with.

----------

## UberLord

 *Grilo wrote:*   

> everything seems to work.. until a point.. then when ever i check dmesg or any logs it says tx que is full and then it times out. 
> 
> and then the iwconfig says no extentions.
> 
> any idea?

 

Is the ath_pci module still loaded at this point?

----------

## Grilo

i built in the prism54 drivers. they seemed to work as both modules and built in.

----------

## UberLord

 *Grilo wrote:*   

> i built in the prism54 drivers. they seemed to work as both modules and built in.

 

Well, I'm guessing that it's a driver problem at this point.

Try reporting the problem to the devs

----------

## Grilo

thank you for all of your help.. this  is a great script for someone like me who has no clue about scripting and it has taught me a lot.

----------

## jmusits

I just want to say thanks to UberLord for writing such a great script.  I was just getting ready to start writing one myself when I figured I'd search the forums for any related material.  In case anyone cares the hardware I got it working under is a Netgear MA401 wireless pcmcia card.  I compiled the kernel with the patched orinoco drivers (for scanning and monitor mode) and both work great.  I am looking forward to this being included in the base-layout.  Have they given you any idea as to how long that process takes??

Jason

----------

## UberLord

 *jmusits wrote:*   

> I am looking forward to this being included in the base-layout.  Have they given you any idea as to how long that process takes??

 

I've had an ebuild stuck into portage the next day - but I wouldn't hold your breath as there's a few vying variations on wireless config/startup stuff in bugs.gentoo.org and some have been there for months

----------

## UberLord

NEW VERSIONS POSTED

ESSID is locked to the one found when it's set to "any" in the config

Hooks for running external scripts after the interface/essid has been brought up

----------

## Naughtyus

I've got your script working properly with my Belkin 54g PCMCIA card, using the linuxant drivers (thank you for the wonderful work!).  What I'd like to do is have it default to running in Ad-Hoc mode if none of the preferred essid's are found.  Is this possible?  (and how might I go about doing it if it is?)

----------

## Naughtyus

 *UberLord wrote:*   

> NEW VERSIONS POSTED
> 
> ESSID is locked to the one found when it's set to "any" in the config
> 
> Hooks for running external scripts after the interface/essid has been brought up

 

Commenting out that line in the net script makes the selection work.  :Smile: 

----------

## UberLord

 *Naughtyus wrote:*   

> I've got your script working properly with my Belkin 54g PCMCIA card, using the linuxant drivers (thank you for the wonderful work!).  What I'd like to do is have it default to running in Ad-Hoc mode if none of the preferred essid's are found.  Is this possible?  (and how might I go about doing it if it is?)

 

Possible for sure.

I don't have much time to implement it right now though - maybe sometime next week.

----------

## UberLord

 *Naughtyus wrote:*   

>  *UberLord wrote:*   NEW VERSIONS POSTED
> 
> ESSID is locked to the one found when it's set to "any" in the config
> 
> Hooks for running external scripts after the interface/essid has been brought up 
> ...

 

You mean there's a problem with my script as it stands? What is it?

----------

## Naughtyus

Err, perhaps.  I thought this was what you were commenting on just now.

If the following line is not commented out, the network thinks it is looking for an essid of 'any', and not just any old essid for me.  But commenting it out let it connect to one of my 'preferred essid's'.

```
wireless_essid_eth0="any"
```

----------

## IronMan

 *UberLord wrote:*   

> 
> 
> Looks like Wireless extensions aren't compiled into your kernel. You'll need to select that option, compile install and reboot with the new kernel and then re-emerge wireless-tools against it.
> 
> Or wireless-tools aren't installed to start with.

 

Alright, I updated the kernel to 2.6.4 with the extensions, re-emerged madwifi and wireless-tools. I'm getting closer, but no startup of ath0:

```

ironring LearnSpam # iwconfig

lo        no wireless extensions.

 

eth0      no wireless extensions.

 

ath0      IEEE 802.11  ESSID:"NETGEAR"

          Mode:Managed  Frequency:2.462GHz  Access Point: 00:09:5B:C3:04:D0

          Bit Rate:36Mb/s   Tx-Power:off   Sensitivity=0/3

          Retry:off   RTS thr:off   Fragment thr:off

          Encryption key:off

          Power Management:off

          Link Quality:36/94  Signal level:-59 dBm  Noise level:-95 dBm

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

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

 

ironring LearnSpam # ifconfig

eth0      Link encap:Ethernet  HWaddr 00:E0:7D:87:3A:F5

          inet addr:192.168.1.103  Bcast:192.168.1.255  Mask:255.255.255.0

          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:16638 errors:0 dropped:0 overruns:0 frame:0

          TX packets:12627 errors:0 dropped:0 overruns:0 carrier:0

          collisions:91 txqueuelen:1000

          RX bytes:6445415 (6.1 Mb)  TX bytes:2311726 (2.2 Mb)

          Interrupt:12 Base address:0xc000

 

lo        Link encap:Local Loopback

          inet addr:127.0.0.1  Mask:255.0.0.0

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:660 errors:0 dropped:0 overruns:0 frame:0

          TX packets:660 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:49553 (48.3 Kb)  TX bytes:49553 (48.3 Kb)

 

ironring LearnSpam # lsmod

Module                  Size  Used by

ath_pci                37904  0

wlan                   60648  2 ath_pci

ath_hal               128080  2 ath_pci

sg                     30480  0

ide_scsi               12420  0

usb_storage            26880  0

ironring LearnSpam # /etc/init.d/net.ath0 restart

 * Detecting network for ath0...                                          [ ok ] * Bringing ath0 up...

 * Failed to bring ath0 up                                                [ !! ] 

```

Where can I look for some report on why ath0 failed to come up?

Thanks.

-Marc

----------

## UberLord

 *Naughtyus wrote:*   

> Err, perhaps.  I thought this was what you were commenting on just now.
> 
> If the following line is not commented out, the network thinks it is looking for an essid of 'any', and not just any old essid for me.  But commenting it out let it connect to one of my 'preferred essid's'.
> 
> ```
> ...

 

That's correct behaviour - and it's commented out by default in my script.

----------

## UberLord

 *IronMan wrote:*   

> 
> 
> ```
> 
> ironring LearnSpam # /etc/init.d/net.ath0 restart
> ...

 

That output doesn't look like it's my script. Could you verify that it is?

----------

## HunterD

I haven't read the last pages but this script works with the intel prowireless 2100 ??

----------

## wallyn

I start my gentoo, it loads usb driver(leds start blink), but net.eth2 can't bring up. After login I write "/etc/init.net.eth2 restart" - eth2 bring up and network works.

I tried some scripts from this forum, but no changes.

Or - I add "/etc/init.d/net/eth2 restart" into /etc/conf.d/local.start" - no change - during starting gentoo it writes that it can't bring up eth2 during network starting and during local starting=twice.

Can anyone help?

thx

----------

## UberLord

 *HunterD wrote:*   

> I haven't read the last pages but this script works with the intel prowireless 2100 ??

 

It works with any wireless card that has working linux drivers or the windows drivers work with ndiswrapper  :Smile: 

----------

## UberLord

What service brings up your usb - hotplug?

----------

## wallyn

I don't know...

But if I start my computer, it shows error messages like was witten... If I restart computer and if eth2 was up, it connects to network without errors. Eth2 brings up...

----------

## UberLord

Try increasing the value of wireless_sleep_scan_eth2

----------

## IronMan

 *UberLord wrote:*   

> 
> 
> That output doesn't look like it's my script. Could you verify that it is?
> 
> 

 

Looks like it wasn't. Sorry - with all the playing around, I don't know where that one came from. But when using the real thing, still no success:

```

ironring Downloads # /etc/init.d/net.ath0 restart

 * Configuring wireless network for ath0...

 *   Scanning for access points

 *     Found "NETGEAR"

 *   Connecting to "NETGEAR"                                              [ ok ] * Bringing ath0 up...

 * Failed to start DHCP on ath0                                           [ !! ] 

```

So something is messed up with DHCP.  When I give ath0 a static address, I get an ok on bringing up ath0 right away, but I can't ping anything on the network. iwconfig says:

```

ironring Downloads # iwconfig

lo        no wireless extensions.

 

eth0      no wireless extensions.

 

ath0      IEEE 802.11  ESSID:"NETGEAR"

          Mode:Managed  Frequency:2.462GHz  Access Point: 00:09:5B:C3:04:D0

          Bit Rate:36Mb/s   Tx-Power:50 dBm   Sensitivity=0/3

          Retry:off   RTS thr:off   Fragment thr:off

          Encryption key:off

          Power Management:off

          Link Quality:38/94  Signal level:-57 dBm  Noise level:-95 dBm

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

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

```

So I'm reaching the access point, it seems. Just not communicating with the network.

-Marc

----------

## UberLord

Do you have MAC filtering on the AP? And I can assume that you aren't using WEP either?

Does the output from ifconfig report any errors?

----------

## IronMan

 *UberLord wrote:*   

> Do you have MAC filtering on the AP? And I can assume that you aren't using WEP either?
> 
> Does the output from ifconfig report any errors?

 

Nope on all questions. ifconfig reports:

```

ath0      Link encap:Ethernet  HWaddr 00:09:5B:92:1F:68

          inet addr:192.168.1.150  Bcast:192.168.1.255  Mask:255.255.255.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:327 errors:5 dropped:0 overruns:0 frame:5

          TX packets:26 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:199

          RX bytes:26289 (25.6 Kb)  TX bytes:1289 (1.2 Kb)

          Interrupt:11 Memory:d2910000-d2920000

 

```

And last, but not least, these are my wireless settings:

```

##############################################################################

#                             Wireless settings                              #

##############################################################################

 

# Hard code an ESSID to an interface

# This needs to be done when the driver doesn't support scanning

# Set to "any" to connect to any ESSID

# This may work for drivers that don't support scanning but you need automatic AP association

#wireless_essid_ath0="any"

 

# Set the mode of the interface. Managed is default

#wireless_mode_ath0="Managed"

 

# Setup any other config commands. This is basically the iwconfig argument

# without the iwconfig $iface

#wireless_config_ath0=""

 

# Set private driver ioctls. This is basically the iwpriv argument without

# the iwpriv $iface

#wireless_priv_ath0=""

 

# Some drivers need to scan in Ad-Hoc mode

# After scan, the mode is reset to the one defined above

#wireless_scan_mode_ath0="Ad-Hoc"

 

# We can define various timeouts in seconds here

wireless_sleep_scan_ath0="1"

wireless_sleep_associate_ath0="5"

 

# Below you can define private ioctls to run before and after scanning

# Format is the same as the wireless_priv above

# This is needed for the HostAP drivers

#wireless_priv_scan_pre_ath0="host_roaming 2"

#wireless_priv_scan_post_ath0="host_roaming 0"

 

# Define a WEP key per ESSID

# IMPORTANT: any characters that are NOT in a_z A_Z 0_9 should be

# replaced with the _ character. For example #123 becomes _123

# wireless_key takes the same parameters as the key function in iwconfig

# You can also set iface, dhcpcd and gateway options per ESSID

# If they aren't set then the defaults for the interface are used

# IMPORTANT: don't set an interface for wireless gateway - just use an IP address

# The below examples use ESSID - change it to yours.

# You can't use "any" for an ESSID here

#wireless_key_ESSID="open 1234-1234-1234-1234-1234-1234-56"

# or you can use strings. Passphrase IS NOT supported

#wireless_key_ESSID="open s:foobar"

 

# You can also override the interace settings here - even provide

# a nameserver/domain per ESSID

#wireless_iface_ESSID="dhcp"

#wireless_dhcpcd_ESSID="..."

#wireless_gateway_ESSID="192.168.0.1"

#wireless_nameserver_ESSID=""

#wireless_domain_ESSID=""

 

# LEAP users will want to use the preassociate setting to specify

# an authentication script

#wireless_preassociate_ESSID="/run/this/script"

#wireless_preifup_ESSID="/run/this/script"

#wireless_preifdown_ESSID="/run/this/script"

#wireless_postifup_ESSID="/run/this/script"

#wireless_postifdown_ESSID="/run/this/script"

 

# This lists the preferred ESSIDs to connect to in order

# ESSID's can contain any characters here as they must match the broadcast

# ESSID exactly

# Seperate the ESSIDs with tabs - NOT spaces

# If the first ESSID isn't found then it moves onto the next

# If this isn't defined then it connects to the first one found

#wireless_preferred="ESSID1     ESSID2  ESSID3  ESSID4"

 

```

----------

## UberLord

Sorry - I can't think of any ideas at this time expect trying to move closer to the AP.

I know my madwifi drivers on my netgear w311 card give me problems with connection dropping, but I do know it does connect. And I can't see anything wrong with your config  :Sad: 

----------

## UberLord

NEW VERSIONS POSTED

Can drop into Ad-Hoc mode when it cannot associate with any APs

This is configured by specifying an ESSID for Ad-Hoc mode (seperate from forcing ad-hoc mode) and a channel. The rest of the setup (WEP, iface, dhcp, etc) is setup in the same way as for an ESSID.

Ad-Hoc now requires a channel to be specified.

----------

## IronMan

 *UberLord wrote:*   

> Sorry - I can't think of any ideas at this time expect trying to move closer to the AP.
> 
> 

 

Thanks for all the help so far, Mr. Lord. You've helped me get much closer than I was. I think I'll start a new thread to see if some other eyes might get attracted.

One other thing I might try, if it makes sense - So far I've only been unplugging the ethernet cable to see if I can communicate on wireless. Would it make sense to stop the eth0, or disable it some other way? Also, could there be some conflict between my LAN card and the WG311? Just a thought.

Thanks again.

-Marc

----------

## UberLord

 *IronMan wrote:*   

>  *UberLord wrote:*   Sorry - I can't think of any ideas at this time expect trying to move closer to the AP.
> 
>  
> 
> Thanks for all the help so far, Mr. Lord. You've helped me get much closer than I was. I think I'll start a new thread to see if some other eyes might get attracted.
> ...

 

If they're on the same subnet then ....... yes   :Confused: 

Try stopping all other net scripts except for net.lo ....... then try starting up your wireless

----------

## TheHobbit

Just thought I'd add a "it works for me" reply so anyone with similar setup knows  :Smile: 

DLink DWL-G650/S in a Thinkpad R40, Gentoo Linux with 2.6 headers and 2.6.4 kernel, with the madwifi stuff.... downloaded UberLord's init and config script and all works well with either the SonicWall at work (no wep etc), or with the DWL-2100AP+ I have at home (128 bit wep).

If I've missed anything regarding my config, gimme a shout and I'll add it.

Thanks UberLord....

TheHobbit

----------

## robpatriot

First of all thanks uber for a great script.  Worked mostly out of the box for me except one thing (that I think might have nothing to do with your script).  When I used the standard gentoo net.eth1 script my pcmcia WG511 card would be working by the time I was logging in.  However with your new script (and only that change) I have to remove the card and plug it in to get it to init.  Does anyone have any idea why that might be so?  I tried putting net.eth1 into my boot runlevel and that worked but then I guess it is going to have a fit if I don't have the card plugged in at startup (I didn't have it in the boot runlevel with the standard gentoo script).

I am using autoload to get pcmcia_core and yenta_socket and the likes loaded and then running hotplug and using prism54 driver.

Cheers,

R.

----------

## UberLord

 *robpatriot wrote:*   

> However with your new script (and only that change) I have to remove the card and plug it in to get it to init.  Does anyone have any idea why that might be so?  I tried putting net.eth1 into my boot runlevel and that worked but then I guess it is going to have a fit if I don't have the card plugged in at startup (I didn't have it in the boot runlevel with the standard gentoo script).

 

I'm guessing it's because pcmcia is calling net.eth1 before hotplug can insert the module. Ensure that hotplug loads before pcmcia does. I think you need hotplug and pcmcia in the default run level.

If that fails, write a small shell script like so

```

#!/bin/sh

modprobe prism54
```

And set the preifup_eth1="/run/this/script" flag to the location of the script

Remember to make the script executable (chmod /path/to/script +x)

EDIT: Not sure of the module name

If there's any firmware to be loaded - if so then it needs to be loaded in that script as well.

----------

## robpatriot

Man uber your a one man army?  Are you determined to single handedly get everyone on the planet working happily with wireless??  :Smile: 

Anyway.  I did what you said (before you put the edit in your last post) and nothing changed so I decided to get the latest hotplug from gentoo.  Big mistake!  :Smile:   I now can't get the card to respond at all even with the original net and net.eth1 scripts.  Therefore I have a new problem to deal with.  I'll be back with this topic when I have a working card at all!  :Sad: 

For your interest my card was working perfectly with the instructions here:

http://prism54.org/forums/viewtopic.php?p=2469#2469

which don't use pcmcia (as in cardmgr) at all, as in the service isn't even started and the modules are loaded by autoload.  

EDIT: When I said "the modules are loaded by autoload" I mean pcmcia_core and yenta_socket.  P.S I got problems with hotplug and pcmcia arguing if they were both running at the same time...

R.

----------

## robpatriot

This is going to be a hard day I can tell.  It seems that now the new hotplug is never triggering an event on card insertion so I can bring the card up fine with your script, just can't do it automatically.  Now I am wondering if its because the gentoo guys spotted the troubles I was having with pcmcia and hotplug arguing over controlling the WG511.  Therefore I am going to play some more.  However the practical upshot is I am no longer having any problems with anything to do with your script!  :Smile:  Once again THANK YOU very much for you effort and certainly from me it is much appreciated!

R.

----------

## UberLord

 *robpatriot wrote:*   

> Man uber your a one man army?  Are you determined to single handedly get everyone on the planet working happily with wireless?? 

 

Pretty much  :Smile: 

As an idea, why not let hotplug manage everything? Try removing pcmcia from startup and see what happens.....

----------

## robpatriot

Actually (I realise I can be hard to understand in written form) that is the situation I have always been in.  I only get autoload to load pcmcia_core and yenta_socket to literally provide drivers for the pcmcia controller.  Other than that everything is done by hotplug.  It was working.  Then I tried your script and it worked except at bootup, then I upgraded to the latest hotplug and now it doesn't work at all unless I manually run /etc/init.d/net.eth1 start.

I am thinking that as they have obviously done something in hotplug I might try putting pcmcia (the full thing including cardmgr) back in and seeing how I get on...

----------

## diastelo

In your latest version of the script, I noticed a small typo on line 20. You transposed 0 and =.

Thanks for this awesome script! All I had to change were the instances of eth0 to something else to keep it from conflicting with my regular ethernet connection and all was well.

For those interested, I'm using the prism54 driver, with SID broadcasting disabled.

----------

## UberLord

 *diastelo wrote:*   

> In your latest version of the script, I noticed a small typo on line 20. You transposed 0 and =.

 

Fixed - thanks for pointing that out  :Smile: 

EDIT: It was the config script, not the net.eth0 script so you don't need to re-download.

 *Quote:*   

> 
> 
> Thanks for this awesome script! All I had to change were the instances of eth0 to something else to keep it from conflicting with my regular ethernet connection and all was well.
> 
> 

 

Well, I decided to default to eth0, as thats the name of the script. Defaulting to eth1 would be pointless for some as their wifi connection is wlan0, ath0 or something else

----------

## nickrout

uberlord, i cannot seem to download your scripts. Is there a problem at your end? will try again tomorrow.

----------

## drdebian

 *jmusits wrote:*   

> I just want to say thanks to UberLord for writing such a great script.  I was just getting ready to start writing one myself when I figured I'd search the forums for any related material.  In case anyone cares the hardware I got it working under is a Netgear MA401 wireless pcmcia card.  I compiled the kernel with the patched orinoco drivers (for scanning and monitor mode) and both work great.

 

I'm wondering whether it is possible to change the naming used by cardmgr when a PCMCIA NIC is inserted. For instance, I'd like the NIC to be called "wlan0" instead of the next free "eth?".

----------

## Naughtyus

;( Download links aren't working for me.

----------

## UberLord

Sorry - had a power cut whilst I was away  :Sad: 

BTW, I'm working on a new version that plugs into the new net.eth0 script in unstable baselayout. Hopefully available sometime this week  :Smile: 

----------

## UberLord

 *drdebian wrote:*   

> 
> 
> I'm wondering whether it is possible to change the naming used by cardmgr when a PCMCIA NIC is inserted. For instance, I'd like the NIC to be called "wlan0" instead of the next free "eth?".

 

You would have to hack the kernel driver module for your card as that's what decides the name.

----------

## xyberpix

Hi UberLord,

Got my wireless card running this weekend, and have been hunting high and low for something like this, but I just have a couple of questions that I'm hoping you can help me out with. If needbe I can mail you instead on this. Here they are:

- Looking through this forum, I get kinda lost, so here's what I want to know, how do I implement the scripts?

- Do I just copy them from page 1 of this forum, to my local box, and then modify them accordingly? And all should work when I reboot? As at the moment, my wireless works great, but if I reboot, I loose all my settings.

- Is there a HOWTO implement these scripts anywhere online that i can refer to?

I am using a Linksys WPC54G with ndiswrapper

TIA

xyberpix

----------

## UberLord

 *xyberpix wrote:*   

> 
> 
> - Looking through this forum, I get kinda lost, so here's what I want to know, how do I implement the scripts?
> 
> - Do I just copy them from page 1 of this forum, to my local box, and then modify them accordingly? And all should work when I reboot? As at the moment, my wireless works great, but if I reboot, I loose all my settings.

 

Yes, simply copy them.

You then modify the /etc/conf.d/net file and put your wireless settings in the right places - hopefully my comments in that file will guide you.

 *Quote:*   

> 
> 
> - Is there a HOWTO implement these scripts anywhere online that i can refer to?
> 
> 

 

For these scripts? No - just this thread.

The new version I'm working on for the new base layout in unstable will have a howto and stuff.

----------

## xyberpix

Thanks for the prompt answer, really appreciate it.

One last thing, my wireless card shows up as wlan0, so would I rename the one script to eth.wlan0 and then change all other instances of eth0 to wlan0?

TIA

xyberpix

----------

## UberLord

NEW VERSIONS POSTED FOR UNSTABLE BASELAYOUT

I've got scripts for unstable baselayout (1.8.9) posted now. Checkout the 1st page post.

You have to change your config file for this to work.

----------

## UberLord

 *xyberpix wrote:*   

> Thanks for the prompt answer, really appreciate it.
> 
> One last thing, my wireless card shows up as wlan0, so would I rename the one script to eth.wlan0 and then change all other instances of eth0 to wlan0?
> 
> TIA
> ...

 

You should always have an net.eth0 script really

I would make a symlink from net.eth0 to net.wlan0

```

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

```

----------

## UberLord

Ebuild posted for easy installation. Requires baslayout>=1.8.8

Check 1st page for linkage

Gimmie feedback on this please  :Smile: 

----------

## Plastic

Your ebuild doesn't work. When I try to digest it, I get a 404.

----------

## UberLord

Posted a new ebuild

----------

## UberLord

Uh - one thing about this ebuild.

Please ensure that the /etc/conf.d/net.eth0 is one from baselayout>=1.8.7

Symlink all net.xxx scripts to that

Also ensure that /etc/conf.d/net has no wireless settings in as they have been moved into /etc/conf.d/wireless AND (just to really annoy everyone) I've removed the wireless_ prefix from them.

This makes things easier  :Smile: 

----------

## fredrin

How do i actually run this ebuild? I've just used ebuilds from the gentoo portage tree. 

-f-

----------

## UberLord

 *fredrin wrote:*   

> How do i actually run this ebuild? I've just used ebuilds from the gentoo portage tree. 
> 
> -f-

 

There's a document around somewhere - anyways, here's the shimmy

edit /etc/make.conf and enable the PORTDIR_OVERLAY to point to /usr/local/portage

create /usr/local/portage/net-wireless/wireless-config

put the ebuild there

do the following

```

ebuild /usr/local/portage/net-wireless/wireless-config/wireless-config-0.2.ebuild fetch digest
```

Now you can emerge it as normal  :Smile: 

```
emerge -pv wireless-config
```

Be warned though, there's a typo in the current version - I'll be posting a new one soon.

----------

## fredrin

That was fast, thanks man!

-f-

----------

## fredrin

I did not make it work  :Sad: 

This is what i did:

```

root@gentooNorm net-wireless # ebuild /usr/local/portage/net-wireless/wireless-c                                                                 

onfig/wireless-config-0.2.ebuild fetch digest

>>> Downloading http://rsm.demon.co.uk/~roy/downloads/wireless-config-0.2.tar.bz                                                                 

2

--22:42:02--  http://rsm.demon.co.uk/%7Eroy/downloads/wireless-config-0.2.tar.bz                                                                 

2

           => `/usr/portage/distfiles/wireless-config-0.2.tar.bz2'

Resolving rsm.demon.co.uk... 80.177.174.176

Connecting to rsm.demon.co.uk[80.177.174.176]:80... connected.

HTTP request sent, awaiting response... 200 OK

Length: 4,670 [application/x-tar]

100%[====================================>] 4,670         --.--K/s             

22:42:02 (36.35 KB/s) - `/usr/portage/distfiles/wireless-config-0.2.tar.bz2' sav                                                                 

ed [4670/4670]

--- No package manifest found: /usr/local/portage/net-wireless/wireless-config/M                                                                 

anifest

!!! No package digest file found: /usr/local/portage/net-wireless/wireless-confi                                                                 

g/files/digest-wireless-config-0.2

!!! Type "ebuild foo.ebuild digest" to generate it.

root@gentooNorm net-wireless # emerge -pv wireless-config

These are the packages that I would merge, in order:

Calculating dependencies ...done!

[ebuild  N    ] net-wireless/wireless-config-0.2   [empty/missing/bad digest] [1                                                                 

] 

Total size of downloads: 0 kB

Portage overlays:

 [1] /usr/local/portage

root@gentooNorm net-wireless # emerge -v wireless-config

Calculating dependencies ...done!

>>> emerge (1 of 1) net-wireless/wireless-config-0.2 to /

--- No package manifest found: /usr/local/portage/net-wireless/wireless-config/M                                                                 

anifest

!!! No package digest file found: /usr/local/portage/net-wireless/wireless-confi                                                                 

g/files/digest-wireless-config-0.2

!!! Type "ebuild foo.ebuild digest" to generate it.

root@gentooNorm net-wireless # pwd

/usr/local/portage/net-wireless

```

-f-

----------

## fredrin

Sorry, my fault. Now it works!

-f-

----------

## UberLord

NEW EBUILD POSTED

Fixes a few problems

@fredrin

```

ebuild /usr/local/portage/net-wireless/wireless-config/wireless-config-0.2.1.ebuild fetch

ebuild /usr/local/portage/net-wireless/wireless-config/wireless-config-0.2.1.ebuild digest

```

Try that

----------

## iverson0881

Hmm ok. You need to tell us to symlink our /etc/init.d/net.ath0 (or whatever you have) to /etc/init.d/net.eth0 in the ebuild. Also you spelled wireless wrong   :Laughing: 

thanks Uberlord

iverson0881

----------

## UberLord

 *iverson0881 wrote:*   

> Hmm ok. You need to tell us to symlink our /etc/init.d/net.ath0 (or whatever you have) to /etc/init.d/net.eth0 in the ebuild.

 

I thought that was in the Gentoo installation instructions?

I suppose a small note won't hurt

 *Quote:*   

> 
> 
> Also you spelled wireless wrong  
> 
> 

 

Where?

----------

## cbradney

It all seems broken with the new baselayout. Gentoo bug is 47618. I was on baselayout 1.8.6.13 and wirless works fine on the laptop with the old style config.

I tried baselayout 1.8.10 stable last night and all things went wrong. This morning I've put in the new baselayout, done the new wireless-config ebuild stuff and configured it all. I still get a whole lot of depscan errors relating to dependencies, eg checkroot depended on by domainname etc.

Right now I've switched the laptop back to baselayout 1.8.6.13 and will stay with that until a new baselayout is released. 

Thanks for your efforts on this stuff. Hoefully it works here with new baselayout soon.

----------

## robpatriot

I posted a little while ago but let me spell this out.  I am using modules.autoload to load the drivers I need to get my pcmcia controller working.  Therefore I have no installation of anything to do with pcmcia-cs, just compile them into kernel with yenta_socket.  I had some problems with ubers script and this setup.  However I just got latest baselayout (1.8.10) and latest hotplug (20040401) and then got your ebuild and used it and now everything works better than I have EVER had wireless working under gentoo (in fact on any distro).  It all works out of the box and with minimal effort from me.  Thanks uber you are a total star.  

I will monitor these forums for a while if anyone wants me to try and help with any problems they have (although I can't claim to be a lot of help)...

Thanks uber.

R.

----------

## UberLord

Why don't you try the baselayout-1.8.10 by itself? Use it's /etc/conf.d/net and /etc/init.d/net.eth0.

If that works without depscan errors, then try my ebuild. Do not use the old net.eth0 script that I make - it's no longer used. Instead I supply wireless.sh which hooks into the Gentoo net.eth0 script.

----------

## cbradney

If thats for me:

(from my posting to the bug 47618)

Ok, just tried removing the pcmcia card and activating the module for the laptops inbuilt network card in modules.autoload.d/kernel-2.6. With all standard init.d files, I still get a mess of depend errors on startup. eg checkroot/domainname and clock needed by syslog-ng etc. Network is disabled even though it says it brings up the network and notes the address. net.eth0 is said to be started by rc-status

----------

## UberLord

If you unmerge wireless-config, do you still get depscan errors?

----------

## cbradney

Hmm duh..

ok.. unmerged it, and I removed the wireless includes from /etc/conf.d/net and ran /sbin/depscan.sh and I still get dependancy errors shown although the builtin wired prism54 card as net.eth0 is up and is able to see the world.

----------

## dopey

The errors aren't the wireless-config problem.

There's two potential issues that cause this:

https://bugs.gentoo.org/show_bug.cgi?id=47111

or

https://bugs.gentoo.org/show_bug.cgi?id=46954

It'll depend on the types of errors you get. I posted an explanation of what causes each type of message in the appropriate bugs.  AT least for what causes it for me  :Smile:    YMMV

----------

## UberLord

Thanks dopey - good to know that my scripts aren't the cause  :Smile: 

----------

## cbradney

Yes.. ok.. I did a quick scan and decided to build the wireless card driver into the kernel, reemerged the new baselayout and the wireless-config and it now all seems to boot with no errors.  :Smile:   :Smile:   :Smile:   :Smile:   :Smile: 

SO.. we can probably say it is hotplug.. or module loading (I got the dependency errors with the inbuilt card too, is hotplug involved there?)

Ive also tried my usb connected camera for fun and it work either on plugging in/plugged in on bootup (but its all SCSI builtin stuff).

Can someone then suggest how to config the system so I can have both the inbuilt natsemi n/w card and pcmcia prism54 n/w card enabled in kernel and either or both will work? What I was doing before was switching them on/off in /etc/modules.autoload.d/kernel-2.6.

----------

## UberLord

 *cbradney wrote:*   

> Can someone then suggest how to config the system so I can have both the inbuilt natsemi n/w card and pcmcia prism54 n/w card enabled in kernel and either or both will work? What I was doing before was switching them on/off in /etc/modules.autoload.d/kernel-2.6.

 

If everything is compiled in then you don't need anything in /etc/modules.autoload.d/kernel-2.6

pcmcia cardmgr will load the correct modules if needed

For my lappy, I have everything compiled into the kernel that I need - including the drivers for my pcmcia wifi card. I have nothing in the autload for my kernel.

----------

## cbradney

Yes, I realise i dont need anything in kernel-2.6, but I was using the two drivers, loaded as modules so I could switch between plugged into the network here (100mbps) and on the move with the wireless (up to 54mbps). 

I didnt know where to find out how to config both network cards built in as net.eth0 and net.eth1 I guess and possibly have both active when Im at the desk, or just the cabled adaptor, and then just have the wireless active when Im not plugged into the network.

I normally prefer to have things built in, hence the other 3 machines dont see this problem with the new baselayout.

----------

## UberLord

What you need is ifplugd which will start and stop hardwired ethernet connections when the cable is plugged in or taken out. So there's no need to add it to the default runlevel.

For pcmcia, the net.eth1 script will be started and stopped in the same manor by the pcmcia cardmgr.

So using the above, things should start and stop when required with no configuration changes needed  :Smile: 

----------

## cbradney

Thanks heaps.. Ill invesigate. Thanks again for your work on the wireless-config stuff.. Hopefully it makes it into portage soon!

----------

## UberLord

 *cbradney wrote:*   

> Hopefully it makes it into portage soon!

 

I'll submit it to the Gentoo devs after a week or so without any changes.

Now it's an ebuild and seperate from the Gentoo scripts I can't see any reason why they won't accept it.

----------

## iverson0881

 *UberLord wrote:*   

>  *iverson0881 wrote:*   Hmm ok. You need to tell us to symlink our /etc/init.d/net.ath0 (or whatever you have) to /etc/init.d/net.eth0 in the ebuild. 
> 
> I thought that was in the Gentoo installation instructions?
> 
> I suppose a small note won't hurt
> ...

 

At the end of the ebuild where it gives you instructions on what to do. I think its one of the last lines in that.

Ok here 

```

   einfo "3. Edit the wirless configuration file"

```

----------

## UberLord

I'll fix that for the next version

----------

## sjprice

need some help...first of all, im new to Linux and had Gentoo exactly 2 days. Read all 19 pages of this to understand this better, but I cant get the ebuild to emerge. Followed Ubers directions, creating the directories, moving the ebuild, doing the fetch and digest. But when I do the emerge wireless-config, i get "error calculating dependencies. Please correct." I emerged wireless-tools, but the base layout-1.8.7 im not sure about. How do I check? Any ideas?

----------

## UberLord

Ensure that your portage tree is uptodate as baselayout 1.8.10 hit stable yesterday.

----------

## UberLord

NEW EBUILD RELEASED

Fixed Ah-Hoc mode not starting correctly when Managed fails.

WEP status is now reported for each connection attempt

Added predown() function to the patch. Not really necessary, but it kinda makes sense

Stuck some checking into wireless_down()

Now load /etc/conf.d/wireless via /etc/init.d/wireless.sh - this means you can remove that line from /etc/conf.d/net if you want. Things won't break if you leave it there.

Bumped dependancy on baselayout to 1.8.11 as it hit stable

----------

## Moofed

I just updated to the latest version and the script doesnt seem to attempt connection to prefered access points before the neighbors' AP. It doesn't appear to matter if my AP is broadcasting its name or not. Am I correct, or have I messed up the new config files?

----------

## pumbaa

Hy Uberlord, thanks again for your work!

Wireless (again) worked just right out of the box.

I still have one question:

 *UberLord wrote:*   

> 
> 
> ```
> emerge -u net-wireless/wireless-config
> ```
> ...

 

told me that I had to (r)emerge some files (total about 100MB) ... just doing without the -u also worked, and just emerged one file ...

Was that a bad idea?

I'm still not quite satisfied with my knowledge of the -u option of emerge --- I read many posts, and there seem to be quite different opinions about w/o using -u when emerging ...

thx, pumbaa

----------

## Ronald Hummelink

Uberlord, rock on for your work, hopefully the stuff can be integrated sometime into baselayout itself (wireless is getting widespread enough)

Need this small patchlet to detect more then the last listed AP

without the patch it connects to my neighbours AP and doesn't 'detect' my own -- prolly need same fix for dlpierce):

```

--- wireless.sh.orig    2004-04-16 10:10:14.000000000 +0200

+++ wireless.sh 2004-04-17 12:35:00.786073288 +0200

@@ -270,8 +270,10 @@

        local APs="$(echo ${scan_IFACE} | gawk -F: '/ESSID/ {print $2}')"

        local IFS=$'\n'$'\t'

        local AP

+       local i=0

        for AP in ${APs}; do

                scan_APs[i]=${AP}

+               i=$(($i+1))

        done

 }

```

----------

## UberLord

NEW EBUILD POSTED

Added Ronald Hummelink's patch.

Thanks - I only have 1 AP to test against at the moment. I don't think wireless will be integrated in the baselayout scripts, but I have hopes that this ebuild will get into portage  :Smile: 

----------

## UberLord

 *dlpierce wrote:*   

> I just updated to the latest version and the script doesnt seem to attempt connection to prefered access points before the neighbors' AP. It doesn't appear to matter if my AP is broadcasting its name or not. Am I correct, or have I messed up the new config files?

 

If the new ebuild doesn't work then post up your config and script output.

Thanks!

----------

## UberLord

 *pumbaa wrote:*   

> 
> 
> I still have one question:
> 
>  *UberLord wrote:*   
> ...

 

I've updated my instructions and omitted the -u option.

Dunno why I put it in really

----------

## Axeman45

Hi,

I've read this thread from cover to cover but I'm still missing something.

I have a built-in ethernet NIC with the driver in kernel and loading at default runlevel as net.eth0. I have my wireless NIC (built-in MPCI) running using ndiswrapper and setting up parameters manually with iwconfig.

I have emerged wireless-config-0.2.3 and baselayout 1.8.11 as of 17 April 2004.

Then I edited /etc/init.d/wireless to match the parameters I had manually used in iwconfig. Added iface_wlan0="dhcp" to /etc/conf.d/net, as this is what ifconfig shows my wireless NIC to be called.

Finally, I set up a symbolic link from /etc/init.d/net.wlan0 to net.eth0

Q.: Is this the whole procedure or does anything else still have to be done?

There have been posts about copying the wireless.sh script to "ath0" and adding it with rc-update, but I get dependancy errors at boot (even after running depscan.sh) I also saw posts with "wireless_essid_..." entried in the /conf.d/net file, but there are no such entries in the one I have...

Any help would be greatly appreciated.

----------

## UberLord

 *Axeman45 wrote:*   

> 
> 
> Finally, I set up a symbolic link from /etc/init.d/net.wlan0 to net.eth0
> 
> Q.: Is this the whole procedure or does anything else still have to be done?
> ...

 

You should set a symbolic link from net.eth0 to net.wlan0, not the other way around.

 *Quote:*   

> 
> 
> There have been posts about copying the wireless.sh script to "ath0" and adding it with rc-update, but I get dependancy errors at boot (even after running depscan.sh) I also saw posts with "wireless_essid_..." entried in the /conf.d/net file, but there are no such entries in the one I have...
> 
> 

 

That was the old script I made for the old baselayout.

The new baselayout net.eth0 script allows for plugins - in this case wireless.sh

If you followed the ebuild instructions, you have a patched /etc/conf.d/net with a preup function. Now you just have to edit /etc/conf.d/wireless to finalise your settings.

Then you're good to go!

If you replaced the net.eth0 script with something else, then you may have to re-emerge baselayout to get it back again.

HTH

----------

## cbradney

Hmm.. is the 0.23 ebuild being replaced or is the link broken?

----------

## Gatak

I just made a new initscript called wireless:

```
!/sbin/runscript

# Setting Wireless LAN configuration

depend() {

        use hotplug pcmcia

}

start() {

        ebegin "Setting Wireless LAN Configuration"

        /usr/sbin/iwconfig eth1 power on essid home ap any mode Ad-Hoc >/dev/null

        eend 0

}

stop() {

        ebegin "Stopping Wireless LAN Configuration"

        eend $? "Failed to stop Wireless LAN Configuration."

}
```

Then I added the wireless script as a dependency to net.eth0:

```
depend() {

        use hotplug pcmcia wireless

}
```

Then I simply added a link net.eth1 to net.eth0 and ran:

```
rc-update add wireless default

rc-update add net.eth1 default
```

To get some info about the varios options I set with iwconfig you can do a "man iwconfig"

• essid: The ESSID is used to identify cells which are part of the same virtual network. I chose "home" for my home network.

• mode: Set the operating mode of the device, which depends on the network topology. Ad-Hoc is a network without access-points.

• ap: Force  the  card  to  register  to the Access Point given by the address, if it is possible. Any lets the card choose the best access-point, if awailable.

• power: Switches the power to the card. It must be on to funtion.

----------

## UberLord

 *cbradney wrote:*   

> Hmm.. is the 0.23 ebuild being replaced or is the link broken?

 

Sorry - apache died for some reason. Should be working now.

----------

## denials

Right on, I've got it working -- thanks Uber!

A correction for your main post: 

* change PORTAGE_OVERLAY to PORTDIR_OVERLAY

And a suggestion: simplify the make directory commands by using the -p option to create the entire directory tree at once. So instead of:

```
mkdir /usr/local/portage

cd /usr/local/portage

mkdir net-wireless

mkdir net-wireless/wireless-config
```

You can boil it down to just:

```
mkdir -p /usr/local/portage/net-wireless/wireless-config
```

One command = fewer opportunities for typos.

----------

## Moofed

 *UberLord wrote:*   

>  *dlpierce wrote:*   I just updated to the latest version and the script doesnt seem to attempt connection to prefered access points before the neighbors' AP. It doesn't appear to matter if my AP is broadcasting its name or not. Am I correct, or have I messed up the new config files? 
> 
> If the new ebuild doesn't work then post up your config and script output.
> 
> Thanks!

 

Using 0.2.3 now.  Uncommented contents of /etc/conf.d/wireless:

```

key_The_Upstairs="open xxxxxxxxxxxxxxxxxxxxxxxxxx"

preferred_aps=("The Upstairs" "IU Wireless")
```

Before, I had 'Allow Broadcast Of Name (SSID)' and 'Allow Access From "Any" Name' turned off on my AP.  This worked with the older scripts, but I think the new ones only try to connect to prefered APs if they find that ESSID during scanning or if no other APs are found at all.  Turning on the said options fixes this, but leaves the wlan slightly more insecure.  Not a big deal with WEP and MAC filtering, but still a feature to support.  Maybe making a 'hidden' flag for preferred,nonbroadcasting, APs would be desireable.

----------

## UberLord

 *denials wrote:*   

> Right on, I've got it working -- thanks Uber!
> 
> A correction for your main post: 
> 
> * change PORTAGE_OVERLAY to PORTDIR_OVERLAY
> ...

 

Changed!

Learn something new everyday  :Smile: 

----------

## UberLord

 *dlpierce wrote:*   

> Using 0.2.3 now.  Uncommented contents of /etc/conf.d/wireless:
> 
> ```
> 
> key_The_Upstairs="open xxxxxxxxxxxxxxxxxxxxxxxxxx"
> ...

 

I'll see if I can setup a test environment to replicate the problem.

----------

## Helena

Ok I must admit feeling a litle sheepish because I gan´t get it working... Let me describe the situation. I´ve got a laptop with a 802.11g OEM card, based on the TI 1130 chipset (as I found out later). Under Windows no problem because a driver was supplied. Now onto Linux.

Just to understand what need to be done I listed a few basic steps.

1. Make sure the wireless card is visible on the PCI bus (trivial, but necessary).

Mine is a PCMCIA card, so it's nicely listed on bus #2 (even without the pcmcia service I think, but of course PCMCIA support was compiled into the kernel).

2. Obtain a driver.

This is more difficult, since it's not supported by a kernel driver. I'm trying to use ndiswrapper now. So far, the driver is shown as "present, fuzzy" by ndiswrapper; hopefully this means it'll work.

3. Configure the wireless network interface.

Of course I'm trying to use your script. I've just emerged the latest version and followed the instructions.

I'm missing a few points here probably, and that may be the reason why it's not working yet...

```
 * Running preup function

 *   Wireless extensions not found for wlan0

 * Bringing wlan0 up (192.168.1.156)...

SIOCSIFADDR: No such device

wlan0: unknown interface: No such device

SIOCSIFBRDADDR: No such device

wlan0: unknown interface: No such device

SIOCSIFNETMASK: No such device                                            [ !! ]
```

My /etc/conf.d/wireless:

```
# /etc/conf.d/wireless:

# Global wirelessconfig file for net.* rc-scripts

# Hard code an ESSID to an interface

# This needs to be done when the driver doesn't support scanning

# Set to "any" to connect to any ESSID

# This may work for drivers that don't support scanning but you need automatic

# AP association

essid_wlan0="HelenaNet"

# Set the mode of the interface (ad-hoc or managed). Managed is default

# If it's ad-hoc you also need to specify the channel below

# mode_wlan0="ad-hoc"

mode_wlan0="managed"

# If managed mode fails, drop to adhoc mode with the below ESSID?

# If this is set, then remember to configure wireless options such as iface

# for the specified ESSID. Channel also needs to be specified (1-11)

adhoc_essid_wlan0="HelenaNet"

adhoc_channel_wlan0="9"

# Setup any other config commands. This is basically the iwconfig argument

# without the iwconfig $iface

# iwconfig_wlan0="dhcp"

# Set private driver ioctls. This is basically the iwpriv argument without

# the iwpriv $iface

#iwpriv_wlan0=""

# Some drivers need to scan in Ad-Hoc mode

# After scan, the mode is reset to the one defined above

#scan_mode_wlan0="Ad-Hoc"

# We can define various timeouts in seconds here

#sleep_scan_wlan0="1"

#sleep_associate_wlan0="5"

# Some driver/card combinations need to scan in Ad-Hoc mode

# After scanning, the mode is reset to the one defined above

#scan_mode_wlan0="Ad-Hoc"

# Below you can define private ioctls to run before and after scanning

# Format is the same as the iwpriv_wlan0 above

# This is needed for the HostAP drivers

#iwpriv_scan_pre_wlan0="host_roaming 2"

#iwpriv_scan_post_wlan0="host_roaming 0"

# Define a WEP key per ESSID

# IMPORTANT: any characters that are NOT in a_z A_Z 0_9 should be

# replaced with the _ character. For example #123 becomes _123

# The below examples use ESSID - change it to yours.

# You can't use "any" for an ESSID here

key_HelenaNet="open **********"

# or you can use strings. Passphrase IS NOT supported

#key_ESSID="open s:foobar"

# You can also override the interface settings here - even provide

# a nameserver/domain per ESSID

ifconfig_HelenaNet="dhcp"

#dhcpcd_ESSID="-t 5"

#inet6_ESSID=""

#routes_ESSID=""

#gateway_ESSID="192.168.0.1"

#nameserver_ESSID="192.168.0.1"

#domain_ESSID="some.domain"

# LEAP users will want to use the preassociate setting to specify

# an authentication script

#preassociate_ESSID="/run/this/script"

# This lists the preferred ESSIDs to connect to in order

# ESSID's can contain any characters here as they must match the broadcast

# ESSID exactly. Some characters may need to be escaped, such as " with \"

# Surround each ESSID with the " character and seperate them with a space

# If the first ESSID isn't found then it moves onto the next

# If this isn't defined then it connects to the first one found

#preferred_aps=("ESSID 1" "ESSID 2")

```

/EDIT: sorry it seems to be working for the first time now, still investigating...Last edited by Helena on Mon Apr 19, 2004 9:52 am; edited 1 time in total

----------

## UberLord

NEW EBUILD POSTED

Fixed test to see if a key had been set or not for the ESSID

dlpierce, this should now work for you.

If not, I need to see the script output!

----------

## UberLord

 *Helena wrote:*   

> Ok I must admit feeling a litle sheepish because I gan´t get it working...

 

Don't feel bad - you're not the first and I guarantee you aint the last either  :Wink: 

 *Quote:*   

> 
> 
> 2. Obtain a driver.
> 
> This is more difficult, since it's not supported by a kernel driver. I'm trying to use ndiswrapper now. So far, the driver is shown as "present, fuzzy" by ndiswrapper; hopefully this means it'll work.
> ...

 

There's a thread in the forum about that error - it's todo with kernel config/drivers. I'll see if I can dig it up

----------

## UberLord

 *Helena wrote:*   

> 
> 
> /EDIT: sorry it seems to be working for the first time now, still investigating...

 

OK - get back when you have more info.

This should show that my scripts and your wireless-config are OK.

If think the SIOCA... error is more hardware/kernel/driver and is outside the scope of my script

----------

## Helena

 *UberLord wrote:*   

>  *Helena wrote:*   Ok I must admit feeling a litle sheepish because I gan´t get it working... 
> 
> Don't feel bad - you're not the first and I guarantee you aint the last either 
> 
>  *Quote:*   
> ...

 thx somehow i've got it now, in fact i'm writing this on the wireless connection! I think it was an error in the ndiswrapper config.

----------

## UberLord

Excellent  :Smile: 

----------

## Moofed

 *UberLord wrote:*   

> NEW EBUILD POSTED
> 
> Fixed test to see if a key had been set or not for the ESSID
> 
> dlpierce, this should now work for you.
> ...

 

It works! Thank you (again)!

----------

## UberLord

 *dlpierce wrote:*   

> 
> 
> It works! Thank you (again)!

 

Most excellent  :Smile: 

----------

## Klavs

Thanks for a GREAT ebuild - I have been using your net.wlan0 init-script before this - and this is much cleaner - and I LOVE the preup and predown hooks (just got a tip from another to use them to "fix" my default route, when my wired interface goes down (it would not automatically set my wireless as default route). It works beautifully now - I only have 3 problems:

1) the setup now requires that I set a channel in Ad-Hoc mode ( I have no AP - and my server-card can only be Ad-Hoc) - I just set it to 10 - and it worked fine - even though my server is running at 3 - why do I need to set the channel - when I didn't before?

2) a small one - when starting in Ad-Hoc mode - it tells me WEP is disabled - even though it is not (an iwconfig confirms this - and my link would not be up otherwise  :Wink: 

3) I symlinked net.wlan0 to net.eth0 - but for some annoying reason if net.eth0 is down, and net.wlan0 is up - that is not enough to fullfill scripts that "need net" - if I try to restart ntp-client - it ups eth0 - and this ofcourse means it can not get access to net - as I'm not connected through eth0.

How do I make net.wlan0 fullfill the need net dependency?

----------

## UberLord

 *Klavs wrote:*   

> 
> 
> 1) the setup now requires that I set a channel in Ad-Hoc mode ( I have no AP - and my server-card can only be Ad-Hoc) - I just set it to 10 - and it worked fine - even though my server is running at 3 - why do I need to set the channel - when I didn't before?

 

Everything I have read regarding Ad-Hoc mode says it requires a channel being set. I would imagine it's to keep networks seperate.

If you can provide documentation that says otherwise, I'm more than happy to remove the restriction.

 *Quote:*   

> 
> 
> 2) a small one - when starting in Ad-Hoc mode - it tells me WEP is disabled - even though it is not (an iwconfig confirms this - and my link would not be up otherwise 
> 
> 

 

Fixed  :Smile: 

 *Quote:*   

> 
> 
> 3) I symlinked net.wlan0 to net.eth0 - but for some annoying reason if net.eth0 is down, and net.wlan0 is up - that is not enough to fullfill scripts that "need net" - if I try to restart ntp-client - it ups eth0 - and this ofcourse means it can not get access to net - as I'm not connected through eth0.
> 
> How do I make net.wlan0 fullfill the need net dependency?

 

Now that's plain odd.

I have net.ath0 linked to net.eth0 and net.being up satisfies the net dependancy just fine.

Is net.eth0 in the default runlevel?

----------

## UberLord

NEW EBUILD POSTED

Fixed reported wep status when in Ad-Hoc mode

This is a display only fix so you don't need this one

----------

## Klavs

 *Quote:*   

> Everything I have read regarding Ad-Hoc mode says it requires a channel being set. I would imagine it's to keep networks seperate.
> 
> If you can provide documentation that says otherwise, I'm more than happy to remove the restriction. 

 

Howcome it worked fine for me before - when I didn't give it a channel (old script) and said Ad-Hoc ? And howcome it works now - when I said channel-10 - and an iwconfig on my server, says its running in channel 3 (my laptop does not reveal which channel its using when using iwconfig - weird). It seems its rather redundant in this case ? AFAIK channels are for seperating access points, to get full bandwidth for each channel - ie. a client should not care about the Channel - it selects the channel based on the ESSID - and scans all channels for available ESSID's AFAIK.

 *Quote:*   

> Now that's plain odd.
> 
> I have net.ath0 linked to net.eth0 and net.being up satisfies the net dependancy just fine.
> 
> Is net.eth0 in the default runlevel?

 

Yup - both net.eth0 and net.wlan0 is in default runlevel - and points to their respective /etc/init.d/net.$if 

What else can I check?

----------

## UberLord

 *Klavs wrote:*   

>  *Quote:*   Everything I have read regarding Ad-Hoc mode says it requires a channel being set. I would imagine it's to keep networks seperate.
> 
> If you can provide documentation that says otherwise, I'm more than happy to remove the restriction.  
> 
> Howcome it worked fine for me before - when I didn't give it a channel (old script) and said Ad-Hoc ? And howcome it works now - when I said channel-10 - and an iwconfig on my server, says its running in channel 3 (my laptop does not reveal which channel its using when using iwconfig - weird). It seems its rather redundant in this case ? AFAIK channels are for seperating access points, to get full bandwidth for each channel - ie. a client should not care about the Channel - it selects the channel based on the ESSID - and scans all channels for available ESSID's AFAIK.
> ...

 

Channel just sets the frequency it broadcasts at. For example channel 11 is really  Frequency:2.462GHz

I notice that you said AFAIK - well, show me some docs that back you up and I'll happily remove it. Until then it stays.

 *Quote:*   

> 
> 
> Yup - both net.eth0 and net.wlan0 is in default runlevel - and points to their respective /etc/init.d/net.$if 
> 
> What else can I check?

 

Try making net.wlan0 a duplicate of net.eth0

----------

## Klavs

well I'm happy with just setting it to some channel - and then it works just fine here  :Smile:  - no matter what channel my server actually uses  :Smile: 

 *Quote:*   

> Try making net.wlan0 a duplicate of net.eth0

 

Right now I did as stated in the documentation - so /etc/init.d/net.wlan0 is merely a symlink to /etc/init.d/net.eth0 - is that what you mean - or should I make it a copy of net.eth0 instead of a symlink?

----------

## UberLord

 *Klavs wrote:*   

> well I'm happy with just setting it to some channel - and then it works just fine here  - no matter what channel my server actually uses 
> 
> 

 

After a bit of (more) research into Ad-Hoc, I've found the following

1. A channel must be set for Ad-Hoc to work (this is a requirement afaik)

2. Most things default to channel 3 (north america and europe except for france 11 and japan 14)

So whilst a channel must be set, I'm default to channel 3 if it's not.

And you're told this by the script.

I feel this is a nice compromise  :Smile: 

I've also updated the docs in /etc/conf.d/wireless with loads of which channel to use info! Good stuff  :Cool: 

 *Quote:*   

>  *Quote:*   Try making net.wlan0 a duplicate of net.eth0 
> 
> Right now I did as stated in the documentation - so /etc/init.d/net.wlan0 is merely a symlink to /etc/init.d/net.eth0 - is that what you mean - or should I make it a copy of net.eth0 instead of a symlink?

 

Ideally it should be a symlink so that when net.eth0 gets updated by newer baselayouts, every net device get the update.

I would try making net.wlan0 into a copy of net.eth0 (ie not a symlink) and see if that helps.

I suspect it won't, but lets get the easy possibles out of the way first  :Wink: 

----------

## UberLord

NEW EBUILD POSTED

Channel defaults to 3 for Ad-Hoc mode if not set in the config file

Config file updated with channel some basic channel selection info

----------

## Klavs

I just tried hardlinking net.eth0 to net.wlan0 - and rebooted. restarting ntp-client still brings up the eth0 interface  :Sad: 

Also that damn ifplug is defect - when I start it - it doesn't down the interface if the link is detected as down  :Sad:  I have to plug it in - and unplug it - before it downs the interface.

----------

## UberLord

 *Klavs wrote:*   

> I just tried hardlinking net.eth0 to net.wlan0 - and rebooted. restarting ntp-client still brings up the eth0 interface 
> 
> Also that damn ifplug is defect - when I start it - it doesn't down the interface if the link is detected as down  I have to plug it in - and unplug it - before it downs the interface.

 

Interesting.

ifplug provides a "net" interface, so if it's active then ntp-client shouldn't try and start any net interfaces. As to it's error, why not send an email off to the ifplugd developer or open a new bug on https://bugs.gentoo.org?

However, your problem is now outside the scope of this thread and I'm out of ideas  :Sad: 

----------

## Klavs

Fair enough. I figured it was a config-error - as ifplugd reports that the interface is unplugged at startup. it just doesn't down the interface  :Sad: 

if it works for you, it's probably not a bug.. or maybe it is..  :Sad: 

Hate reporting bogus bug reports  :Smile: 

----------

## Klavs

Many thanks for your help so far btw.  :Smile: 

----------

## UberLord

 *Klavs wrote:*   

> Fair enough. I figured it was a config-error - as ifplugd reports that the interface is unplugged at startup. it just doesn't down the interface 
> 
> if it works for you, it's probably not a bug.. or maybe it is.. 
> 
> Hate reporting bogus bug reports 

 

I don't use ifplugd - all my systems are wireless except for my server.

----------

## Zeikerd

I hope this gets in the portage tree. This is my first post on these forums, only because I want to thank the people who made it possible for me to get this working.

One question (maybe this has been brought up before):

I have a eth0 which is the 100mbit normal network and the wlan0 which is the wireless offcourse. When I pull the network cable they both go down. How can I prevent that?

----------

## UberLord

Does the output of "rc-status" show them both as active? If so, then it's not because they've gone down but because the default route was across the ethernet. When that goes down, it can't route internet traffic because the wireless doesn't know about it.

Besides, why would you need them both active at the same time?

----------

## blanny

Thanks for the script.  Is your new one supposed to echo the essid name to the console like the old one did?  All I'm getting is bringing up eth0....eth0 up. 

Matt

----------

## UberLord

 *blanny wrote:*   

> Thanks for the script.  Is your new one supposed to echo the essid name to the console like the old one did?  All I'm getting is bringing up eth0....eth0 up. 
> 
> Matt

 

Yes it should echo pretty much the same stuff like the old one - although this one is a bit more chatty.

Did you patch your /etc/conf.d/net as the ebuild specified?

If you just changed over, you need to remove all wireless config from /etc/conf.d/net, then apply the patch and then just the new config in /etc/conf.d/wireless

----------

## Zeikerd

 *Quote:*   

> Does the output of "rc-status" show them both as active? If so, then it's not because they've gone down but because the default route was across the ethernet. When that goes down, it can't route internet traffic because the wireless doesn't know about it.
> 
> Besides, why would you need them both active at the same time?

 

Yes, they are both active.

They are both active because they're both in the runtime level default. There is no other reason to have them both active at te same time.

Where should I place some sort of scripts to change the default route when one goes down?

----------

## UberLord

 *Zeikerd wrote:*   

> 
> 
> Yes, they are both active.
> 
> They are both active because they're both in the runtime level default. There is no other reason to have them both active at te same time.
> ...

 

I would suggest removing both net.scripts from the default runlevel and look into ifplugd which will bring up and take down the interface when a cable is removed/inserted.

I don't actually use ifplugd myself though, but last time I used it it worked fined with both wired and wireless interfaces.

----------

## -=Zepplock=-

Hi all

I'm kinda stuck here. Fighting scripts for 2 days.

Here's what I have.

Laptop with eth0 and wireless pcmcia.

Pcmcia seems to work (orange light is on).

Installed everything and I get:

```
bash-2.05b# /etc/init.d/net.wlan0 start

 * Running preup function

 *   Wireless extensions not found for wlan0

 * Bringing wlan0 up via DHCP...
```

My ifconfig:

```
bash-2.05b# ifconfig

eth0      Link encap:Ethernet  HWaddr 00:02:3F:80:EA:C2

          inet addr:192.168.0.2  Bcast:192.168.0.255  Mask:255.255.255.0

          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:34900 errors:0 dropped:0 overruns:0 frame:0

          TX packets:13570 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:20922598 (19.9 Mb)  TX bytes:1097242 (1.0 Mb)

          Interrupt:10 Base address:0x3000

lo        Link encap:Local Loopback

          inet addr:127.0.0.1  Mask:255.0.0.0

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:12 errors:0 dropped:0 overruns:0 frame:0

          TX packets:12 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:600 (600.0 b)  TX bytes:600 (600.0 b)

```

my iwconfig:

```
bash-2.05b# iwconfig

lo        no wireless extensions.

eth0      no wireless extensions.

```

net.wlan0 is simlinked to net.eth0

----------

## -=Zepplock=-

also

```
bash-2.05b# cardctl info

PRODID_1="Addtron"

PRODID_2="AWP-100 Wireless PCMCIA"

PRODID_3="Version 01.02"

PRODID_4=""

MANFID=0156,0002

FUNCID=6

PRODID_1=""

PRODID_2=""

PRODID_3=""

PRODID_4=""

MANFID=0000,0000

FUNCID=255

```

```
cardctl status

Socket 0:

  5V 16-bit PC Card

  function 0: [ready], [bat low]

Socket 1:

  no card

```

----------

## UberLord

Hi Zepplock.

Your output shows that you need to enable wireless-extensions.

To do this, enable the following config options - CONFIG_NET_RADIO and CONFIG_NET_WIRELESS.

Then recompile your kernel and modules and re-install them

If your driver is external then re-compile and re-install that.

Finally, re-emerge wireless-tools against the new kernel and driver.

Try the script again and you should be working fine  :Smile: 

----------

## herb2k

Hello

I'm having a problem emerging the ebuild

I follow the instructions up to the point

emerge net-wireless/wireless-config

emerge says that the ebuilds have been masked and suggests adding an "=" sign. But there's no way i can emerge it afterwards, can someone help?

Thanks!!

----------

## robpatriot

If you didn't do this prepend the line for the emerge such that the emerge command looks like this:

ACCEPT_KEYWORDS="~x86" emerge wireless-config

'cos that tells portage that although the package is masked because it is "apparantly unstable" that it should go on and install it anyway...

----------

## herb2k

Thanks, the prepend line worked  :Very Happy: 

Now I just gotta find how to configure it  :Smile: 

----------

## UberLord

You need to edit the file /etc/conf.d/wireless

There should be enough documentation in the file to get you going  :Smile: 

----------

## UberLord

 *robpatriot wrote:*   

> If you didn't do this prepend the line for the emerge such that the emerge command looks like this:
> 
> ACCEPT_KEYWORDS="~x86" emerge wireless-config
> 
> 'cos that tells portage that although the package is masked because it is "apparantly unstable" that it should go on and install it anyway...

 

I've updated my instructions accordingly

----------

## -=Zepplock=-

Thanx UberLord

I'll try it this evening.

----------

## herb2k

Hey everyone - another problem:

when i configure /etc/conf.d/wireless to the proper settings, they are still not showing up in iwconfig after a reboot?

Any suggestions?

----------

## Ronald Hummelink

Uberlord,

Is it a mistake my cute little patch is gone again from 0.2.6 ?

I upgraded and ended up on my neighbours again  :Wink: 

----------

## Cabalist

I have the exact same problem as Zepplock.  I have done all that you said to do UberLord.  Zepplock if you will post your results it would be very helpful. Thanx.  :Razz: 

----------

## -=Zepplock=-

Sure. I ususally post feedbacks.

It's almost out-of-office time here. Soooon )

----------

## -=Zepplock=-

Tried it. Same problem.

```
bash-2.05b# /etc/init.d/net.wlan0 start

 * Running preup function

 *   Wireless extensions not found for wlan0

 * Bringing wlan0 up via DHCP...                                                                                                       [ !! ]

```

So which process creates the wlan0 network interface? cause I don't see it in ifconfig.

My /etc/conf.d/net is:

```
iface_eth0="dhcp"

iface_wlan0="dhcp"

```

----------

## linux_on_the_brain

I have installed the wireless-tools ebuild and configured my net.eth1 file. Yet on boot I still cannot  connect. After gentoo boots I have to issue an iwconfig command to set essid and key then  /etc/init.d/net.eth1 restart to get wireless up and running. What am I doing wrong. Thanks

----------

## send2cj

Has anyone tried this on an ultra 10?

----------

## herb2k

How do I apply the preup patch? I tried using the command that was displayed at the end of the ebuild but it didn't seem to work?

----------

## UberLord

 *-=Zepplock=- wrote:*   

> Tried it. Same problem.
> 
> ```
> bash-2.05b# /etc/init.d/net.wlan0 start
> 
> ...

 

->>> Wireless extensions not found for wlan0

That line shows that your kernel + module has been compiled without wireless extensions OR the interface doesn't exist.

Please read the FAQ on my front page post.

Basically, after enabling wireless in the kernel you need to recompile the kernel, modules AND then re-emerge wirelessp-tools against the new kernel.

----------

## UberLord

 *Ronald Hummelink wrote:*   

> Uberlord,
> 
> Is it a mistake my cute little patch is gone again from 0.2.6 ?
> 
> I upgraded and ended up on my neighbours again 

 

NEW EBUILD POSTED

Oppsie   :Embarassed: 

/me slaps self on wrist   :Rolling Eyes: 

----------

## UberLord

 *herb2k wrote:*   

> How do I apply the preup patch? I tried using the command that was displayed at the end of the ebuild but it didn't seem to work?

 

Well, that's the command   :Rolling Eyes: 

If there's no line starting "preup() {" in /etc/conf.d/net then you need the patch

If it doesn't work, then please provide something for me to work with - like the output of you trying to patch!

----------

## UberLord

 *linux_on_the_brain wrote:*   

> I have installed the wireless-tools ebuild and configured my net.eth1 file. Yet on boot I still cannot  connect. After gentoo boots I have to issue an iwconfig command to set essid and key then  /etc/init.d/net.eth1 restart to get wireless up and running. What am I doing wrong. Thanks

 

It would be helpful if you posted the output of 

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

----------

## thechosen0ne

just upgraded my baselayout and installed the new version of this script. I like it a lot with the ebuild and separate file so I don't have to mess with /etc/conf.d/net every time there is a new update. one thing i've noticed.... i can't seem to get scanning mode to work. i have recently compiled the 2.6.5 kernel and used the shmoo.com orinoco drivers to allow scanning mode. airsnort, kismet, and ethereal all work, but the scipt says 

```

 * Running preup function

 *   Configuring wireless network for eth0

 *   Scanning for access points

 *   eth0 does not support scanning

 *   No preferred access points found

 *   Trying to force preferred incase they are hidden

```

not sure what it is, but maybe you can explain how scanning works now? it used to work... odd... thanks uberlord!!!!!!

----------

## UberLord

To get scanning working on orinoco cards, you need the patch found below

http://www.tzi.de/~plasmahh/

However, if that doesn't work or there's only ever 1 AP broadcasting it's ESSID the you can set ESSID to "any" in /etc/conf.d/wireless and the orinoco card will pickup the first access point and connects to that. My script picks this up and connects to the ESSID found.

HTH

----------

## linux_on_the_brain

I can't post the actual results right now as I am at work. But after I issue iwconfig eth1 essid xxx key xxxxxxxxxxxxxxx, and do a restart all it says Bringing up eth1 via DHCP, eth1 recieved address xxxxxxxx. for whatever reason it doesn't work on initial bootup. Can somebody post what is supposed to be configured to make it work on boot.

Thanks

----------

## UberLord

Sounds like you need to configure the below setting in /etc/conf.d/wireless

key_ESSID="1234"

change ESSID to your ESSID and 1234 to your key

So if ESSID is "My AP" and the key is "2222" then the setting is

key_My_AP="2222"

Take careful note of the output - it should say WEP enabled when connecting t your AP. If it doesn't, then you haven't set the key_ESSID correctly.

----------

## linux_on_the_brain

here is a real dumb question, Am I supposed to have a wireless file in /etc/conf.d, because I don't. Is that something I have to create or was it supposed to be part of the emerge of wireless-tools.

----------

## UberLord

Follow the instructions on the first page to download and emerge the ebuild.

You should get the file then

----------

## linux_on_the_brain

thanks i have the proper packages installed now. I will test it when I get home tonight. One more question, as a prelim test, I started the card /etc/init.d/net.eth1 restart, and get this output.

```
Running predown function

 *   Removing wireless configuration from eth1...                                                                                                    [ ok ] * Bringing eth1 down...                                                                                                                             [ ok ] * Running preup function

 *   Configuring wireless network for eth1

 *   eth1 does not support setting keys

 *   Connecting to "gkuhn" (WEP disabled)...                                                                                                         [ !! ] 
```

I set the following parameter in my wireless file key_gkuhn="xxxxxxxxxxxxxxxxxxxxxx"

prior to setting this up if I were to issue the command iwconfig eth1 key xxxxxxxxxxxxxxxx that would set my wep key. Any ideas?

Thanks

----------

## UberLord

 *linux_on_the_brain wrote:*   

> 
> 
> ```
> 
>  *   Configuring wireless network for eth1
> ...

 

It's not a very good error message - and I'll probably change it in the next version.

 *   eth1 does not support setting keys

Normally means the parameter is wrong

If the below command works

```
iwconfig eth1 key 12345
```

then the correct paramter is

```
key_gkuhn="12345"
```

replace the key to your one of course  :Wink: 

----------

## MFA

Hi,

I have done as described in the guide and in the ebuild, but never the less it fails..

I have a (PCMCIA) Belkin F5D6020y (notice the Y) - 'cardctl ident' says 'noproduct info available' in PCMCIA... ! after a restart of pcmcia_cs this comes up in dmesg

```

cs: IO port probe 0x0c00-0cff: clean.

cs: IO port probe 0x0c00-08ff: clean.

cs: IO port probe 0x0c00-04ff: excluding 0x200-0x207 0x398-0x39f 0x3c0-0x3df 0x4d0-0x4d7.

cs: IO port probe 0x0c00-0aff: clean.

```

Why is that? (PCMCIA lives, it ident's a 3com pcmcia card - and the card is alive - 'cat /prov/pci|grep Belkin' reveals it)

I have installed the Orinoco_cs drivers and I can modprobe it, and it shoes up in lsmod...

---

To the problem with this tool...

When running this command

```

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

* Running preup functions

*   Wireless extensions not found for wlan0

* Please make suer that /etc/conf.d/net has $ifconfig_wlan0 set

* (or $iface_wlan0 for old-style configurations)

```

Why is that? Is it because pcmcia_cs exludes it? and howcome?

----------

## UberLord

 *MFA wrote:*   

> To the problem with this tool...
> 
> When running this command
> 
> ```
> ...

 

As stated, there are no wireless extensions found for the interface.

If the output of 

```
iwconfig -a 
```

 shows this for wlan0, then you need to enable wireless in your kernel, rebuild it and then re-emerge wireless-tools against the new kernel.

This answer is in the FAQ on page 1

----------

## viperlin

i dont think there should be a "-a" on that....

----------

## MFA

/usr/src/linux/.config (2.6.3-r1)

```

CONFIG_NET_RADIO=y

CONFIG_NET_WIRELESS

CONFIG_PCMCIA_HRMES=m

```

So I think that should cover it...

I'm rather convinced that it is because pcmcia_cs failes to initialize the card - anybody got a clue to why?

----------

## -=Zepplock=-

 *UberLord wrote:*   

>  *-=Zepplock=- wrote:*   Tried it. Same problem.
> 
> ```
> bash-2.05b# /etc/init.d/net.wlan0 start
> 
> ...

 

Yes. I compitel everything in kernel, installed, rebooted etc.

What do you mean by "OR the interface doesn't exist"?

How do I check it?

----------

## linux_on_the_brain

No go, the iwconfig command itself works to set the wep key but not key_gkuhn="xxx"

how frustrating!

 *UberLord wrote:*   

>  *linux_on_the_brain wrote:*   
> 
> ```
> 
>  *   Configuring wireless network for eth1
> ...

 

----------

## UberLord

 *linux_on_the_brain wrote:*   

> No go, the iwconfig command itself works to set the wep key but not key_gkuhn="xxx"
> 
> 

 

It's doing exactly the same command!

PM me that line from your config file AND a sample working command line and I'll sort you out

----------

## UberLord

 *MFA wrote:*   

> /usr/src/linux/.config (2.6.3-r1)
> 
> ```
> 
> CONFIG_NET_RADIO=y
> ...

 

You're right - a quick google shows that a debian user gets cardmgr ident to report correct information.

I don't think that my scripts will work until your pcmcia issue is resolved  :Sad: 

check your log files for cardmgr stuff as well - that may give more insight

----------

## UberLord

 *-=Zepplock=- wrote:*   

> 
> 
> Yes. I compitel everything in kernel, installed, rebooted etc.
> 
> What do you mean by "OR the interface doesn't exist"?
> ...

 

```
iwconfig
```

Post up the output of that.

The interface may be net.eth1 or net.ath0 instead of net.wlan0

----------

## -=Zepplock=-

bash-2.05b# iwconfig

lo        no wireless extensions.

eth0      no wireless extensions.

----------

## viperlin

just like to say i've tried the new ebuild from using the old stuff, and thanks uberlord, this is great

----------

## UberLord

 *-=Zepplock=- wrote:*   

> bash-2.05b# iwconfig
> 
> lo        no wireless extensions.
> 
> eth0      no wireless extensions.

 

There we go.

Assuming that net.eth0 is your wired ethernet card you don't have a wireless kernel module loaded and working. You need to resolve that before even attempting my scripts

----------

## -=Zepplock=-

But I compiled kernel with parameters you specified in prev posts.

Are there any other ways to verify this?

----------

## -=Zepplock=-

Let me try now to recompile it againt and reboot to new kernel

My current config:

http://vova.org/files/.config

----------

## UberLord

 *-=Zepplock=- wrote:*   

> But I compiled kernel with parameters you specified in prev posts.
> 
> Are there any other ways to verify this?

 

Have you loaded the kernel module for your wireless network card?

Let's start with the basics - what make and model wifi card are you using?

----------

## Cabalist

WOOO!!!!!  Ok -=Zepplock=-  I fixed my problem so I may have fixed yours.  Make sure pcmcia is a service you are starting at boot.  

```
/etc/init.d/pcmcia start

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

run that and if it works do this 

```
rc-update add pcmcia default
```

This fixed all my problems and it was so silly!

----------

## -=Zepplock=-

Recompiled. Rebooted.

Same output from iwconfig

----------

## -=Zepplock=-

Cabalist

I have pcmcia running. No worries here.

----------

## -=Zepplock=-

```
bash-2.05b# cardctl info

PRODID_1="Addtron"

PRODID_2="AWP-100 Wireless PCMCIA"

PRODID_3="Version 01.02"

PRODID_4=""

MANFID=0156,0002

FUNCID=6

PRODID_1=""

PRODID_2=""

PRODID_3=""

PRODID_4=""

MANFID=0000,0000

FUNCID=255

```

----------

## -=Zepplock=-

Hmmm.

Now I have this:

```
iwconfig

lo        no wireless extensions.

eth0      no wireless extensions.

eth1      IEEE 802.11-DS  ESSID:""  Nickname:"Prism  I"

          Mode:Managed  Frequency:2.462GHz  Access Point: 00:00:00:00:00:00

          Bit Rate:11Mb/s   Tx-Power=15 dBm   Sensitivity:1/3

          Retry min limit:8   RTS thr:off   Fragment thr:off

          Power Management:off

          Link Quality:0/92  Signal level:134/153  Noise level:134/153

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

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

```

----------

## -=Zepplock=-

Seems like I see the card. Can't check it while in office (no network here)

Will wait till I get home.

Thank you man.

----------

## -=Zepplock=-

It worked!

I'm at home using wireless!!!

Just as a reminder for those who will be on the same path as me: be patient.

p.s. I think that I had 2 major problems:

1. wireless extensions not enabled in kernel.

2. you should remove/insert card after you configure everyhting (to run hotplug scripts)

Now next question.

How to make eth0 and eth1 start in proper order at home (eth1 wireless only) 

and at the office (eth0 only - wire)

----------

## dru

Hi, I'm trying to install this, but I'm getting this error:

Neo wireless-config # ebuild wireless-config-0.2.7.ebuild fetch

!!! aux_get(): ebuild for 'net-wireless/wireless-config-0.2.7' does not exist at:

!!!            /usr/portage/net-wireless/wireless-config/wireless-config-0.2.7.ebuild

but it appears to be in the correct directory:

Neo wireless-config # pwd

/usr/local/portage/net-wireless/wireless-config

Neo wireless-config # ls

wireless-config-0.2.7.ebuild

Any ideas?

Thanks,

Dru

----------

## -=Zepplock=-

Do everything in 1st post - but remove word 'local' from all paths

----------

## herb2k

Ok, I got the patch working, but what do I do with it inside the /etc/conf.d/net file?

What does:  *Quote:*   

>  * /etc/conf.d/net patched
> 
>  * You will have to edit the file /etc/conf.d/net
> 
>  * and merge the two preup and/or predown functions together

   mean?

Thanks!

----------

## UberLord

 *-=Zepplock=- wrote:*   

> 
> 
> Now next question.
> 
> How to make eth0 and eth1 start in proper order at home (eth1 wireless only) 
> ...

 

eth1 is pcmcia yes? Well, thats simple. Remove net.eth1 from all runlevels and let pcmcia bring it up/down. So only plug the card in when you need wireless  :Smile: 

For eth0 (wired) I would recommend removing it from runlevels as well and look into ifplugd which brings up/down interfaces when the network cable is plugged in/removed.  :Smile: 

----------

## UberLord

 *herb2k wrote:*   

> Ok, I got the patch working, but what do I do with it inside the /etc/conf.d/net file?
> 
> What does:  *Quote:*    * /etc/conf.d/net patched
> 
>  * You will have to edit the file /etc/conf.d/net
> ...

 

It means that you already had a preup function in /etc/conf.d/net and the patch is adding a new preup function instead of replacing it.Y ou need to merge the two together. Not very user friendly I know, but I can't think of anything else.

----------

## dru

 *-=Zepplock=- wrote:*   

> Do everything in 1st post - but remove word 'local' from all paths

 

Cool, that got me a bit farther, but now I'm getting:

emerge net-wireless/wireless-config

Calculating dependencies

!!! all ebuilds that could satisfy "net-wireless/wireless-config" have been masked.

!!! possible candidates are:

- net-wireless/wireless-config-0.2.7 (masked by: ~keyword)

!!! Error calculating dependencies. Please correct.

----------

## dru

Nevermind, I found out the problem. I had to run it like such:

ACCEPT_KEYWORDS="~x86" emerge net-wireless/wireless-config

I figured since I had march=i686 in /etc/make.conf I didn't need the "ACCEPT_KEYWORDS="~x86", but I guess I do. 

Also, how come it didn't work from /usr/local/portage, but it did from /usr/portage? Just trying to learn.

----------

## dru

Ok, I'm trying to figure out what I need to do now. My wireless card is eth1 (I also have an ethernet connection on eth0), and it looks like it's working ok:

Neo init.d # iwconfig

eth0      no wireless extensions.

lo        no wireless extensions.

eth1      IEEE 802.11-DS  ESSID:"myssid"

          Mode:Managed  Frequency:2.442GHz  Access Point: FF:FF:FF:FF:FF:FF

          Bit Rate:11Mb/s   Tx-Power=20 dBm   Sensitivity=0/65535

          Retry limit:16   RTS thr:off   Fragment thr:off

          Encryption key:off

          Power Management:off

          Link Quality:176/10  Signal level:-105 dBm  Noise level:-105 dBm

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

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

but I do not have a /etc/init.d/net.eth1 which the script says to link net.wlan0 to. 

Any suggestions?

----------

## iverson0881

Ok i've been having problems with your recent ebuilds as of late. The last ebuild that worked properly was 0.2.3. In any case when I turn on my computer the wireless is brought up and it says its trying to connect to my essid. But unfortunately the damn thing never is able to get passed the DHCP part so i get the !! in red and all related services that require a network interface die as well. But once I get into linux and login. I am able to do /etc/init.d/net.ath0 start and it will work everytime perfectly. I don't know why it would behave like that. Maybe you, UberLord, or someone else may know why.

/etc/conf.d/net

```

iface_eth0="dhcp"

iface_ath0="dhcp"

source /etc/init.d/wireless.sh

preup() {

   wireless_up ${1}

   return $?

}

predown() {

   wireless_down ${1}

   return $?

}

```

/etc/conf.d/wireless

```

essid_ath0="Hameed"

key_Hameed="open 86F981726F"

preferred_aps=("Hameed")

```

So that is basically what is uncommented in those two files.

Thanks

iverson0881

----------

## herb2k

My problem is very similar to iverson0881's - the preup functions don't seem to be doing anything? 

does the ${1} have to be changed at all?

I'm still using 0.2.6 btw 

Thanks!

 *iverson0881 wrote:*   

> Ok i've been having problems with your recent ebuilds as of late. The last ebuild that worked properly was 0.2.3. In any case when I turn on my computer the wireless is brought up and it says its trying to connect to my essid. But unfortunately the damn thing never is able to get passed the DHCP part so i get the !! in red and all related services that require a network interface die as well. But once I get into linux and login. I am able to do /etc/init.d/net.ath0 start and it will work everytime perfectly. I don't know why it would behave like that. Maybe you, UberLord, or someone else may know why.
> 
> /etc/conf.d/net
> 
> ```
> ...

 

----------

## herb2k

 *truekaiser wrote:*   

> just a freindly word of warning. do not attempt to use this unless you are willing to do a complete system re-install. it(for me atlest) overworte every single configuration file from fstab to the module autoload.

 

That is why you do not let etc-update replace every file  :Smile: 

Probably you haven't run etc-update before installing this so there were a lot of configuration files that need updating

----------

## truekaiser

<my own damn fault>Last edited by truekaiser on Wed Apr 28, 2004 5:46 am; edited 1 time in total

----------

## TwoSlick

I'm trying to download the ebuild on the first page, but it doesn't seem to be there.  Any problems?

- TwoSlick

----------

## iverson0881

 *truekaiser wrote:*   

> it didn't give me a choice this time..

 

Thats probably because of its dependency on baselayout. That ebuild will overwrite files like /etc/fstab and the like. Annoying yes if you don't fix it before a reboot but you can always stick in the livecd and chroot in. Pretty simple but that can get annoying. But it certainly does NOT require a complete reinstall.

----------

## Helena

I find that often the startup script runs but does not finish successfully, because wlan0 does not get an IP address from my DHCP server in time. This happens 25-50% of the time. A reboot always fixes this problem. Should I suspect my wireless router, or is this common?

----------

## sven

```
# wget http://rsm.demon.co.uk/~roy/downloads/wireless-config-0.2.7.ebuild

--11:46:27--  http://rsm.demon.co.uk/%7Eroy/downloads/wireless-config-0.2.7.ebuild

           => `wireless-config-0.2.7.ebuild.1'

Resolving rsm.demon.co.uk... 80.177.174.176

Connecting to rsm.demon.co.uk[80.177.174.176]:80... failed: Connection refused.
```

 :Crying or Very sad:  I've been trying for some hours now. Is there any mirror?

----------

## saendy

hi,

i have a notbook (samsung x10) and installed the ndiswrapper etc. and the wireless-config ebuild, but it doesn't work like it should.

But it works, when i type following:

```

# iwconfig wlan0 essid "XXXXXX" key XXXXXXXXXX

# dhcpcd wlan0

# iwconfig wlan0

wlan0     IEEE 802.11b  ESSID:"XXXXXXX"

          Mode:Managed  Frequency:2.437GHz  Access Point: 00:40:05:55:FB:7D

          Bit Rate:11Mb/s

          RTS thr:1600 B   Fragment thr:2344 B

          Encryption key:XXXX-XXXX-XX   Security mode:restricted

          Power Management:off

          Link Quality:0/100  Signal level:-37 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

# ifconfig wlan0

wlan0     Link encap:Ethernet  HWaddr 00:04:23:93:BE:6F

          inet addr:192.168.0.38  Bcast:192.168.0.255  Mask:255.255.255.0

          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:3 errors:0 dropped:0 overruns:0 frame:0

          TX packets:2 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:620 (620.0 b)  TX bytes:650 (650.0 b)

          Interrupt:5 Memory:c0000000-c0000fff

```

but if I use your script following happens:

```

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

 * Running preup function

 *   Configuring wireless network for wlan0

 *   Connecting to "saendy" (WEP enabled)...                        [ ok ]

 * Bringing wlan0 up via DHCP...                                          [ !! ]

```

i have entered into the /etc/conf.d/wireless:

```

essid_wlan0="saendy"

mode_wlan0="managed"

key_saendy="restricted XXXXXXXXXX"

ifconfig_saendy="dhcp"

dhcpcd_saendy="-t 5"

```

I found out that the script (net.eth0) forget my essid while running the dhcpcd:

```

...

iface_start() {

   local IFACE=${1} i x

   checkconfig || return 1

   if [[ ${ifconfig_IFACE} != dhcp ]]; then

      # Show the address, but catch if this interface will be inet6 only

      i=${ifconfig_IFACE%% *}

      if [[ ${i} == *.*.*.* ]]; then

         ebegin "Bringing ${IFACE} up (${i})"

      else

         ebegin "Bringing ${IFACE} up"

      fi

      # ifconfig does not always return failure ..

      /sbin/ifconfig ${IFACE} ${ifconfig_IFACE} >${devnull} && \

      /sbin/ifconfig ${IFACE} &>${devnull}

      eend $? || return $?

   else

      # Check that eth0 was not brought up by the kernel ...

      if [[ ${status_IFACE} == up ]]; then

         einfo "Keeping kernel configuration for ${IFACE}"

      else

         ebegin "Bringing ${IFACE} up via DHCP"

         echo "net.eth0.iface_start.before.dhcpcd:"

         /usr/sbin/iwconfig ${IFACE}

         /sbin/dhcpcd ${dhcpcd_IFACE} ${IFACE}

         echo "net.eth0.iface_start.after.dhcpcd:"

         /usr/sbin/iwconfig ${IFACE}

         eend $? || return $?

      fi

      # Show address retrieved

      i=$(ifconfig ${IFACE} | grep -m1 -o 'inet addr:[^ ]*' | cut -d: -f2)

      [[ -n ${i} ]] && einfo "  ${IFACE} received address ${i}"

   fi

...

```

( adapted from my modified net.eth0)

here is the output of my modified script:

```

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

 * Running preup function

 *   Configuring wireless network for wlan0

 *   Connecting to "saendy" (WEP enabled)...                              [ ok ]

 * Bringing wlan0 up via DHCP...

net.eth0.iface_start.before.dhcpcd:

wlan0     IEEE 802.11b  ESSID:"XXXXXX"

          Mode:Managed  Frequency:2.437GHz  Access Point: 00:40:05:55:FB:7D

          Bit Rate:11Mb/s

          RTS thr:1600 B   Fragment thr:2344 B

          Encryption key:XXXX-XXXX-XX   Security mode:restricted

          Power Management:off

          Link Quality:0/100  Signal level:-43 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

net.eth0.iface_start.after.dhcpcd:

wlan0     IEEE 802.11b  ESSID:""

          Mode:Managed  Frequency:2.437GHz  Access Point: FF:FF:FF:FF:FF:FF

          Bit Rate:11Mb/s

          RTS thr:1600 B   Fragment thr:2344 B

          Encryption key:XXXX-XXXX-XX   Security mode:restricted

          Power Management:off

          Link Quality:0/100  Signal level:-43 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

```

so can anyone help me?

Thaks to all help!!

----------

## truekaiser

<<forgot to get rid of this one>>Last edited by truekaiser on Thu Apr 29, 2004 4:42 am; edited 1 time in total

----------

## iverson0881

 *truekaiser wrote:*   

>  *iverson0881 wrote:*    *truekaiser wrote:*   it didn't give me a choice this time.. 
> 
> Thats probably because of its dependency on baselayout. That ebuild will overwrite files like /etc/fstab and the like. Annoying yes if you don't fix it before a reboot but you can always stick in the livecd and chroot in. Pretty simple but that can get annoying. But it certainly does NOT require a complete reinstall. 
> 
> it does when it replaces 10+ and scrolls by so fast i only catch one or two.
> ...

 

Next time maybe don't do etc-update out at the command line and try doing it at a gui terminal.Then you can just scroll back. =/

----------

## iverson0881

 *Helena wrote:*   

> I find that often the startup script runs but does not finish successfully, because wlan0 does not get an IP address from my DHCP server in time. This happens 25-50% of the time. A reboot always fixes this problem. Should I suspect my wireless router, or is this common?

 

I believe this is happenning to me as well. I'm guessing maybe we need some sort of delay in the script and then it will work properly.

----------

## aaronjb

 *iverson0881 wrote:*   

> Next time maybe don't do etc-update out at the command line and try doing it at a gui terminal.Then you can just scroll back. =/

 

I always do a `find /etc -iname '._cfg*'` first, and look for any 'braindead' files in there like fstab/group/passwd etc after this happened to me on my first Gentoo machine  :Smile: 

And back to wireless.. if only I could get the ebuild, the server seems to be down today  :Crying or Very sad: 

----------

## iverson0881

Hmm as long as Uberlord doesn't mind heres the ebuild:

http://s90806223.onlinehome.us/weirdness/wireless-config-0.2.7.ebuild

and the bz2 file is here:

http://s90806223.onlinehome.us/weirdness/wireless-config-0.2.7.tar.bz2

----------

## scaba

 *iverson0881 wrote:*   

> Hmm as long as Uberlord doesn't mind heres the ebuild:
> 
> http://s90806223.onlinehome.us/weirdness/wireless-config-0.2.7.ebuild
> 
> and the bz2 file is here:
> ...

 

thanks a lot   :Very Happy: 

----------

## herb2k

I got it working  :Very Happy: 

For those who are curious, I did not replace the original net.eth0 when I first emerged and ran etc-update, 

I just unmerged both baselayout and wireless-config, deleted net.eth0, the symlink to net.wlan0, and re-emerged wireless-config, and the preup and predown scripts both ran  :Very Happy: 

Great script uberlord  :Very Happy: 

----------

## UberLord

 *dru wrote:*   

> Also, how come it didn't work from /usr/local/portage, but it did from /usr/portage? Just trying to learn.

 

Sounds like you didn't enable PORTDIR_OVERLAY in /etc/make.conf

----------

## UberLord

 *TwoSlick wrote:*   

> I'm trying to download the ebuild on the first page, but it doesn't seem to be there.  Any problems?
> 
> - TwoSlick

 

It's there now. Damn my crappy ADSL router!

----------

## UberLord

 *Helena wrote:*   

> I find that often the startup script runs but does not finish successfully, because wlan0 does not get an IP address from my DHCP server in time. This happens 25-50% of the time. A reboot always fixes this problem. Should I suspect my wireless router, or is this common?

 

I would suspect the wireless network card.

My Orinoco card in my lappy returns with DHCP lightning quick, where's my Athereos in my desktop often takes longer than 30 seconds.

This can be replicated - try typing 

```
dhcpcd eth1
```

 and see how long it takes.

----------

## UberLord

 *saendy wrote:*   

> 
> 
> so can anyone help me?

 

Try removing the restricted part from the WEP key.

It sounds like a WEP problem, so try disabling that. If it then works, then you know that WEP is the problem.

Someone here has a similar problem that I'm currently working to resolve - maybe you have this one too!

----------

## UberLord

 *saendy wrote:*   

> but if I use your script following happens:
> 
> ```
> 
> # /etc/init.d/net.wlan0 start
> ...

 

That's correct as dhcpcd drops the interface if it cannot connect to a DHCP server and some wifi drivers do this when the interface is dropped.

----------

## MFA

Hi,...

I prev. was here because my card didn't work at all, well the card was broke - but now i'm back with a new card... The Belkin F5D6020 Ver 2. - It runnes an Atmel chipset, so I'm using the 2.6 kernel's driver for it... that (kind of) work...

BUT, when running '/etc/init.d/net.eth1 start' I get the following:

---

* Running preup function

* Configuring wireless network for eth1

*  Scanning for access points

* No Access Points found for eth1

*  Entering Ad-Hoc mode as "WLAN" on channel 6 (WEP disabled)

* Please make sure that /etc/conf.d/net has $ifconfig_eth1 set

* (or $iface_eth1 for old-style configuration) 

---

Why is that?

----------

## iverson0881

 *herb2k wrote:*   

> I got it working 
> 
> For those who are curious, I did not replace the original net.eth0 when I first emerged and ran etc-update, 
> 
> I just unmerged both baselayout and wireless-config, deleted net.eth0, the symlink to net.wlan0, and re-emerged wireless-config, and the preup and predown scripts both ran 
> ...

 

Nice. I did the same but it didn't work. So what I did was have two of the prelink things that UberLord has us patch in our /etc/conf.d/net. So I guess now its running it twice But it catches the IP address now and its all good. Yay!

iverson0881

----------

## saendy

 *UberLord wrote:*   

> 
> 
> Try removing the restricted part from the WEP key.
> 
> It sounds like a WEP problem, so try disabling that. If it then works, then you know that WEP is the problem.
> ...

 

Thanks to your help!

Ok without the WEP Key it works without any problem. But if I use a WEP Key it fails, although I have remove the "restricted" and testet with "open". In addition to that I testet it with a ASCII-Key(s:...) and a HEX-Key. 

!Maybe import is that my AccessPoint isn't the DHCP-Server, he (the AP) gets his adress by another router behind it (seen from the WLan-PC)!

----------

## UberLord

 *saendy wrote:*   

>  *UberLord wrote:*   
> 
> Try removing the restricted part from the WEP key.
> 
> It sounds like a WEP problem, so try disabling that. If it then works, then you know that WEP is the problem.
> ...

 

Where the DHCP is doesn't matter as my DHCP server is behind my access point.

Try using a basic wepkey like all 1's.

It may be a different problem as some access points don't like restricted or open and neither to some wifi drivers.

----------

## UberLord

 *MFA wrote:*   

> Hi,...
> 
> I prev. was here because my card didn't work at all, well the card was broke - but now i'm back with a new card... The Belkin F5D6020 Ver 2. - It runnes an Atmel chipset, so I'm using the 2.6 kernel's driver for it... that (kind of) work...
> 
> BUT, when running '/etc/init.d/net.eth1 start' I get the following:
> ...

 

It couldn't find any access points

You configured it to enter Ad-Hoc mode when this happens

You haven't configured ifconfig_WLAN="dhcp" dhcpcd_WLAN="-t 5" OR the defaults the for interface in /etc/conf.d/net ifconfig_eth1="dhcp" dhcpcd_eth1="-t 5"

----------

## UberLord

 *iverson0881 wrote:*   

> 
> 
> Nice. I did the same but it didn't work. So what I did was have two of the prelink things that UberLord has us patch in our /etc/conf.d/net. So I guess now its running it twice But it catches the IP address now and its all good. Yay!
> 
> iverson0881

 

Actually it should only run once still as the last preup() function takes precedence

----------

## rl03

UberLord, thanks for a great script. I was using a quick-n-very_dirty script of my own, which worked, but yours is so much cleaner.

----------

## saendy

 *UberLord wrote:*   

> 
> 
> Where the DHCP is doesn't matter as my DHCP server is behind my access point.
> 
> Try using a basic wepkey like all 1's.
> ...

 

That's nice to here, that it doesn't matter where the dhcp serve is. 

But I can't imagine, why I get it working, when I enter the lines on my own with a WEP key:

```
#iwconfig wlan0 essid "saendy" key 3DA4EF532A
```

With this line, the dhcpcd works properly.

----------

## UberLord

 *saendy wrote:*   

> 
> 
> But I can't imagine, why I get it working, when I enter the lines on my own with a WEP key:
> 
> ```
> ...

 

In that case, the key parameter in /etc/conf.d/wireless you want is ....

```
key_saendy="3DA4EF532A"
```

Try that  :Smile: 

----------

## mathiasb

i just tried the script and i have a problem: i dont use WEP. How do i turn it off?

i have the key_ESSID lines outcommented in the config, but it keeps saying (WEP enabled) when im starting it.?!? is there something im missing here?  :Rolling Eyes: 

----------

## scaba

just wanted to drop a line and say that your ebuild is working great here. thanks very much uberlord for your work. keep it up   :Very Happy: 

----------

## UberLord

 *mathiasb wrote:*   

> i just tried the script and i have a problem: i dont use WEP. How do i turn it off?
> 
> i have the key_ESSID lines outcommented in the config, but it keeps saying (WEP enabled) when im starting it.?!? is there something im missing here? 

 

Possibly.

I query the output of iwconfig for WEP status.

Could you post the output of iwconfig for me?

Also, do you have any lines beginning with key_ in /etc/conf.d/wireless or /etc/conf.d/net ?

----------

## mathiasb

 *UberLord wrote:*   

> 
> 
> Possibly.
> 
> I query the output of iwconfig for WEP status.
> ...

 

Here it is:

```
eth1      IEEE 802.11b/g  ESSID:"My ESSID"

          Mode:Managed  Channel:4  Access Point: 00:0D:88:A0:CF:9D

          Sensitivity=20/200

          Retry min limit:8   RTS thr=2347 B   Fragment thr=2346 B

          Link Quality:0  Signal level:0  Noise level:116

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

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

```

 *UberLord wrote:*   

> 
> 
> Also, do you have any lines beginning with key_ in /etc/conf.d/wireless or /etc/conf.d/net ?

 

No, they are all commented out.

----------

## UberLord

 *mathiasb wrote:*   

> 
> 
> Here it is:
> 
> ```
> ...

 

OK - I'll have to give you a new version - probably tomorrow or over the weekend.

Basically I query "Encryption: off" or similar. If it's there then WEP is "off" otherwise its "on". I'll have to query if the word "encryption" is there at all!

So this is just a display problem - does the wireless work as it stands?

----------

## mathiasb

ok, i will look forward.  :Smile: 

yes, the wireless works fine when i bring it up manually with iwconfig and such...

----------

## UberLord

NEW EBUILD POSTED

Checks that the interface exists and dies when it doesn't.

WEP mode is now reported correctly when iwconfig doesn't report it at all.

Channel and ESSID are derived from iwlist/iwgetid when connected and NOT from your configuration values.

Shouldn't try to connect to the same ESSID more than once.

----------

## robpatriot

If anyone has any thoughts on this could they post please?

https://forums.gentoo.org/viewtopic.php?t=164553

Sorry if you regard this unrelated but I figured if the answer could be found it would make getting wireless working a lot easier for some people and works with ubers script...

----------

## nukem996

I tried the script and im still having a few issues with it. Hopefully the people in the fourm you linked to will help me.

Thanks

nuke

----------

## UberLord

 *Quote:*   

> Hey I tried your script but I still cannt use any of the iw* tools or connect to wireless networks. I have it setup so my ethernet card is on eth0 and my WiFi card is eth1. Any adeas?
> 
> 

 

Why don't you post the output of 

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

 as a starting point.

----------

## robpatriot

nukem I didn't intend for that to be a help request area for this script was just trying to get people here to look at the other forum as I think it will be easier for people here to get network cards working if that can be fixed....  Again sorry if people think I am off topic....

----------

## igor47

I'm guessing this is a problem with the new version (although i don't know, this is the first one i try)

running 

```
net.ath0 start
```

 gives an error:

 *Quote:*   

> /sbin/runscript.sh: line 60: key_SSD-049=open my-wep-key: command not found

 

the script then runs through all the stuff, but cannot connect to my preferred access point since no WEP (i'm guessing)

then, although it picks up another access point besides the preferred one, it says

 *Quote:*   

> 
> 
> *Couldn't associate with any access points
> 
> *Failed to configure wireless for ath0
> ...

 

If i add blank quotes to the end of my preferred_aps, it will connect to the other access point it detects, but it doesn't give it a name - it says 

 *Quote:*   

> 
> 
> *ath0 connected in Manged mode to "" on channel 11 (WEP Disabled)
> 
> *Bringing ath0 up via DHCP
> ...

 

BTW, i also get 

 *Quote:*   

> /usr/sbin/iwgetid: invalid option -- r

 

and then it spits out usage for iwgetid.[/quote]

----------

## iverson0881

Yup me too i'm getting 

```
/usr/sbin/iwgetid: invalid option -- r

Usage iwgetid [OPTIONS] [ifname]

  Options are:

    -a,--ap       Print the access point address

    -f,--freq     Print the current frequency

    -m,--mode     Print the current mode

    -p,--protocol Print the protocol name

    -s,--scheme   Format the output as a PCMCIA scheme identifier

    -h,--help     Print this message

```

Easy fix though. just needs to be changed to 

```
local e=`${IWGETID} -s ${IFACE}`
```

Line 192 of /etc/init.d/wireless.sh

----------

## truekaiser

ok after fixing the install that i messed up on my own i re-installed the script but it doesn't want to work. i followed the install to the letter and this is all i get for starting up the interface.

```

*bringing wlan0 up

*failed to bring up wlan0

```

/etc/conf.d/wireless 

```
essid_eth0="wscale"

mode_eth0="managed"
```

/etc/conf.d/net

```

iface_eth0="dhcp"

iface_wlan0="dhcp"

source /etc/init.d/wireless.sh

preup() {

   wireless_up ${1}

   return $?

}

predown() {

   wireless_down ${1}

   return $?

} 
```

useing the following card.

```
02:02.0 Network controller: Broadcom Corporation BCM94306 802.11g (rev 02)

   Subsystem: Dell Computer Corporation TrueMobile 1300 WLAN Mini-PCI Card

   Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B-

   Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-

   Latency: 32

   Interrupt: pin A routed to IRQ 11

   Region 0: Memory at faffc000 (32-bit, non-prefetchable) [size=8K]

   Capabilities: [40] Power Management version 2

      Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA PME(D0+,D1+,D2+,D3hot+,D3cold+)

      Status: D0 PME-Enable- DSel=0 DScale=2 PME-

    
```

i have ndiswrapper 0.7 useing the drivers right off the cd that came with the card.

----------

## nukem996

Idn how I did this but I got the script working. Sorry for the mispost.

----------

## UberLord

 *iverson0881 wrote:*   

> Yup me too i'm getting 
> 
> ```
> /usr/sbin/iwgetid: invalid option -- r
> 
> ...

 

Trust me to use an option that's only in unstable wireless-tools!

Scheme appears to do the same thing as raw  :Smile: 

----------

## UberLord

NEW EBUILD POSTED

New scanning code

...    removed all usage of IFS

...    detect if an AP has WEP enabled or not

...    drop WEP setting if AP doesn't have WEP enabled

...    abort association attempt if AP requires WEP and the key hasn't been set

New reporting code

...    ad-hoc and managed share the same code now - moved into a generic function

...     iwgetid -s is used instead of -r

This does contain some very new code - but it should work  :Smile: 

----------

## UberLord

 *truekaiser wrote:*   

> ok after fixing the install that i messed up on my own i re-installed the script but it doesn't want to work. i followed the install to the letter and this is all i get for starting up the interface.
> 
> ```
> 
> *bringing wlan0 up
> ...

 

The other stuff looks OK - but that isn't the output from net.eth0 in baselayout >= 1.8.8

Why don't you try re-emerging baselayout and then linking net.wlan0 to net.eth0?

```

ln -sf /etc/init.d/net.eth0 /etc/init.d/net.wlan0
```

----------

## UberLord

 *igor47 wrote:*   

> I'm guessing this is a problem with the new version (although i don't know, this is the first one i try)
> 
> running 
> 
> ```
> ...

 

That's because you have a minus sign in the ESSID. Change it to an underscore for parameters

key_SSD_049=open my-wep-key

----------

## dyrstr8s

To go back a ways in this thread, I am having the same problem dru had, emerging.  I get "there are no masked or unmasked ebuilds..."

The solution for him seemed to be to take local out of the paths because PORT_DIR OVERLAY was not enabled.  Well, how do you enable it? I edited my /etc/make.conf to include the line: PORTDIR_OVERLAY="/usr/local/portage"

Apparently this is not correct?

----------

## UberLord

 *dyrstr8s wrote:*   

> To go back a ways in this thread, I am having the same problem dru had, emerging.  I get "there are no masked or unmasked ebuilds..."
> 
> The solution for him seemed to be to take local out of the paths because PORT_DIR OVERLAY was not enabled.  Well, how do you enable it? I edited my /etc/make.conf to include the line: PORTDIR_OVERLAY="/usr/local/portage"
> 
> Apparently this is not correct?

 

Mine is 

PORTDIR_OVERLAY=/usr/local/portage

Also, you have to ensure that the directory structure matches the portage one

```

mkdir -p /usr/local/portage/net-wireless/wireless-config

cd /usr/local/portage/net-wireless/wireless-config

wget rsm.demon.co.uk/~roy/downloads/wireless-config-0.3.0.ebuild

ebuild *0.3.0.ebuild fetch

ebuild *0.3.0.ebuild digest

emerge net-wireless/wireless-config

```

----------

## dyrstr8s

OK, now when I emerge with:# ACCEPT_KEYWORD="~x86" emerge net-wireless/wireless-config-0.3.0 , I get !!! "Specific key requires an operator (net-wireless/wireless-config-0.3.0) (try adding an '=').

Thanks so much, UberLord!

----------

## UberLord

 *dyrstr8s wrote:*   

> OK, now when I emerge with:# ACCEPT_KEYWORD="~x86" emerge net-wireless/wireless-config-0.3.0 , I get !!! "Specific key requires an operator (net-wireless/wireless-config-0.3.0) (try adding an '=').
> 
> Thanks so much, UberLord!

 

Don't specify the version number when emerging.

If you do then

```
emerge =net-wireless/wireless-config-0.3.0
```

 should work  :Smile: 

----------

## truekaiser

 *UberLord wrote:*   

>  *truekaiser wrote:*   ok after fixing the install that i messed up on my own i re-installed the script but it doesn't want to work. i followed the install to the letter and this is all i get for starting up the interface.
> 
> ```
> 
> *bringing wlan0 up
> ...

 

ok then how do i upgrade the base layout without fucking the install like last time?

----------

## UberLord

 *truekaiser wrote:*   

> 
> 
> ok then how do i upgrade the base layout without fucking the install like last time?

 

After emerging, you occasionally have to update configuration files in /etc

etc-update takes care of this - but you have to be careful as it overwrites files with origonal files from the package.

If this happens you have some choices

1. Replace the file and modify it to match your system

2. Remove the new file as you don't want it. The file name would be something like ._cfg0000hosts. You can remove that file and etc-update won't overwrite your current hosts file in an emerge

Key files that you should never have to change are /etc/fstab, /etc/hosts, /etc/group

If you don't like etc-update - and many people don't then there are alternatives as described in the forum

https://forums.gentoo.org/viewtopic.php?t=29045

----------

## davecs

Uberlord - I'm completely lost here.

I have done the e-build, and emerged it. That went OK. I did the etc-update (I cocked up fstab many moons ago, never again!).

My problem is that I don't want to set my wlan up on eth0, I want it on eth1, and your instructions seem to relate totally to eth0 (ie net.eth0 etc).

My main computer is a shuttle, connected to the internet via ethernet and cable. It also has a wireless lan interface build in, connected internally to a spare USB header, the driver is Intersil/Prism3, and I have installed the necessary modules via linux-wlan-ng, and hotplug does the job here, as it is automatically loaded though not in my modules.autoload.d/kernel-2.6 list.

I have a laptop and this has wireless lan built in also. It is also Prism3, also internally connected via USB. My aim is to occasionally allow it to exchange data with the main computer so that I can get on the internet from another part of the house (with the main computer switched on) and exchange files. I am told the simplest solution is an Ad-Hoc setup.

My cable internet connection is done using DHCP.

Suppose for example my /etc/hosts file contained:

127.0.0.1 localhost

192.168.0.5 hickory.dock hickory #laptop

192.168.0.6 dickory.dock dickory #main computer

and my WEP was abcd-efgh-ijkl-mnop-qrst-uvwx-yz

(they are not, but you know...)

How would I set up /etc/conf.d/wireless ?

----------

## SPW

Can anyone tell me how secure it is to disable WEP and WPA and disable ESSID broadcasting. If the ESSID is not broadcasted, my access point should be invisible to everybody? And then the ESSID can be used as some sort of a password. What do you think? Is this really foolish?

----------

## UberLord

 *davecs wrote:*   

> 
> 
> My problem is that I don't want to set my wlan up on eth0, I want it on eth1, and your instructions seem to relate totally to eth0 (ie net.eth0 etc).

 

Oh thats easy

You need to softlink net.eth0 to net.eth1 so that when a new baselayout gives you a new net.eth0 script, net.eth1 also gets it  :Smile: 

```
ln -sf /etc/init.d/net.eth0 /etc/init.d/net.eth1
```

After that, just change references in /etc/conf.d/net and /etc/conf.d/wireless to read eth1 instead of eth0

 *Quote:*   

> 
> 
> My main computer is a shuttle, connected to the internet via ethernet and cable. It also has a wireless lan interface build in, connected internally to a spare USB header, the driver is Intersil/Prism3, and I have installed the necessary modules via linux-wlan-ng, and hotplug does the job here, as it is automatically loaded though not in my modules.autoload.d/kernel-2.6 list.
> 
> I have a laptop and this has wireless lan built in also. It is also Prism3, also internally connected via USB. My aim is to occasionally allow it to exchange data with the main computer so that I can get on the internet from another part of the house (with the main computer switched on) and exchange files. I am told the simplest solution is an Ad-Hoc setup.
> ...

 

dickory

```

essid_eth1="dickory"

mode_eth1="ad-hoc"

key_dickory="abcd-efgh-ijkl-mnop-qrst-uvwx-yz"

```

hickory

```

essid_eth1="hickory"

mode_eth1="ad-hoc"

key_hickory="abcd-efgh-ijkl-mnop-qrst-uvwx-yz"

```

Simple eh?

I assume that you can setup /etc/conf.d/net to match your network settings

----------

## UberLord

 *SPW wrote:*   

> Can anyone tell me how secure it is to disable WEP and WPA and disable ESSID broadcasting. If the ESSID is not broadcasted, my access point should be invisible to everybody? And then the ESSID can be used as some sort of a password. What do you think? Is this really foolish?

 

It would be invisible to mom and pop but not to wardrivers.

I tend to broadcast my ESSID, but I use WEP and MAC address filtering on my AP. I also change my WEP keys on a regular basis. I also try and ensure that all important traffic is encrypted using SSL as WEP can be broken.

----------

## SPW

 *UberLord wrote:*   

> I also try and ensure that all important traffic is encrypted using SSL as WEP can be broken.

 

Well, traffic between computers on my network is only done via SSH, so I guess the biggest security hazard for me is people wanting a free ride by using my bandwidth for free?

----------

## UberLord

 *SPW wrote:*   

>  *UberLord wrote:*   I also try and ensure that all important traffic is encrypted using SSL as WEP can be broken. 
> 
> Well, traffic between computers on my network is only done via SSH, so I guess the biggest security hazard for me is people wanting a free ride by using my bandwidth for free?

 

Yep.

And any other resources like printing, etc.

----------

## iverson0881

UberLord do you think there is any way you can implement a delay in the script for those of who are unable to get a DHCP request in a timely manner. 

For me at least the script will run perfect once i'm in linux and run it manually but sometimes it'll just crap out and give me no internet which thus leads me to start it manually. 

Do you think you could maybe add a feature in the script that would allow you to have a delay time in the DHCP request for maybe 10 or so seconds which would be more than enough time for my router to assign to my pc an IP. 

Thanks 

iverson0881

----------

## truekaiser

ok i got the normal output by re-emergeing the base layout and only etc-update ing the net.eth0 file. this is the output

```
[32;01m*[0m Running preup function

 [32;01m*[0m   Configuring wireless network for wlan0

 [32;01m*[0m   Scanning for access points

 [32;01m*[0m     Found "key:on" (WEP required)

 [33;01m*[0m   WEP key is not set for key:on - not connecting

 [31;01m*[0m Couldn't associate with any access points

 [31;01m*[0m Failed to configure wireless for wlan0

 [31;01m*[0m preup wlan0 failed

```

ok so i think i enter my wep key worng so i disable wep in the router and comment out the wep line in wireless

```
[32;01m*[0m Running preup function

 [32;01m*[0m   Configuring wireless network for wlan0

 [32;01m*[0m   Scanning for access points

 [32;01m*[0m     Found "key:off" (WEP required)

 [33;01m*[0m   WEP key is not set for key:off - not connecting

 [31;01m*[0m Couldn't associate with any access points

 [31;01m*[0m Failed to configure wireless for wlan0

 [31;01m*[0m preup wlan0 failed

```

i get the same error as before just with key:off instead of on?

the config files are the same as i posted above

----------

## SPW

 *UberLord wrote:*   

>  *SPW wrote:*   
> 
> Well, traffic between computers on my network is only done via SSH, so I guess the biggest security hazard for me is people wanting a free ride by using my bandwidth for free? 
> 
> Yep.
> ...

 

What about MAC filtering? If I only allow access to NICs that I know, will I be safe that nobody else can enter into my network? WEP an WPA are quite difficult to configure so I want to avoid them.

----------

## UberLord

 *truekaiser wrote:*   

> ok i got the normal output by re-emergeing the base layout and only etc-update ing the net.eth0 file. this is the output
> 
> ```
> [32;01m*[0m Running preup function
> 
> ...

 

I was afraid of that.

I introduced some new scanning code to detect encryption but looks like it's gone slightly wrong

Could you post the entire output of

```
ifconfig wlan0 up

iwlist wlan0 scan
```

please?

----------

## UberLord

 *iverson0881 wrote:*   

> UberLord do you think there is any way you can implement a delay in the script for those of who are unable to get a DHCP request in a timely manner. 
> 
> For me at least the script will run perfect once i'm in linux and run it manually but sometimes it'll just crap out and give me no internet which thus leads me to start it manually. 
> 
> Do you think you could maybe add a feature in the script that would allow you to have a delay time in the DHCP request for maybe 10 or so seconds which would be more than enough time for my router to assign to my pc an IP. 
> ...

 

You can add that function yourself  :Smile: 

Edit /etc/conf.d/net and goto the preup() function

After the wireless line, put "sleep 10" on a new line

This causes a sleep of 10 seconds before the next statement is executed.

Alternatively, alter the dhcpcd options for your iface in /etc/conf.d/net or your essid in /etc/conf.d/wireless to increase the timeout

dhcpcd_eth0="-t 10"

will timeout after 10 seconds.

----------

## UberLord

 *SPW wrote:*   

> 
> 
> What about MAC filtering? If I only allow access to NICs that I know, will I be safe that nobody else can enter into my network? WEP an WPA are quite difficult to configure so I want to avoid them.

 

MAC filtering means that they cannot enter the network unless then spoof their MAC address to match one that's allowed in.

However, they can still "sniff" the data travelling wirelessly - hence WEP although tricky is always a good idea still.

Depends how paranoid you are really!

----------

## truekaiser

as requested

```
ifconfig wlan0 up
```

doesn't output anything though this is what ifconfig wlan0 shows after that command

```

wlan0     Link encap:Ethernet  HWaddr 00:90:4B:6F:03:D4  

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

          Interrupt:11 Memory:faffc000-faffdfff 

```

as for

```
iwlist wlan0 scan
```

```
wlan0     Scan completed :

          Cell 01 - Address: 00:0D:88:98:3E:20

                    ESSID:"wscale"

                    Protocol:IEEE 802.11b

                    Mode:Managed

                    Frequency:2.437GHz

                    Quality:0/100  Signal level:-26 dBm  Noise level:-256 dBm

                    Encryption key:on

                    Bit Rate:1Mb/s

                    Bit Rate:2Mb/s

                    Bit Rate:5.5Mb/s

                    Bit Rate:11Mb/s

                    Bit Rate:6Mb/s

                    Bit Rate:12Mb/s

                    Bit Rate:24Mb/s

                    Bit Rate:36Mb/s

                    Bit Rate:9Mb/s

                    Bit Rate:18Mb/s

                    Bit Rate:48Mb/s

                    Bit Rate:54Mb/s

```

it's a d-link di-624(rev c) running the latest firmware if your wondering.

 *Quote:*   

> Depends how paranoid you are really!

 

isn't your paranoia inversely proportinal to the amount of data you want to protect?

----------

## UberLord

 *truekaiser wrote:*   

> 
> 
> ```
> iwlist wlan0 scan
> ```
> ...

 

What I really hate about wireless-tools is that the output changes a fair bit. On mine, ESSID appears after Encryption key - which is the cause of the error you're seeing.

New ebuild coming

----------

## UberLord

NEW EBUILD POSTED

Fix to scanning code

... The order of things appears to vary a bit from scan listings, so I've added code to fix this.

----------

## allucid

hey i have a quick question if you don't mind:

Will this script allow me to have different configurations based on essid?

For example, I use wireless in three different locations:

essid: "Location1"

key: none

channel: 11

essid: "Location2"

key: 0123456789abcdef

channel: 6

esside: "Location3"

key: abcdef0123456789

channel: 6

Basically I was wondering if it would scan for "Location1", "Location2", and "Location3" and then use the correct settings depending on which essid is available. I donwloaded the script but I couldn't figure out how to set this up.

----------

## Rhysem

Finally updated my wireless config stuff (and ipw2100).

Both are working perfectly. I just thought I'd share that for ya, UberLord.

:-)

----------

## Adam Page2

Question: Can I run one of these scripts in the install to setup my netgear 802.11 for bootstrapping?  If so, do I just emerge the ebuild as usual or is there a different setup if it's for an installation?

----------

## UberLord

 *allucid wrote:*   

> hey i have a quick question if you don't mind:
> 
> Will this script allow me to have different configurations based on essid?
> 
> For example, I use wireless in three different locations:
> ...

 

Yes!

Here's a config

```
key_Location2="0123456789abcdef"

key_Location3="abcdef0123456789"
```

That assumes that you work in managed mode. As you can see, it's very simple  :Smile: 

----------

## UberLord

 *Adam Page wrote:*   

> Question: Can I run one of these scripts in the install to setup my netgear 802.11 for bootstrapping?  If so, do I just emerge the ebuild as usual or is there a different setup if it's for an installation?

 

I'm not certain that you can emerge before bootstrapping.

However, as my stuff doesn't require GCC it shouldn't be too hard

Simply download the tarball of the current version ({$P}.tar.bz2 - so the current one is wireless-config-0.3.1.tar.bz2) and open it. Put wireless.sh into /etc/init.d and wireless into /etc/conf.d

The next manual step is to patch /etc/conf.d/net to use wireless

```
source /etc/init.d/wireless.sh

preup() {

   wireless_start ${1}

   return $?

}

```

Good luck!

----------

## UberLord

 *Rhysem wrote:*   

> Finally updated my wireless config stuff (and ipw2100).
> 
> Both are working perfectly. I just thought I'd share that for ya, UberLord.
> 
> 

 

 :Smile: 

----------

## Adam Page2

 *UberLord wrote:*   

>  *Adam Page wrote:*   Question: Can I run one of these scripts in the install to setup my netgear 802.11 for bootstrapping?  If so, do I just emerge the ebuild as usual or is there a different setup if it's for an installation? 
> 
> I'm not certain that you can emerge before bootstrapping.
> 
> However, as my stuff doesn't require GCC it shouldn't be too hard
> ...

 

and all i have to do is insert the text into those files and then run what command? it's a pcmcia (in case you didn't know, i'm sure you did) do i have to run netconfig or something after patching those files?

----------

## UberLord

 *Adam Page wrote:*   

> 
> 
> and all i have to do is insert the text into those files and then run what command? it's a pcmcia (in case you didn't know, i'm sure you did) do i have to run netconfig or something after patching those files?

 

Pretty much.

You will need to hand edit /etc/conf.d/wireless to match your wireless network though as netconfig doesn't support wireless. It's probably a good idea to run netconfig before altering /etc/conf.d/net as I think netconfig just overwrites the file!

To start and stop - it's the same as a network device. Infact it just "lays" wireless transparently over the top. So assuming that you have an ethernet card in your lappy, the pcmcia card will be either eth1, ath0 or wlan0.

Given the name, it's simple

```

/etc/init.d/net.eth1 start

/etc/init.d/net.eth1 stop

/etc/init.d/net.eth1 restart

```

You get the idea

pcmcia-cs package should start and stop net scripts when you insert/remove the card though.

Good Luck!

----------

## truekaiser

sorry for what i said earlyer, i am very sorry because your latest ebiuld works   :Very Happy: 

----------

## Adam Page

wireless-config-0.3.1.tar.bz2 <-- where exactly can i find this?

----------

## UberLord

 *truekaiser wrote:*   

> sorry for what i said earlyer, i am very sorry because your latest ebiuld works  

 

No problem  :Smile: 

----------

## UberLord

 *American Psycho wrote:*   

> wireless-config-0.3.1.tar.bz2 <-- where exactly can i find this?

 

http://rsm.demon.co.uk/~roy/downloads/wireless-config-0.3.1.tar.bz2

----------

## iverson0881

Ebuild 0.3.1 works with Baselayout 1.8.12.

iverson0881

----------

## UberLord

 *iverson0881 wrote:*   

> Ebuild 0.3.1 works with Baselayout 1.8.12.
> 
> 

 

net.eth0 hasn't changed for a few baselayouts now

----------

## UberLord

NEW EBUILD POSTED

Fixed a potential problem with the new scanning code and ESSID's containing the word "Address" or "Encryption key"

----------

## jinx

Hi,

I'm having problems getting the wireless to start at boot time correctly using your script.

The wireless card works fine, I have all required firmware etc  it's nothing to do with that.

The problem is that when the system boots I get:

```

* Running preup function

*    Wireless extensions not found for eth0

* Bringing eth0 up (192.168.1.127)                        [ok]

```

Before you ask - yes, I do have wireless extensions enabled in the kernel.

The trouble is that eth0 is my wired interface, and eth1 is my wifi interface.

If I run /etc/init.d/net.et1 restart   after booting, then the wifi starts fine.

What have I done wrong with the scripts/setup and would someone be so kind as to explain how to fix it  :Smile: 

Jinx

----------

## UberLord

Try this

```

rc-update del net.eth1

ln -sf /etc/init.d/net.eth0 /etc/init.d/net.eth1

rc-update add net.eth1 default

```

If you don't want the wired interface to start at boot, do this

```
rc-update del net.eth0
```

That should sort it.

If not, check the following Gentoo bug report

https://bugs.gentoo.org/show_bug.cgi?id=29512

----------

## Nigel Kochsualloe

my cisco aironet 350 on my dell 8200

fails to bring eth1 up

i installed Cisco ACU and it says 

"Card is not associated" then after a minute it will way

"card radio if disabled"

any clue?

----------

## davecs

I am trying to get a Prism3 compatible internal USB wlan started. I have a laptop which also has the same interface, and I hope to get both of them set up in the future. I have given my desktop the address 192.168.0.6 and my laptop 192.168.0.5 but to be honest I haven't a clue what I am doing, just trying to follow Uberlord's instructions and messing up big-time...

My output from lsmod contains the lines:

```
prism2_usb             76548  0

p80211                 29520  1 prism2_usb
```

I got these modules from linux-wlan-ng. As I am running the kernel gentoo-dev-sources-2.6.5r1, I emerged it using:

FEATURES="-sandbox" ACCEPT_KEYWORDS="~x86" emerge -a linux-wlan-ng

as I read the stable version does not support kernel 2.6, and the e-build itself advised me to disable the sandbox (and it would not build unless I did. The Intersil/Prism modules are not in the kernel.

My /etc/hosts file reads:

```
127.0.0.1       localhost

192.168.0.5   hickory.dock hickory

192.168.0.6   dickory.dock dickory

# IPV6 versions of localhost and co

::1 ip6-localhost ip6-loopback

fe00::0 ip6-localnet

ff00::0 ip6-mcastprefix

ff02::1 ip6-allnodes

ff02::2 ip6-allrouters

ff02::3 ip6-allhosts
```

The unhashed lines from /etc/conf.d/net are:

```
iface_eth0="dhcp"

iface_eth1="192.168.0.6 broadcast 192.168.0.255 netmask 255.255.255.0"

source /etc/init.d/wireless.sh

preup() {

        wireless_up ${1}

        return $?

}

predown() {

        wireless_down ${1}

        return $?

}
```

The unhashed lines from /etc/conf.d/wireless are:

```
essid_eth1="dickory"

mode_eth1="ad-hoc"

adhoc_essid_eth1="WLAN"

adhoc_channel_eth1="3"

key_trinity="open abcd-efgh-ijkl-mnop-qrst-uvwx-yz"
```

Output from /etc/init.d/net.eth1 start

```
 * Running preup function

 * The interface eth1 does not exist

 * preup eth1 failed
```

Other commands and their outputs copied from X terminal:

```
root /etc/init.d # ./wlan start

 * Starting WLAN devices...

FATAL: Module wlan0 not found.

message=lnxreq_ifstate

  ifstate=fwload

  resultcode=success

Reading S-record file /etc/wlan//prism2_ru.hex...

prism2dl: No such file or directory

prism2dl: Failed to read /etc/wlan//prism2_ru.hex, exiting.               [ ok ]

root /etc/init.d # ./wlan status

 * status:  started

root /etc/init.d # ./wlan restart

 * Shutting Down WLAN Devices...                                          [ ok ]

 * Starting WLAN devices...

FATAL: Module wlan0 not found.

message=lnxreq_ifstate

  ifstate=fwload

  resultcode=success

Reading S-record file /etc/wlan//prism2_ru.hex...

prism2dl: No such file or directory

prism2dl: Failed to read /etc/wlan//prism2_ru.hex, exiting.               [ ok ]

root /etc/init.d # ./wlan stop

 * Shutting Down WLAN Devices...                                          [ ok ]
```

 To be frank, I've read and re-read this and I cannot get my head around it at all, and I am fairly bright with most stuff, but I've never done networking, wireless or wired before, and I'm obviously missing something obvious.

 Anyone want to tell me what it is?

----------

## UberLord

 *davecs wrote:*   

> I am trying to get a Prism3 compatible internal USB wlan started. I have a laptop which also has the same interface, and I hope to get both of them set up in the future. I have given my desktop the address 192.168.0.6 and my laptop 192.168.0.5 but to be honest I haven't a clue what I am doing, just trying to follow Uberlord's instructions and messing up big-time...

 

It looks like my instructions have been followed.

It also looks like a problem with your linux-wlan-ng stuff.

Does an interface get installed when you start wlan?

Check 

```
ifconfig -a
```

If it does then I can help futher, if not then I would advise starting a new thread

----------

## UberLord

 *Nigel Kochsualloe wrote:*   

> my cisco aironet 350 on my dell 8200
> 
> fails to bring eth1 up
> 
> i installed Cisco ACU and it says 
> ...

 

I don't have any of those products.

What is the script output?

----------

## micmac

Hello,

I am glad your ebuild exists. Got my wireless items up and running in no time. Allthough I'm new to wireless. 

I think everything is installed correctly. But sometimes there is a problem with bringing the card up. Then it says that it seems the dhcpd has already been started. Well that's not the case. But there is a /var/run/dhcpcd-eth0.pid. When removing it by hand '/etc/init.d/net.eth0 start' brings up the card. Seems like the pid file had not been removed when the system was going down before.

Has anyone else this problem? Or any tips?

Thanks

mic

----------

## UberLord

 *micmac wrote:*   

> I think everything is installed correctly. But sometimes there is a problem with bringing the card up. Then it says that it seems the dhcpd has already been started. Well that's not the case. But there is a /var/run/dhcpcd-eth0.pid. When removing it by hand '/etc/init.d/net.eth0 start' brings up the card. Seems like the pid file had not been removed when the system was going down before.

 

Sounds like a problem with Gentoo's net.eth0

Why don't you post some output where it says dhcpcd has already been started.

----------

## SPW

 *UberLord wrote:*   

> MAC filtering means that they cannot enter the network unless then spoof their MAC address to match one that's allowed in.
> 
> 

 

Is there a way for them to find out WHICH MAC addresses are allowed in my network? When nobody know the MAC addresses that are allowed they cannot fake them.

----------

## UberLord

 *SPW wrote:*   

>  *UberLord wrote:*   MAC filtering means that they cannot enter the network unless then spoof their MAC address to match one that's allowed in.
> 
>  
> 
> Is there a way for them to find out WHICH MAC addresses are allowed in my network? When nobody know the MAC addresses that are allowed they cannot fake them.

 

That I don't know.

I would guess that they would have to break the WEP key and then do some hardcore data analysis on the wifi stream.

Possible - but very hard and very unlikely.

----------

## SPW

 *UberLord wrote:*   

>  *SPW wrote:*    *UberLord wrote:*   MAC filtering means that they cannot enter the network unless then spoof their MAC address to match one that's allowed in.
> 
>  
> 
> Is there a way for them to find out WHICH MAC addresses are allowed in my network? When nobody know the MAC addresses that are allowed they cannot fake them. 
> ...

 

I don't think that the breaking of a WEP key would be helpful as this information is never sent over the network. MAC filtering is configured on my router (I access the configuration via a webbrowser but with a wired machine) and the router only checks the MAC address when a NIC tries to login. MAC addresses should never be transmitted by wireless.

Anyway, thanks for the many useful responses in this thread.

----------

## davecs

 *UberLord wrote:*   

> 
> 
> Does an interface get installed when you start wlan?
> 
> Check 
> ...

 

Yes, something is being started, despite all the error messages, I just wonder whether it is being started properly.

ifconfig -a before I run /etc/init.d/wlan start outputs:

```
wlan0     Link encap:Ethernet  HWaddr 00:00:00:00:00:00

          BROADCAST MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
```

After I run /etc/init.d/wlan it outputs:

```
wlan0     Link encap:Ethernet  HWaddr xx:xx:xx:xx:xx:xx (valid Mac address)

          BROADCAST MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
```

Having started wlan, I get this message from /etc/init.d/net.eth1 start

```
 * Running preup function

 * The interface eth1 does not exist

 * preup eth1 failed
```

But this more hopeful one from /etc/init.d/net.wlan0 start

```
 * Running preup function

 *   Configuring wireless network for wlan0

 *   wlan0 does not support setting the mode to "managed"

 *   Scanning for access points

 * wlan0 does not support scanning!

 * You need to configure an ESSID in /etc/conf.d/wireless

 *     essid_wlan0="ESSID"

 *     (set to "any" to pick the strongest available access point)

 * or configure preferred_aps to force a list of access points

 * or configure defaulting to Ad-Hoc when Managed fails

 * Failed to configure wireless for wlan0

 * preup wlan0 failed
```

even though I have defined eth1 and have not defined wlan0 anywhere. So now I am totally confused!

----------

## Peter B.

Good morning everybody,

first let me say "thanks for this nice piece of script"... I have to admit not having read through all this pages - but I think, if you're using wireless.sh with an AP, it has to broadcast its ESSID... right? No possibility to connect to an AP by its MAC?

I found this one in this thread

 *Quote:*   

> [The ESSID] would be invisible to mom and pop but not to wardrivers.

 

Sure, agreed. But most people using wireless are like mom and pop (well at least there are some), so if you asked me, I don't want to bare the ESSID of my AP.

Took me some time to get behind this script (did I already praise it? Ah, okay... I did  :Wink:  ) and much more time to relearn the bash (I don't remember how often I already learned and forgot its syntax), but at last I'm at a point where I'm content with it.

There now exists a new parameterlist in my /etc/conf.d/wireless. Here's a

diff /etc/conf.d/wireless_old /etc/conf.d/wireless

```
> # A list with MAC_ESSID assignments for APs that don't braodcast their ESSID.

> # Careful! If a MAC fits to one of this list, the ESSID is overwritten with the

> # one from this assignment list, not minding if the AP is broadcasting its ESSID

> # or not.

> # MAC1, MAC2, ... are MAC addresses of APs with the form xx:xx:xx:xx:xx:xx

> # ESSID1, ESSID2, ... are ESSIDs of APs, enabling to connect to APs which don't

> # broadcast their ESSID by their MAC

> #mac2essid_list=("MAC1_ESSID1 MAC2_ESSID2")
```

And here we go with

diff /etc/init.d wireless_old.sh /etc/init.d/wireless.sh

```
> wireless_setup_mac_env() {

>       ## translates known MACs to their ESSIDs

>

>       mac_has_essid="no"

>       for ((i = 0; i < ${#mac2essid_list[@]}; i = i + 1)); do

>               local this_mac=`echo ${mac2essid_list[i]} | gawk -F_ '{print $1}'`

>               if [ "${this_mac}" == "${APs_mac}" ]; then

>                       essid_from_mac=`echo ${mac2essid_list[i]} | gawk -F_ '{print $2}'`

>                       mac_has_essid="yes"

>                       break

>               fi

>       done

> }

>

283c298

<       einfo "  Scanning for access points"

---

>       einfo "  Scanning for access points..."

317,318c332,334

<       local i=-1

<       local IFS=$'\n'

---

>       local i=0

>       local j=0

>       local IFS=$'\n'

319a336,342

>

>               if [ ${j} == 3 ];then

>                       i=$((${i} + 1))

>                       j=0

>               fi

>

>               ## ESSID names to array scan_APs

324,335c347,356

<               else

<                       t=`echo ${val} | gawk -F: '/Address/ {print $2}'`

<                       if [ ${#t} -gt 0 ]; then

<                               i=$((${i} + 1))

<                       fi

<                       t=`echo ${val} | gawk -F: '/Encryption key/ {print $2}'`

<                       if [ ${#t} -gt 0 ]; then

<                               if [ "off" == "${t}" ]; then

<                                       enc_APs[i]="no";

<                               else

<                                       enc_APs[i]="yes";

<                               fi

---

>                       j=$((${j} + 1))

>               fi

>

>               ## encryption reqs to array enc_APs

>               t=`echo ${val} | gawk -F: '/Encryption key/ {print $2}'`

>               if [ ${#t} -gt 0 ]; then

>                       if [ "off" == "${t}" ]; then

>                               enc_APs[i]="no";

>                       else

>                               enc_APs[i]="yes";

336a358,365

>                       j=$((${j} + 1))

>               fi

>

>               ## MAC addresses to array mac_APs

>               t=`echo ${val} | gawk -F:\  '/Address/ {print $2}'`

>               if [ ${#t} -gt 0 ]; then

>                       mac_APs[i]=${t};

>                       j=$((${j} + 1))

338a368,369

>

>       einfo "  ...${i+1} access point(s) detected"

396c427

<               local -a scan_APs enc_APs

---

>               local -a scan_APs enc_APs mac_APs

398a430,442

>               ## translate MACs to known APs' ESSIDs from config file for APs that don't broadcast ESSID

>               for ((i = 0; i < ${#mac_APs[@]}; i = i + 1)); do

>                       if [ -n ${mac_APs[i]} ]; then

>                               APs_mac="${mac_APs[i]}"

>                               wireless_setup_mac_env

>                               if [ "yes" == "${mac_has_essid}" ]; then

>                                       scan_APs[${i}]="${essid_from_mac}"

>                                       ewarn "    Overriding ESSID for AP ${i} to \"${essid_from_mac}\" with MAC ${APs_mac} from list of known MAC addresses"

>                               fi

>                       fi

>               done

>

405c449

<                       einfo "    Found \"${scan_APs[i]//\\\\/\\\\}\" ${keyreq}"

---

>                       einfo "    AP ${i}: ${mac_APs[i]} \"${scan_APs[i]//\\\\/\\\\}\" ${keyreq}"

412a457

>                                       einfo "    Connecting to preferred access point \"${scan_APs[j]}\" with MAC ${mac_APs[j]}"
```

You'll recognize that I varied the AP scan part, since I do not look through the original indexing. It might be less elegant but it's better understandable for a simple person like me.

There is some more iformation output I put in, which one may find needless... well... I'm happy if penguin's talking to me  :Smile: 

Just put this part here for anyone, who likes to connect to APs which aren't broadcasting ESSID.

Next point is a question (that was obvious, wasn't it?): I'm using WEP with open keys, and by using "key_ESSID=open 0000-." (and so on, the key is right, I will abbreviate it i.t.f.) in /etc/conf.d/wireless I'm getting (by commenting out devnull and echoing the line of script, which sets the key)

```
 /usr/sbin/iwconfig ath0 key open 0000-.

Error for wireless request "Set Encode" (8B2A) :

    invalid argument "open 000-.".

 *   ath0 does not support setting keys

 *   or the parameter "key_ESSID" is incorrect
```

/usr/sbin/iwconfig ath0 key open 0000-. (copy and paste; the same command as stated by wireless.sh) works fine from shell and enables the card (using the Atheros Chip with 11abg with madwifi by the way) to connect.

If there's just "key_ESSID=0000-." in /etc/conf.d/wireless, the script connects alright, too. So not really a problem... just wondering if anyone could explain this to me?

Well - enough for tonight (3am here...) - take care everybody,

Peter.

----------

## UberLord

 *davecs wrote:*   

> 
> 
> After I run /etc/init.d/wlan it outputs:
> 
> ```
> ...

 

You don't define eth1 at all as the kernel driver chooses it's name (eth, wlan) and the kernel then assigns it a number. So although you may like eth1, the kernel has decided it's wlan0 wether you like it or not.

Now, it looks like there's a problem with your driver for your USB card. You need to get that working without error messages before trying to start the interface via net.wlan0

I suggest you ask in the Hardware forum

----------

## UberLord

Thanks for the info Peter B.

I'll see if I can do something for you soon  :Smile: 

----------

## Peter B.

My problem solved automagically... I never saw the following

 *Quote:*   

>  /usr/sbin/iwconfig ath0 key open 0000-. 
> 
>  Error for wireless request "Set Encode" (8B2A) : 
> 
>      invalid argument "open 000-.". 
> ...

 

again after a reboot with key_ESSID="open key". Guess the script I used before preup wireless.sh from net.eth0 set the parameters to ath0 by iwconfig way different (maybe another sequence?) and somehow conflicted with the way settings are set by wireless.sh (that doesn't sound to probable to you? To me neither... however it's fixed.)

Thanks for reading - 

P.Last edited by Peter B. on Sat May 08, 2004 3:54 pm; edited 1 time in total

----------

## UberLord

NEW EBUILD POSTED

You can now map an ESSID from a MAC address

This only works if the AP is not broadcasting it's ESSID

The new config parameter is

essid_001122334455="ESSID"

where 001122334455 is the MAC address of the AP and ESSID is the ESSID it's broadcasting

----------

## Peter B.

Wow, 

that was fast! Obviously you liked my idea - happy to see that. Mapping the ESSID by a string is certainly better - well done, Uber.

But (as so often) there's not only praise (I suppose, you're either broadcasting your ESSID or don't have a SMC hardware AP and therefore could not hit on the 2nd point  :Wink:  ):

1)

 *Quote:*   

> where 001122334455 is the MAC address of the AP and ESSID is the ESSID it's broadcasting

 you certainly wanted to say

"[...] is the ESSID when the AP's not broadcasting"?

2)

My AP's ESSID is found as " " by wireless.sh and therefore the ESSID isn't overwritten by MAC assignment in config file (AP is a SMC2804WBRP-G). I don't know if the whiteblank comes from any parsing in wireless.sh or if my AP's just sending something it shouldn't - resulting in a whitespace as ESSID when broadcasting is off.

Since setting only whitespaces as ESSID isn't very reasonable (I doubt if it's supported by most APs anyway) I suggest the following change for consideration:

```
>if [ -z "${essid_APs[i]}" ]; then

<if [ -z "${essid_APs[i]//' '/}" ]; then
```

Thanks again for sourcing the ESSID<->MAP idea to your ebuild  :Smile: 

P.

----------

## UberLord

 *Peter B. wrote:*   

> Wow, 
> 
> that was fast! Obviously you liked my idea - happy to see that. Mapping the ESSID by a string is certainly better - well done, Uber.
> 
> 

 

No point in being slow!

Glad you like it  :Smile: 

 *Quote:*   

> 
> 
> My AP's ESSID is found as " " by wireless.sh and therefore the ESSID isn't overwritten by MAC assignment in config file (AP is a SMC2804WBRP-G). I don't know if the whiteblank comes from any parsing in wireless.sh or if my AP's just sending something it shouldn't - resulting in a whitespace as ESSID when broadcasting is off.

 

Unfortunately, " " is a valid ESSID - so I put a different test in.

See if this ebuild works 100% for you  :Smile: 

----------

## UberLord

NEW EBUILD POSTED

Fixed a problem with some ESSID reporting when the AP wasn't broadcasting the ESSID.

----------

## Peter B.

 :Rolling Eyes:  why oh why is my hardware always that proprietary?

don't know what the fixes are (I didn't find them and replaced the old wireless.sh so no diff...) but they can't solve my problem since the SMC2804WBRP-G replies with broadcast ESSID disabled

```
# ifconfig ath0 up

# iwlist ath0 scan

     ...

     ESSID:" "

     ...
```

HM. If " " can also be a valid broadcasted ESSID, then the way I suggested isn't a good one - agreed. Don't know if you want the way I solved it at last (or something better?) in your ebuild due to some stubborn AP, but this could be a possibility:

in /etc/conf.d/wireless

```
#essid_001122334455="ESSID"

# or you can override a broadcasted ESSID for an Access Point that

# sends a wrong ESSID for some reason (e.g. SMC2804WBRP-G sends " "

# as ESSID when its broadcasting is disabled) - 

# this also overrides essid_001122334455

#essid_forced_001122334455="ESSID"
```

the for-loop in /etc/init.d/wireless.sh

```

              for ((i = 0; i < ${#mac_APs[@]}; i = i + 1)); do

                        local keyreq=""

                        local mac=${mac_APs[i]//:/}

                        local forced_essid_from_mac=""

                        eval forced_essid_from_mac=\"\$\{essid_forced_${mac}\}\"

                        if [ "yes" == "${enc_APs[i]}" ]; then

                                keyreq="(WEP required)"

                        fi

                        if [ -z "${essid_APs[i]}" ]; then

                                einfo "    Found ${mac_APs[i]} ${keyreq}"

                                eval essid_APs[i]=\"\$\{essid_${mac}\}\"

                                if [ -n "${forced_essid_from_mac}" ]; then

                                        essid_APs[i]="${forced_essid_from_mac}"

                                fi

                                if [ -n "${essid_APs[i]}" ]; then

                                        einfo "      mapping ESSID to \"${essid_APs[i]//\\\\/\\\\}\""

                                fi

                        elif [ -n "${forced_essid_from_mac}" ]; then

                                einfo "    Found ${mac_APs[i]} ${keyreq}"

                                local old_essid="${essid_APs[i]}"

                                essid_APs[i]="${forced_essid_from_mac}"

                                if [ -n "${essid_APs[i]}" ]; then

                                        einfo "      forced ESSID mapping from \"${old_essid}\" to \"${essid_APs[i]//\\\\/\\\\}\""

                                fi

                        else

                                einfo "    Found \"${essid_APs[i]//\\\\/\\\\}\" at ${mac_APs[i]} ${keyreq}"

                        fi

                done
```

However - I attest you a really low response time  :Wink: 

----------

## UberLord

If you're not using the latest version of wireless-tools in portage - including ~x86 - could you try that first please.

Thanks!

----------

## AgenT

I am having some problems. Seems that it looks like everything is fine, but I cannot connect to anything.

First, /etc/conf.d/wireless:

```

essid_wlan0="WLAN"

mode_wlan0="Managed"

adhoc_essid_wlan0="WLAN"

adhoc_channel_wlan0="11"

iwconfig_eth0="192.168.2.5 broadcast 192.168.2.255 netmask 255.255.255.0"

gateway_WLAN="192.168.2.1"

```

/etc/conf.d/net:

```

iface_eth0="192.168.2.3 broadcast 192.168.2.255 netmask 255.255.255.0"

gateway="eth0/192.168.2.1"

iface_wlan0="192.168.2.5 broadcast 192.168.2.255 netmask 255.255.255.0"

source /etc/init.d/wireless.sh

preup() {

        wireless_up ${1}

        return $?

}

predown() {

        wireless_down ${1}

        return $?

}

```

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

```
 * Running preup function

 *   Configuring wireless network for wlan0

 *   Connecting to "WLAN" (WEP disabled)...      [ !! ]

 *     wlan0 connected as "WLAN" in ad-hoc mode

 *     on channel 11 (WEP disabled)

 * Bringing wlan0 up (192.168.2.5)...                [ ok ]

```

The problem seems that somehow the NIC is not seeing any router (which is turned on). Any suggestions? No security features are turned on, including no WEP, etc. Ad-Hoc, if I understand it correctly, is where the NIC is connected to another NIC directly, while Managed is where the NIC is hooked up to the router and is managed by it, correct?

----------

## UberLord

 *AgenT wrote:*   

> 
> 
> The problem seems that somehow the NIC is not seeing any router (which is turned on). Any suggestions? No security features are turned on, including no WEP, etc. Ad-Hoc, if I understand it correctly, is where the NIC is connected to another NIC directly, while Managed is where the NIC is hooked up to the router and is managed by it, correct?

 

Is the router also a wireless Access Point? If so then you should use Managed mode, otherwise you can only use Ad-Hoc mode. Ad-Hoc talks to another wifi card also running in Ad-Hoc mode. Maybe you should explain your network topolgy a bit.

Also, you can only have one active default gateway. Your network settings put both interfaces on the same subnet, so you should only have one of them active at a time. Stop one before starting the other.

----------

## AgenT

 *UberLord wrote:*   

>  *AgenT wrote:*   
> 
> The problem seems that somehow the NIC is not seeing any router (which is turned on). Any suggestions? No security features are turned on, including no WEP, etc. Ad-Hoc, if I understand it correctly, is where the NIC is connected to another NIC directly, while Managed is where the NIC is hooked up to the router and is managed by it, correct? 
> 
> Is the router also a wireless Access Point? If so then you should use Managed mode, otherwise you can only use Ad-Hoc mode. Ad-Hoc talks to another wifi card also running in Ad-Hoc mode. Maybe you should explain your network topolgy a bit.
> ...

 

I am currently trying to migrate from wires to air. I do have a wireless router as noted before. It is not in access point mode but instead in full router mode (that is, it does everything an access point does plus firewall, actual routing, etc.). My wired NIC's (both PC's) work fine with the router.

I only have one default gateway because that gateway should be my router. What is wrong with having two NIC's on the same subnet? And yes, I have tried just having the wireless NIC active and it will not ping anywhere (not even the router) nor can I ping the NIC (from another PC which is wired to the router). There is one strangeness however: it seems that the wireless NIC can be pinged if my wired NIC is active. Strange, but true! In fact, and this screams bad configuration, I can ping it after doing /etc/init.d/net.wlan0 stop! And yes, the wireless NIC does "stop" after doing that command. iwconfig shows that the ESSID is blanked after doing the stop (so at least there is something that happens when using stop). This is all a little too crazy I think  :Wink: 

----------

## UberLord

 *AgenT wrote:*   

> 
> 
> ```
> 
> iwconfig_eth0="192.168.2.5 broadcast 192.168.2.255 netmask 255.255.255.0"
> ...

 

iwconfig_eth0 is for wireless commands, but you specified an ifconfig command! It won't solve your problem, but I thought I should point it out.

If your driver supports scanning, why not unset essid_wlan0 and then broadcast your ESSID from your AP. See if that works

----------

## AgenT

 *UberLord wrote:*   

>  *AgenT wrote:*   
> 
> ```
> 
> iwconfig_eth0="192.168.2.5 broadcast 192.168.2.255 netmask 255.255.255.0"
> ...

 

Thanks for pointing that iwconfig_eth0 out. Stupid mistake on my part.

I tried what you suggested and here is the error (I disabled ad-hoc fallback - AP has SSID broadcast turned on):

```

 * Running preup function

 *   Configuring wireless network for wlan0

 *   Scanning for access points

 *     Found XX:XX:XX:XX:XX:XX

 * Couldn't associate with any access points

 * Failed to configure wireless for wlan0

 * preup wlan0 failed

```

Found line blanked by me. But the MAC does not match the router, which is strange. Or does that Found line mean something else?

Also, not exactly sure what my NIC supports because it is being used under ndiswrapper. It is "officially" supported by ndiswrapper. This is why I would rather just hand code ip, essid, etc. just to eliminate problems with scanning (if there are any).

----------

## UberLord

 *AgenT wrote:*   

> 
> 
> Found line blanked by me. But the MAC does not match the router, which is strange. Or does that Found line mean something else?
> 
> Also, not exactly sure what my NIC supports because it is being used under ndiswrapper. It is "officially" supported by ndiswrapper. This is why I would rather just hand code ip, essid, etc. just to eliminate problems with scanning (if there are any).

 

No, found means that's the MAC address it's found to connect to. Your output also shows that it's not broadcasting an ESSID. Why not try turning it on - it maybe someone elses wireless that you're picking up.

----------

## Peter B.

 *UberLord wrote:*   

> If you're not using the latest version of wireless-tools in portage - including ~x86 - could you try that first please.
> 
> Thanks!

 

Latest version available: 27_pre22

Latest version installed: 27_pre22

I have ~x86 in make.conf and did an emerge system one week ago - so the system should be pretty up to date.

----------

## AgenT

 *UberLord wrote:*   

>  *AgenT wrote:*   
> 
> Found line blanked by me. But the MAC does not match the router, which is strange. Or does that Found line mean something else?
> 
> Also, not exactly sure what my NIC supports because it is being used under ndiswrapper. It is "officially" supported by ndiswrapper. This is why I would rather just hand code ip, essid, etc. just to eliminate problems with scanning (if there are any). 
> ...

 

What do you mean turn on ESSID broadcasting? As I mentioned, the router's SSID broadcasting is on and has always been on.  Or do you mean the NIC should broadcast as well (I was not aware that they could broadcast)?

I just noticed that the "Found" MAC is the mac of the NIC itself. I guess it found itself  :Sad: 

Any further ideas?

----------

## UberLord

 *AgenT wrote:*   

> What do you mean turn on ESSID broadcasting? As I mentioned, the router's SSID broadcasting is on and has always been on.  Or do you mean the NIC should broadcast as well (I was not aware that they could broadcast)?
> 
> I just noticed that the "Found" MAC is the mac of the NIC itself. I guess it found itself 
> 
> Any further ideas?

 

Well, the card finding itself is mighty odd. Try enabling 

```
scan_mode_wlan0="Ad-Hoc"
```

and see what that does.

Also, try increasing the value of sleep_scan_wlan0 as the card may have to wait abit once it's up before it finds the AP.

Aside from that I'm all out of ideas  :Sad: 

----------

## UberLord

 *Peter B. wrote:*   

> Latest version available: 27_pre22
> 
> Latest version installed: 27_pre22
> 
> I have ~x86 in make.conf and did an emerge system one week ago - so the system should be pretty up to date.

 

I'll think about a solution for you. I'll probably end up forcing ESSID's to MAC's - but I'm not happy with it. I'll sleep on it.

----------

## AgenT

 *UberLord wrote:*   

>  *AgenT wrote:*   What do you mean turn on ESSID broadcasting? As I mentioned, the router's SSID broadcasting is on and has always been on.  Or do you mean the NIC should broadcast as well (I was not aware that they could broadcast)?
> 
> I just noticed that the "Found" MAC is the mac of the NIC itself. I guess it found itself 
> 
> Any further ideas? 
> ...

 

Nope, nothing  :Sad:  Also played with the other settings.

Worthless cards... time to get a real wireless card that has a real FOSS driver. Speaking of which, are there good wireless card databases that show which are Linux/OSS friendly?

----------

## UberLord

http://prism54.org/supported_cards.php

http://www.linux-wlan.org/docs/wlan_adapters.html.gz

http://madwifiwiki.thewebhost.de/wiki/WifiCards

I use a NetGear WG311 myself running a recent CVS snapshot of the madwifi driver. Works very very well  :Smile: 

----------

## UberLord

@ Peter B.

Could you post up the exact output of 

```
iconfig ath0 up

iwlist ath0 scan
```

Also, are you using a recent CVS version of the madwifi driver?

----------

## AgenT

 *UberLord wrote:*   

> http://prism54.org/supported_cards.php
> 
> http://www.linux-wlan.org/docs/wlan_adapters.html.gz
> 
> http://madwifiwiki.thewebhost.de/wiki/WifiCards
> ...

 

Thanks a lot for those websites. And thank you for all of your help.

There is no need for me to spend the extra cash on a g card and the b Netgear MA311 looks promising. It seems to work with three different drivers.

----------

## Peter B.

Hi Uber,

indeed I was not using the cvs madwifi driver, but the one emerge gave me:

```
*  net-wireless/madwifi-driver

      Latest version available: 0.1_pre20040212
```

I rmmod ath_pci, ath_hal and wlan, unmerged madwifi-driver and did a cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/madwifi co madwifi some minutes ago. make install did its job, modprobe wlan, ath_hal and ath_pci went fine (I also checked by date of *.ko files that they are the ones just built) and so I now should have the latest version of madwifi-driver from cvs. However - didn't change the behaviour in any way - here's the complete output of iwlist ath0 scan:

```
bash-2.05b# ifconfig ath0 up

bash-2.05b# iwlist ath0 scan

ath0      Scan completed :

          Cell 01 - Address: xx:xx:xx:xx:xx:xx

                    Mode:Master

                    Encryption key:**

                    Quality=43/94  Signal level=-52 dBm  Noise level=-95 dBm

                    Mode:Master

                    ESSID:" "

                    Frequency:2.437GHz (channel 6)

                    Bit Rate:1Mb/s

                    Bit Rate:2Mb/s

                    Bit Rate:5Mb/s

                    Bit Rate:6Mb/s

                    Bit Rate:9Mb/s

                    Bit Rate:11Mb/s

                    Bit Rate:12Mb/s

                    Bit Rate:18Mb/s

                    Bit Rate:24Mb/s

                    Bit Rate:36Mb/s

                    Bit Rate:48Mb/s

                    Bit Rate:54Mb/s
```

As you can see, the SMC2804WBRP-G's ESSID is recognised as " " for some reason although its ESSID broadcasting is disabled. I don't know if this is due to some strange driver or wireless-tools behaviour or if the AP really sends " " - any idea how to check this?

Some other clever ideas?

Greetings, P.

--edit: I just counter-checked with the Window$ Installation on the same machine. It found the AP's ESSID as " ", too. So it isn't a specific madwifi / wireless-tools problem. Still could be the wireless card itself (although I doubt that) but since I have no other wireless card at hands, I can't check.

I'll probably be able to counter check with another wlan card this week (at least the next) and will post, if the ESSID is received as " " there, too. Then we can go for sure, that the SMC AP is sending a wrong ESSID with ESSID broadcasting disabled.

----------

## UberLord

Thats a real bummer  :Sad: 

I was curious as I use the madwifi driver and it works fine - ESSID isn't even on my list when I disable ESSID broadcasting.

Let me know if another wifi card works - if not then I guess I'll have to force MAC->ESSID translation...

EDIT: Out of curiosity, can you connect to ESSID " "?

```

ifconfig ath0 up

iwconfig ath0 essid " "

iwconfig ath0
```

If it connects, there should be a MAC address reported by iwconfig.

----------

## davecs

 *UberLord wrote:*   

> 
> 
> Now, it looks like there's a problem with your driver for your USB card. You need to get that working without error messages before trying to start the interface via net.wlan0
> 
> I suggest you ask in the Hardware forum

 

So if  I can get my driver sorted, what I've done should work? Maybe I should try a 2.4 kernel and see what happens...

----------

## UberLord

 *davecs wrote:*   

> So if  I can get my driver sorted, what I've done should work? Maybe I should try a 2.4 kernel and see what happens...

 

Should do. Get back when you have the driver sorted  :Smile: 

----------

## Peter B.

 *UberLord wrote:*   

> 
> 
> EDIT: Out of curiosity, can you connect to ESSID " "?
> 
> ```
> ...

 

Simple question - simple (if annyoing) answer: no.

Greets, P.

----------

## UberLord

 *Peter B. wrote:*   

> 
> 
> Simple question - simple (if annyoing) answer: no.
> 
> Greets, P.

 

 :Sad: 

Have you tried updating the firmware? I believe that 1.002 is the latest for your AP.

----------

## Peter B.

 *UberLord wrote:*   

> 
> 
> Have you tried updating the firmware? I believe that 1.002 is the latest for your AP.

 

one more annoying answer:

```
Runtime Code Version: 

  v1.002 (Dec 11 2003 20:09:41)
```

Nevertheless friendly greets  :Wink: 

Don't bother about that AP if you feel bad with it... still to check here if it's the wifi / AP combination (but what if so? Someone else might stumble about that, too... I think you have the choice of either respecting proprietary behaviour or leave it out of the ebuild) - 

take care, P.

----------

## legokloss

I installed your latest script earlier today and I must say I'm impressed where this has gone to (I belive it were your scripts in an earlier stage I have tried before (settings in /etc/conf.d/net instead of /etc/conf.d/wireless and so on).

I like the idea where I can set different ifconfig and such settings for each ESSID, but I got one problem. I set in /etc/conf.d/wireless: ifconfig_MYESSID="dhcp" and dhcpcd_MYESSID="-h myhostname". This is because I use ddns and want to update it with dhcpcd. I get a IP address, but the hostname is not set up.  (ping myhostname gives me unknown host). I have also tried and set it in /etc/conf.d/net, but dosn't work there either after installing your script and I know it worked before. What can this be?

Keep up the good work!

[EDIT]

To fast there. The script was not the problem. Don't know what was wrong. Worked after a restart. Thanks for a good script!

----------

## tranzdanz

Hi everyone,

I have a D-Link DWL-650 v.M1 (Realtek chipset I think) using ndiswrapper under Kernel 2.6..3 I can see wlan0 under iwconfig and ifconfig wlan0 and there is some activity on the card but I cannot connect to my wireless router. I get no SSID even though it is being brodcasted by the router.

I just need some help getting to the last step to get a link up and DHCP going.

iwconfig results:

wlan0 IEEE 802.11b ESSID:""

      Mode:Auto Frequesncy:2.412Ghz Access Point: FF:FF:FF:FF:FF:FF

      Bit Rate:11Mb/s Tx-Power:20 dBm Sensitivity=0/3

      RTS thr:2432 B Fragment thr: 2432 B

      Encryption key:off

      Power Management: off

      Link Quality:100/100 Signal level:-95 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

Thanks in advance

----------

## UberLord

What we need is the scan results

```
ifconfig wlan0 up

iwlist wlan0 scan
```

----------

## tranzdanz

When I typed

```
ifconfig wlan0
```

I got nothing as you can see...

So I did and ifconfig wlan0 just to show what I do have running...

Here are my results.  

```
bash-2.05b# ifconfig wlan0 up

bash-2.05b# ifconfig wlan0

wlan0     Link encap:Ethernet  HWaddr 00:05:5D:98:54:23  

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

          Interrupt:11 Memory:11000000-11000024 

bash-2.05b# iwlist wlan0 scan

wlan0     No scan results

bash-2.05b# 

```

Thanks for the prompt reply!

----------

## AccordionGuy

This post is out of date: there is a better version on page 29

Here is a revised version of the test found in the wireless_wait_for_association() function of wireless.sh

```

local wireless_mac=`${IWCONFIG} ${IFACE} 2>/dev/null | gawk '/\<..:..:..:..:..:..\>/ {print}' | sed 's/^.*\<\(..:..:..:..:..:..\)\>.*$/\1/g'`

local wireless_quality=`${IWCONFIG} ${IFACE} | awk '/Link Quality:/{print}' | sed 's/^.*Link Quality:\(.*\)\\/100.*$/\1/g'`

if [ "${wireless_mac}" != "FF:FF:FF:FF:FF:FF" ] \

&& [ "${wireless_mac}" != "44:44:44:44:44:44" ] \

&& [ "${wireless_mac}" != "00:00:00:00:00:00" ] \

&& [ "${wireless_quality}" != "0" ]; then

   return 0

fi

```

I revised this because with the ipw2100 the original version of the test doesn't work.   The original version assumes the mac address will get set to a bogus number if the association fails.   The ipw2100 driver doesn't reset this mac number from the last association so if it ever associated with a valid ap then that number stays until the next association.  This is probably a bug in the driver, but it also seems like a missing feature of iwconfig.  iwconfig should give an easy way to see if an association is good.  

I found I could use the link quality, so the revised version has checks this value.  I'm not sure the new sed pattern will work with every adapter.  It assumes the link quality is always out of 100.  Also this assumes that every adapter has a link quality.Last edited by AccordionGuy on Wed May 12, 2004 8:09 pm; edited 2 times in total

----------

## wabben

I am having an odd problem with my wireless card.  I'm using ndiwrapper 0.7 and uberlord's latest ebuild.  On boot everything loads fine.  DHCP assigns an IP address.  Despite having the IP address and connecting to the access point, I am unable to connect to any websites.

I'm able to connect to the access point in windows XP and thereby connect to the internet okay, so  the card is at least working.  I just can't figure out why I can connect to the access point in Gentoo but not the internet.

Any suggestions?  

I

----------

## wabben

I figured it out -sort of.  It seems that having shorewall running keeps me from connecting to the internet.  If I stop it, then I can access the internet.  The problem is now that I would like to have a firewall up while I am online.  Any ideas on how to configure it so that I am not having this conflict?

----------

## UberLord

 *tranzdanz wrote:*   

> 
> 
> ```
> 
> bash-2.05b# iwlist wlan0 scan
> ...

 

Well, that's the problem right there!

How you go about solving it I don't know

Can you associate with it? 

```
iwconfig wlan0 essid YOUR_ESSID

iwconfig wlan0
```

----------

## kosine

I configed the wireless according to this post, it runs well.

but when in office I should use  normal ethernet connection

I used  

```

/etc/init.d/net.eth1 stop // wireless

/etc/init.d/net.eth0 start //1000M ethernet

```

but doesn't work.

so I used

```

rc-update delete net.eth1 

rc-update add net.eth0 default

```

still doesn't work

so I restart eth0

/etc/init.d/net.eth0 restart //1000M ethernet

and tells me that wireless extensions not found for eth0 ??

but my wireless is eth1

and also here is an error

/sbin/runscript.sh: line 76: (( i -lt 0: syntax error in expression (error token is "0")

How to switch between them ?

or use one in office another at home ?

Thank you!

----------

## UberLord

 *kosine wrote:*   

> I configed the wireless according to this post, it runs well.
> 
> but when in office I should use  normal ethernet connection
> 
> I used  
> ...

 

You need ifplugd instead of having net.eth0 in the default runlevel

You may or may not need to configure it for net.eth1 depending on how your wireless is layed out.

 *Quote:*   

> 
> 
> /sbin/runscript.sh: line 76: (( i -lt 0: syntax error in expression (error token is "0")
> 
> 

 

Thats an error in the baselayout you have.

```

emerge sync

emerge baselayout

```

should fix that

----------

## wads

I think I'm doing something wrong.  I configued all my own stuff on my old Fedora box, but opted for the wireless-config scripts with Gentoo becasue frankly, I'm still a bit confused regarding where to put things on this system.

In any case, I emerged the scripts, which seemed to install and then gave me the following message:

```

 * To complete installation, you must

 * 1. Update your configuration files:

 *      etc-update

 * 2. Patch your net config to load wireless:

 *     ebuild /var/db/pkg/net-wireless/wireless-config-0.4.1/wireless-config-0.4.1.ebuild config

 * 3. Edit the wireless configuration file to match your network

 *      nano /etc/conf.d/wireless
```

1) I'm glad I didn't just do the universal update as it would have hosed my fstab, et al.  Wasn't entirely sure what I should do, so I created a copy of the eth0 file and renamed it to ath0, i.e. ._cfg0000_net.ath0.

2)  Ran this.  That seemed fine.

3)  Edited /etc/conf.d/wireless to match my essid, channel, mode, and WEP key.

When I rebooted, I didn't get connected automatically.  Most of you seemed to zip through this problem-free, so I think I'm probably overthinking and missing something terribly obvious.

-David

----------

## UberLord

Has net.ath0 been added to the default runlevel?

If so, please post all output regarding net.ath0 from boot.

----------

## genzoo

woohoo Finally , I got my wireless on my HP Pavilion ZV5030CA work like a charm. It's been a week trying to get this Broadcom 43960 card to work. I also tried both of drivers on ndiswrapper website but they don't work for me then I tried the driver comes with my laptop. It doesn't work either .. hmm .. since I used bcmwl5.inf file as I read on some instructions somewhere. It _should_ be bcmwl5a.inf instead.

....

----------

## wads

 *Quote:*   

> Has net.ath0 been added to the default runlevel? 
> 
>  If so, please post all output regarding net.ath0 from boot.

 

That was one of the problems.  The other was in my wireless config file.  I didn't change ESSID to my essid when setting up WEP:

```
was:  key_ESSID="open s:MyKey"

is:   key_MyEssid="open s:MyKey"
```

Works now!  Thanks so much.  One oddity though.  I get connected at a rate of 36M.  Using iwconfig at the command line, I can set the rate to 54M, but this doesn't seem to work in the wireless script.  The line in the file:

```
iwconfig_ath0="rate 54M"
```

The message: 

 *Quote:*   

> 
> 
> * Running preup function
> 
>  *   Configuring wireless network for ath0
> ...

 

iwconfig ath0 shows "Bit Rate:36Mb/s"

Thoughts?

-David

----------

## iverson0881

 *wads wrote:*   

>  *Quote:*   Has net.ath0 been added to the default runlevel? 
> 
>  If so, please post all output regarding net.ath0 from boot. 
> 
> That was one of the problems.  The other was in my wireless config file.  I didn't change ESSID to my essid when setting up WEP:
> ...

 

Hmm shouldn't it be:

```
rate 54MB
```

----------

## Peter B.

 *wads wrote:*   

> [...]  One oddity though.  I get connected at a rate of 36M.  Using iwconfig at the command line, I can set the rate to 54M, but this doesn't seem to work in the wireless script.  The line in the file:
> 
> ```
> iwconfig_ath0="rate 54M"
> ```
> ...

 

I'm using the Atheros chip here with 54M (or MB? Mb?), too. I might be wrong, but I believe to remember that I got connected with only 36 Mb/s when I used the madwifi driver emerged from gentoo.

I upgraded to the current cvs driver given by the madwifi project about one week ago and now iwconfig states without setting any rate a 54M connection. So even if I'm wrong it's definitively worth a try.

I posted the necessary steps to get the driver from cvs on page 28 of this long thread  :Wink: 

Good luck - P.

----------

## UberLord

Although I have an athereos 54m card, my AP is only 11m so I can't really test for speed   :Embarassed: 

I'll investigate the rate thing later today.

Peter B., I've also decided to force MAC->ESSID mapping as it's something that the user has to consiously do. So this should work with your AP for the next ebuild.

----------

## Peter B.

 *UberLord wrote:*   

> Peter B., I've also decided to force MAC->ESSID mapping as it's something that the user has to consiously do. So this should work with your AP for the next ebuild.

 

 :Cool:  Good news. I think, too, that if the user doesn't have to force and is given some straight words by the config comments, this is indeed rather a useful thing (at least it is for me  :Laughing: ) than a drawback for this script.

Thanks, P.

----------

## UberLord

NEW EBUILD POSTED

MAC->ESSID mapping now overrides any broadcast ESSID

Changed iwconfig and iwpriv error handling as they don't report errors consitently. This should fix the "rate 54m" some people were reporting - it wasn't actually an error.

----------

## wads

iverson0881:  I'm pretty sure it's 54M as the unit is Megabits/sec (Mbps), not Megabytes (MB).  Besides, 54M worked when setting the rate from iwconfig.

Peter B. wrote:

 *Quote:*   

> I upgraded to the current cvs driver given by the madwifi project about one week ago and now iwconfig states without setting any rate a 54M connection. So even if I'm wrong it's definitively worth a try. 

 

Peter, thanks for the thought.  I'm actually also using drivers built from cvs.

Uberlord wrote:

 *Quote:*   

> MAC->ESSID mapping now overrides any broadcast ESSID 
> 
> Changed iwconfig and iwpriv error handling as they don't report errors consitently. This should fix the "rate 54m" some people were reporting - it wasn't actually an error.

 

A couple of things.  First, I'm not so sure I understand what you mean.  In my case, I never had an error reported; rather, my rate was set to 36M, despite my having tried to set it to 54M.  Second, if the new ebuild will fix the aforementioned problem, what is that best way to emerge it?  Basically, I've become a bit paranoid after running etc-update and almost wiping out a bunch of stuff.

----------

## UberLord

 *wads wrote:*   

> 
> 
> A couple of things.  First, I'm not so sure I understand what you mean.  In my case, I never had an error reported; rather, my rate was set to 36M, despite my having tried to set it to 54M.  Second, if the new ebuild will fix the aforementioned problem, what is that best way to emerge it?  Basically, I've become a bit paranoid after running etc-update and almost wiping out a bunch of stuff.

 

Well, don't worry about the error then  :Wink: 

I would get used to etc-update or look into alternatives you have to use it or similar to update my ebuild.

Rule of thumb #1 - never allow etc-update to change /etc/group & /etc/fstab.

Then you can always reboot and login safely if anything else goes wrong

Rule of thumb #1 - most times it's best to allow etc-update to make the changes - but try and keep track of files you've changed like /etc/conf.d/net and /etc/conf.d/wireless so you can change them to match your system again.

A PITA I know, but that's Gentoo   :Confused: 

----------

## moonlight

Hello, I have allready tried a number of times to setup a wireless connection under my Gentoo linux, but still without succes. So finally I decided to contact the forum.

Please note that my wireless connection is working fine using Windows XP (

 :Rolling Eyes:  ).

My Linux config :

laptop / # emerge info

Portage 2.0.50-r6 (default-x86-1.4, gcc-3.3.3, glibc-2.3.3_pre20040207-r0, 2.6.5-gentoo)

=================================================================

System uname: 2.6.5-gentoo i686 Mobile Intel(R) Pentium(R) 4     CPU 2.80GHz

Gentoo Base System version 1.4.9

Autoconf: sys-devel/autoconf-2.59-r3

Automake: sys-devel/automake-1.8.3

ACCEPT_KEYWORDS="x86 ~x86"

AUTOCLEAN="yes"

CFLAGS="-O2 -mcpu=i686 -pipe"

CHOST="i686-pc-linux-gnu"

COMPILER="gcc3"

CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.1/share/config /usr/kde/3.2/share/config /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config /var/qmail/control"

CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"

CXXFLAGS="-O2 -mcpu=i686 -pipe"

DISTDIR="/usr/portage/distfiles"

FEATURES="autoaddcvs ccache"

GENTOO_MIRRORS="http://212.219.247.21/sites/www.ibiblio.org/gentoo/ http://212.219.56.131/sites/www.ibiblio.org/gentoo/ http://212.219.247.15/sites/www.ibiblio.org/gentoo/"

MAKEOPTS="-j2"

PKGDIR="/usr/portage/packages"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

PORTDIR_OVERLAY="/usr/local/portage"

SYNC="rsync://rsync.gentoo.org/gentoo-portage"

USE="X alsa apm arts avi berkdb cdr crypt cups encode esd foomaticdb gdbm gif gpm gtk2 imlib java jpeg kde libg++ libwww mad mikmod motif mozilla mpeg mysql ncurses nls oggvorbis opengl oss pam pdflib perl png python qt quicktime readline sdl slang spell ssl svga tcltk tcpd truetype x86 xml2 xmms xv zlib"

laptop / #

- net-wireless/wireless-tools -> 27_pre22

- net-wireless/wireless-config-0.4.2.ebuild 

- sys-apps/baselayout ->  1.8.11

My fixed network connection is interface eth0 and my wireless interface is eth1.

Kernel is configured with :

CONFIG_NET_RADIO=y

CONFIG_NET_WIRELESS=y

and

CONFIG_PRISM54=y

```

laptop / # lspci

03:05.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)

03:06.0 Network controller: Harris Semiconductor D-Links DWL-g650 A1 (rev 01)

laptop / #

```

/etc/conf.d/wireless:

```

essid_eth1="belkin54g"

adhoc_essid_eth1="belkin54g"

adhoc_channel_eth1="11"

```

/etc/conf.d/net:

```

iface_eth0="10.0.0.9 broadcast 10.0.0.255 netmask 255.255.255.0"

iface_eth1="dhcp"

iface_eth1="dhcp"

```

The output : 

```

laptop / # /etc/init.d/net.eth1 start

 * Running preup function

tr: misaligned [:upper:] and/or [:lower:] construct

tr: misaligned [:upper:] and/or [:lower:] construct

 *   Configuring wireless network for eth1

 *   Connecting to "belkin54g" (WEP disabled)...                                        [ !! ]

tr: misaligned [:upper:] and/or [:lower:] construct

 *     eth1 connected to "" in  mode

 *     on channel  (WEP disabled)

 * Bringing eth1 up via DHCP...                                                         [ !! ]

laptop / #

laptop / # iwconfig

plip0     no wireless extensions.

lo        no wireless extensions.

dummy0    no wireless extensions.

eth0      no wireless extensions.

eth1      NOT READY!  ESSID:"belkin54g"

          Mode:Ad-Hoc  Channel:11  Cell: 00:00:00:00:00:00

          Tx-Power=31 dBm   Sensitivity=0/200

          Retry min limit:0   RTS thr=-1 B   Fragment thr=-1 B

          Encryption key:off

          Link Quality:62  Signal level:0  Noise level:194

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

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

laptop / #

```

I don't know what's the next step, so any suggestion would be welcome. I am also a nOOB, so a detailed explanation would be appreciated, so I will learn at least something.

Cheers, Moonlight

----------

## truekaiser

well my wireless was working untill i updated to your 0.4.2 version.

this is what i get if i keep it in managed mode.

```
 [32;01m*[0m Running preup function

 [32;01m*[0m   Configuring wireless network for wlan0

 [32;01m*[0m   Connecting to "wscale" (WEP enabled)...

[A[73G  [34;01m[ [31;01m!![34;01m ][0m

 [31;01m*[0m wlan0 requires an ESSID to be set to operate in Ad-Hoc mode

 [31;01m*[0m Failed to configure wireless for wlan0

 [31;01m*[0m preup wlan0 failed
```

if i change it to ad-hoc it just hangs at dhcp.

it has the same settings as i had with the 0.3.1 version

----------

## AccordionGuy

Here is a new version of the test I posted before.  I'm posting the whole wireless_wait_for_association so it is easier to find this test.

To recap the version of this test in wireless.sh doesn't work for ipw2100 driver.  The ipw2100 driver doesn't set the mac address to a bogus value when it fails to associate.

The first version I posted would fail if your driver didn't support Link Quality, or if the link quality in your driver wasn't X/100.  This version fixes both of these shortcomings.

```

wireless_wait_for_association() {

   local counter=0

   while ((${counter} < (${sleep_associate_IFACE}))); do

      local wireless_mac=`${IWCONFIG} ${IFACE} 2>/dev/null | gawk '/\<..:..:..:..:..:..\>/ {print}' | sed 's/^.*\<\(..:..:..:..:..:..\)\>.*$/\1/g'`

      local wireless_quality=`${IWCONFIG} ${IFACE} | gawk '/Link Quality:/{print}' | sed 's/^.*Link Quality:\(.*\)\\/[0-9]*.*$/\1/g'`

      if [ "${wireless_mac}" != "FF:FF:FF:FF:FF:FF" ] \

      && [ "${wireless_mac}" != "44:44:44:44:44:44" ] \

      && [ "${wireless_mac}" != "00:00:00:00:00:00" ] \

      && ( [ -z "${wireless_quality}" ] || [ "${wireless_quality}" != "0" ] ); then

         return 0

      fi

      sleep 1

      counter=$((${counter} + 1))

   done

   return 1

}

```

----------

## Masi

Hi,

After one week without wireless I think it is wise to ask here.

The fact is, I can start my wireless connection, but it is very bad. Trying 'ping' I receive only around 5% of the packets back.

I couldn't find the reason why. The funny thing is: with gentoo 2004.0 and kernel 2.4 it worked, but now with gentoo 2004.1 and kernel 2.6.5 it is very bad.

I've got a IBM ThinkPad T40p 2373G1G with an IBM 11a/b Wi-Fi Wireless in it.

Here's what I did:

- enable wireless in kernel

- "emerge wireless-tools"

- "ACCEPT_KEYWORDS="~x86" emerge madwifi-driver"

- in "/etc/modules.autoload.d/kernel-2.6" I added:

wlan

ath_hal

ath_pci

- "gedit /etc/make.conf" and enable PORTDIR_OVERLAY with PORTDIR_OVERLAY="/usr/local/portage"

- "mkdir -p /usr/local/portage/net-wireless/wireless-config"

- "cd /usr/local/portage/net-wireless/wireless-config"

- "wget http://rsm.demon.co.uk/~roy/downloads/wireless-config-0.4.2.ebuild"

- "ebuild wireless-config-0.4.2.ebuild digest"

- "ebuild wireless-config-0.4.2.ebuild fetch"

- "ACCEPT_KEYWORDS="~x86" emerge net-wireless/wireless-config"

- "etc-update"

- "ebuild /var/db/pkg/net-wireless/wireless-config-0.4.2/wireless-config-0.4.2.ebuild config"

- "gedit /etc/conf.d/wireless" and there I set

essid_ath0="any"

mode_ath0="Managed"

This is what I get with "iwconfig":

```
lo        no wireless extensions.

 

ath0      IEEE 802.11  ESSID:"wgnetwork"

          Mode:Managed  Frequency:2.457GHz  Access Point: ##:##:##:##:##:##

          Bit Rate:11Mb/s   Tx-Power:off   Sensitivity=0/3

          Retry:off   RTS thr:off   Fragment thr:off

          Encryption key:off

          Power Management:off

          Link Quality:50/94  Signal level:-45 dBm  Noise level:-95 dBm

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

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

 

eth0      no wireless extensions.
```

And this with "iwlist ath0 scan"

```
ath0      Scan completed :

          Cell 01 - Address: ##:##:##:##:##:##

                    Mode:Master

                    Encryption key:off

                    Quality:48/94  Signal level:-47 dBm  Noise level:-95 dBm

                    Mode:Master

                    ESSID:"wgnetwork"

                    Frequency:2.457GHz

                    Bit Rate:1Mb/s

                    Bit Rate:2Mb/s

                    Bit Rate:5Mb/s

                    Bit Rate:11Mb/s

```

(I blanked the MAC addresses in this post here)

I would be happy for any help

----------

## AgenT

As I had mentioned a few days earlier, I was going to buy the Netgear MA311. Using the orinoco_pci module (built from kernel 2.6.x) the NIC seems to work great. Configuration, using UberLord's script, was painless. Thank you UberLord!

Quick question: what exactly is "Signal Level"? Reading the iwconfig man page does not give the results I wanted. I ask because here are my stats:

Link Quality:92/92  Signal level:5/153  Noise level:110/153

Seems like good "quality" but horrible "signal level".

----------

## UberLord

 *Masi wrote:*   

> Hi,
> 
> After one week without wireless I think it is wise to ask here.
> 
> The fact is, I can start my wireless connection, but it is very bad. Trying 'ping' I receive only around 5% of the packets back.
> ...

 

Well, if it's working then there's not much I can do.

If it works 100% under a 2.4 kernel then I recommend you go back to a 2.4 kernel and email the driver developers to let them know your problem.

----------

## UberLord

 *AgenT wrote:*   

> Quick question: what exactly is "Signal Level"? Reading the iwconfig man page does not give the results I wanted. I ask because here are my stats:
> 
> Link Quality:92/92  Signal level:5/153  Noise level:110/153
> 
> Seems like good "quality" but horrible "signal level".

 

I would assume signal level is how "powerful" or "strong" it is.

So this shows that you have a low power signal with a load of background noise and yet the link is still good? lol

Mind you, my link reports around 40% whereas I have good signal and noise levels. Still works though!

----------

## UberLord

 *AccordionGuy wrote:*   

> Here is a new version of the test I posted before.  I'm posting the whole wireless_wait_for_association so it is easier to find this test.
> 
> To recap the version of this test in wireless.sh doesn't work for ipw2100 driver.  The ipw2100 driver doesn't set the mac address to a bogus value when it fails to associate.
> 
> The first version I posted would fail if your driver didn't support Link Quality, or if the link quality in your driver wasn't X/100.  This version fixes both of these shortcomings.
> ...

 

I like that, but my iwconfig reports

```

Link Quality=46/94
```

You're checking for : instead of =

I assume that your code is correct for earlier wireless-tools? I have the latest unstable installed.

If you can get it to work with both then I'll merge your patch in  :Smile: 

EDIT: Never mind - I've got it working  :Smile: 

----------

## UberLord

 *truekaiser wrote:*   

> well my wireless was working untill i updated to your 0.4.2 version.
> 
> this is what i get if i keep it in managed mode.
> 
> ```
> ...

 

The 0.3.1 ebuild is still available - could you try that and see if it works again?

Either way, please let me know so I can diff the association check and fix it.

Thanks

----------

## UberLord

NEW EBUILD POSTED

Intergated AccordionGuy's patch for ipw2100

Fixed tr error

----------

## UberLord

 *moonlight wrote:*   

> 
> 
> I don't know what's the next step, so any suggestion would be welcome. I am also a nOOB, so a detailed explanation would be appreciated, so I will learn at least something.
> 
> Cheers, Moonlight

 

Well, I've fixed the tr error - hopefully. Checkout the new ebuild - it may get you working.

Could you also postup the output of 

```
iwgetid eth1 -s

iwgetid eth1 -r

iwgetid eth1 -m

iwlist eth1 channel
```

Thanks!

----------

## truekaiser

 *UberLord wrote:*   

>  *truekaiser wrote:*   well my wireless was working untill i updated to your 0.4.2 version.
> 
> this is what i get if i keep it in managed mode.
> 
> ```
> ...

 

for some odd reason it still acts like this in 3.1

----------

## AgenT

 *UberLord wrote:*   

>  *AgenT wrote:*   Quick question: what exactly is "Signal Level"? Reading the iwconfig man page does not give the results I wanted. I ask because here are my stats:
> 
> Link Quality:92/92  Signal level:5/153  Noise level:110/153
> 
> Seems like good "quality" but horrible "signal level". 
> ...

 

Maybe something is doing bad readings from the card. I have 10-15% packet loss.

But it does work and when browsing and doing email there is no difference between this wireless setup and a wired one. Note that this might not be the case if I were to play games and do other such intense activities. 

The strange part about the signal level being so low is that my card is only a few feet away from the router! This just seems wrong.   :Confused: 

[Addition] 

As of today (the response above was actually based on past data) the card shows a different picture. I have enabled all the neat router security functions like keys, no essid broadcast, mac address locks, etc. and now iwconfig shows a different style of output.

```
Bit Rate:11Mb/s   Tx-Power=15 dBm   Sensitivity:1/3
```

In addition to the same output as last time:

```
 Link Quality:92/92  Signal level:5/153  Noise level:109/153
```

Not sure what the last two mean, but there is no longer any packet loss.

----------

## moonlight

 *UberLord wrote:*   

> 
> 
> Well, I've fixed the tr error - hopefully. Checkout the new ebuild - it may get you working.
> 
> Could you also postup the output of 
> ...

 

Hello UberLord,

Find herafter the requested information :

 *Quote:*   

> 
> 
> laptop / # /etc/init.d/net.eth1 start
> 
>  * Running preup function
> ...

 

Some extra information.

Output of dmesg :

 *Quote:*   

> 
> 
> eth1: prism54_set_txpower() auto power will be implemented later.
> 
> eth1: islpci_open()
> ...

 

lspci -vvv :

 *Quote:*   

> 
> 
> 03:06.0 Network controller: Harris Semiconductor D-Links DWL-g650 A1 (rev 01)
> 
>         Subsystem: Unknown device 17cf:0014
> ...

 

Some extras :

 *Quote:*   

> 
> 
> laptop / # modprobe prism54
> 
> FATAL: Module prism54 not found.
> ...

 

However in my kernel config 2.6.5 :

 *Quote:*   

> 
> 
> #
> 
> # Prism GT/Duette 802.11(a/b/g) PCI/Cardbus support
> ...

 

I am doing something wrong probably. Is the driver not loaded ? If so, how to solve this issue ? Prism54 is in the kernel, do I have to configure something extra ?

Any help is welcome.

Cheers, Moonlight

----------

## UberLord

 *truekaiser wrote:*   

>  *UberLord wrote:*    *truekaiser wrote:*   well my wireless was working untill i updated to your 0.4.2 version.
> 
> it has the same settings as i had with the 0.3.1 version 
> 
> The 0.3.1 ebuild is still available - could you try that and see if it works again?
> ...

 

Well, I would guess that it's your environment and not my script then.

Changed anything like WEP keys, ESSID, channel or anything like that? Maybe it's just radio interferance?

----------

## UberLord

@Moonlight

Looks like I've got some more work to do with my script!

Damn wireless-tools and wireless drivers not reporting in the same manor!!!!

After trying to start my script and letting it fail, can you do the following

```
ifconfig eth1 up

iwconfig eth1
```

And check to see if it's still reporting NOT READY.

Thanks

----------

## UberLord

@Moonlight

Here's a beta script to try

http://rsm.demon.co.uk/~roy/downloads/wireless-config-0.4.4/wireless.sh

Just drop it into /etc/init.d and retry

If it fails I still need the above info - thanks!

----------

## truekaiser

 *UberLord wrote:*   

>  *truekaiser wrote:*    *UberLord wrote:*    *truekaiser wrote:*   well my wireless was working untill i updated to your 0.4.2 version.
> 
> it has the same settings as i had with the 0.3.1 version 
> 
> The 0.3.1 ebuild is still available - could you try that and see if it works again?
> ...

 

ruled that out by disableing wep and stuff. though whould the hotplug script screw up this one?

----------

## mdognrdog

I'm confused about what files I'm supposed to have, and which I should be editing.  (Partly, this is because I don't know how to review the directions that the ebuild presented when I emerged.)

Do I need to have a net.ath0 init script, or is that no longer necessary?  If all I need is net.eth0, and that file pulls in wireless.sh (obviating a separate net.ath0), then the preup and predown routines seem like they are intended to take care of everything. BUT the directions from the ebuild say I need to "merge the two," and I have no idea what the heck that means.

----------

## cayenne

Hello all,

Before I upgraded to the 2.6 kernel, I had wireless working on my linksys pci card. It is now borked. I was hoping I could get the files from this thread...and via sneakernet floppies...get it up and running. I don't know how to do this 'unconnected'

I copied the ebuild over as directed. When I tried:

ebuild wireless-config-0.4.3.ebuild fetch

It tries to go get the source.

Can someone give me some pointers how to get the source...and if I copy it to the local drive on the box...how can I tell ebuild to look for it on the local drive rather than the network connection that isn't there....

TIA,

cayenne

----------

## iverson0881

 *cayenne wrote:*   

> Hello all,
> 
> Before I upgraded to the 2.6 kernel, I had wireless working on my linksys pci card. It is now borked. I was hoping I could get the files from this thread...and via sneakernet floppies...get it up and running. I don't know how to do this 'unconnected'
> 
> I copied the ebuild over as directed. When I tried:
> ...

 

The files are located on UberLord's server here: 

```

http://rsm.demon.co.uk/~roy/downloads/

```

Just download wireless-config-0.4.3.tar.bz2 and then place it into /usr/portage/distfiles. And have the corresponding ebuild in the correct spot which UberLord has written out on the first page. Emerge as usual and it should find the file and install.

iverson0881

----------

## truekaiser

i think i found out what was worng. i have to type 'iwlist wlan0 scan' a few times for it to see my accsess point. it doesn't mater how close it is. is it the card or the accsess point?

----------

## boroshan

Uberlord,

First, thanks for your work on this script. Itwell organised and seems to work well for the majority of people.   :Smile: 

Second - alas, I am not among that blessed number - it don't work for me    :Crying or Very sad: 

It seems similar to the problems reported by moonlight and earlier AgenT in that the card comes up, fails to associate for no readily apparent reason, and then claims to connect in ad hoc mode, but without my being able to use the connection in any way.

This is what I get:

```
xeno root # /etc/init.d/net.eth1 restart

 * Stopping distccd...                                                    [ ok ]

 * Unmounting network filesystems...                                      [ ok ]

 * Stopping NFS mountd...                                                 [ ok ]

 * Stopping NFS daemon...                                                 [ ok ]

 * Unexporting NFS directories...                                         [ ok ]

 * Stopping NFS statd...                                                  [ ok ]

 * Stopping portmap...                                                    [ ok ]

 * Stopping postfix...                                                    [ ok ]

 * Stopping privoxy...                                                    [ ok ]

 * Stopping sshd...                                                       [ ok ]

 * Running predown function

 *   Removing wireless configuration from eth1...                         [ ok ]

 * Bringing eth1 down...                                                  [ ok ]

 * Running preup function

 *   Configuring wireless network for eth1

 *     "txpower 15"

 *   Connecting to "L00NEY" (WEP disabled)...                             [ !! ]

 *     eth1 connected as "L00NEY" in ad-hoc mode

 *     on channel 03 (WEP disabled)

 * Bringing eth1 up (192.168.0.7)...                                      [ ok ]

 *   Setting default gateway (192.168.0.2)...                             [ ok ]

 * Starting distccd...                                                    [ ok ]

 * Mounting network filesystems...                                        [ ok ]

 * Starting portmap...                                                    [ ok ]

 * Starting NFS statd...                                                  [ ok ]

 * Exporting NFS directories...                                           [ ok ]

 * Starting NFS daemon...                                                 [ ok ]

 * Starting NFS mountd...                                                 [ ok ]

 * Starting postfix...                                                    [ ok ]

 * Starting privoxy...                                                    [ ok ]

May 16 11:59:01 Privoxy(16384) Info: loading configuration file '/etc/privoxy/config':

 * Starting sshd...                                                       [ ok ]

xeno root # ping 192.168.0.63

PING 192.168.0.63 (192.168.0.63) 56(84) bytes of data.

From 192.168.0.7 icmp_seq=1 Destination Host Unreachable

From 192.168.0.7 icmp_seq=2 Destination Host Unreachable

From 192.168.0.7 icmp_seq=3 Destination Host Unreachable

--- 192.168.0.63 ping statistics ---

5 packets transmitted, 0 received, +3 errors, 100% packet loss, time 3998ms

, pipe 3

xeno root # iwconfig 

eth0      no wireless extensions.

lo        no wireless extensions.

eth1      IEEE 802.11b  ESSID:"L00NEY"  Nickname:"ipw2100"

          Mode:Ad-Hoc  Frequency:2.422GHz  Cell: 00:00:00:00:00:00  

          Bit Rate=0kb/s   Tx-Power=0 dBm   

          Retry:on   RTS thr=2304 B   Fragment thr:off

          Encryption key:off

          Power Management:off

          Link Quality:0/100  Signal level:-98 dBm  Noise level:-98 dBm

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

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

xeno root # ifconfig 

eth1      Link encap:Ethernet  HWaddr 00:0C:F1:0B:52:F8  

          inet addr:192.168.0.7  Bcast:192.168.0.255  Mask:255.255.255.0

          UP BROADCAST MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:1

          collisions:0 txqueuelen:1000 

          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

          Interrupt:11 Base address:0xb000 Memory:d2005000-d2005fff 

lo        Link encap:Local Loopback  

          inet addr:127.0.0.1  Mask:255.0.0.0

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:113 errors:0 dropped:0 overruns:0 frame:0

          TX packets:113 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0 

          RX bytes:8576 (8.3 Kb)  TX bytes:8576 (8.3 Kb)

xeno root # iwlist scan

eth0      Interface doesn't support scanning : Operation not supported

lo        Interface doesn't support scanning : Operation not supported

eth1      Scan completed :

          Cell 01 - Address: 00:0E:A6:9F:02:CB

                    ESSID:"L00NEY"

                    Mode:Master

                    Frequency:2.412GHz

                    Bit Rate:1Mb/s

                    Bit Rate:2Mb/s

                    Bit Rate:5.5Mb/s

                    Bit Rate:11Mb/s

                    Bit Rate:18Mb/s

                    Bit Rate:24Mb/s

                    Bit Rate:36Mb/s

                    Bit Rate:54Mb/s

                    Quality:62/100  Signal level:-36 dBm  Noise level:-98 dBm

                    Encryption key:off

xeno root # 

```

I'm running a Tosh M30 with an IPW2100. I'm using the ebuild rather than the kenel module.

----------

## boroshan

Well, I'm not the firat to do this on this thread, and I'll probably not be the last, but...

Five minutes after I sent my last message, it started working for no reason I can make out. All I did was shut down both interfaces and then bring up the wireless one on its own. This is indeed in accordance with Uberlord's advice, but I know I did the same thing before shouting "help!".

Uberlord, maybe you should consider adding "send a baffled message to this thread" to the official instructions  :Wink: 

Anyway, thanks for the script, and for your efforts on this thread. Another satisfied customer:D

----------

## UberLord

 *truekaiser wrote:*   

> i think i found out what was worng. i have to type 'iwlist wlan0 scan' a few times for it to see my accsess point. it doesn't mater how close it is. is it the card or the accsess point?

 

sleep_scan_eth0="1"

Try setting the number to a higher value

----------

## cayenne

 *iverson0881 wrote:*   

>  *cayenne wrote:*   Hello all,
> 
> Before I upgraded to the 2.6 kernel, I had wireless working on my linksys pci card. It is now borked. I was hoping I could get the files from this thread...and via sneakernet floppies...get it up and running. I don't know how to do this 'unconnected'
> 
> I copied the ebuild over as directed. When I tried:
> ...

 

Thanks for the reply!!

Ok, tried this, and got the following error msg:

emerge: No masked or unmasked ebuilds to satisfy >= sys-apps/baselayout-1.8.11

I did an emerge -p baselayout and it appears I have version 1.8.6.13

I'm guessing I need to find the source for this version of baselayout. Can someone tell me how to find the source for things like this manually.....since I don't have network connectivity.   I'm guessing I'd just put it into the /usr/portage/distfiles like I did with the wireless source?

I'm close here...thanks in advance!!

cayenne

----------

## UberLord

Yoiks! Your portage tree must be quite old as the required version of baselayout has been marked as stable for some time now.

I would advise doing an emerge sync and updating all config files before installing my ebuild

----------

## UberLord

NEW EBUILD POSTED

New quality check - uses /proc/net/wireless instead of iwconfig

----------

## cayenne

 *UberLord wrote:*   

> Yoiks! Your portage tree must be quite old as the required version of baselayout has been marked as stable for some time now.
> 
> I would advise doing an emerge sync and updating all config files before installing my ebuild

 

Yeah...box has been offline awhile...

Since it is dependent on the wireless connection for networking..I guess I'll have to just bring over files as it says it needs them.

I've gone to a few of the mirrors....looking for the source for the baselayout...under distfiles, and cannot fine it. All I see is baselayout-lite-1.0_pre1.tar.bz2

Is the the new name for it? Or am I looking in the wrong place? I know this is getting a bit OT, but, I'm needing to figure out how to do by hand what emerge does for you. And might help others that find themselves having to get wireless working on a non-networked computer..

TIA,

cayenne

----------

## UberLord

Source is two files 

sysvinit-2.8.4.tar.gz

rc-scripts-1.4.3.13.tar.bz2

They are the ones required for baselayout-1.8.6.13 which is the latest stable baselayout

----------

## truekaiser

well narrowed it down to either the card or the script. i replaced the router today and it still doesn't work after configureing it properly

----------

## UberLord

 *truekaiser wrote:*   

> well narrowed it down to either the card or the script. i replaced the router today and it still doesn't work after configureing it properly

 

The script has worked fine for you in the past.

If it takes some time before iwlist reports any scan information, then you need to increase the sleep_scan time until it consistently scans OK

----------

## truekaiser

i totaly removed all wireless stuff from the laptop and will re-install them. and if that doesn't work i'll try that.

edit: ok re-installing everyting didn't help. neither did your sugestion with the time out (went all the way to 20) i gues the card went so now the question becomes. another mini-pci card that can use the built in antenea in the laptop or a pcmcia card?

----------

## micmac

Hi UberLord,

is your website down? Can't fetch the ebuild right now.

Thanks

mic

----------

## micmac

Up again.

Thank you!

Greets micmac

----------

## damned

Hi there!

need some instructions about using dwl-g520+ at my gentoo. 

acx_pci doesn't work x(

----------

## UberLord

Do you mean that your drivers won't work? Well, I can't help with drivers - sorry  :Sad: 

----------

## damned

I know it, UberLord.

But this tread is most readable by wireless-users, and i hope what one of your fans   :Laughing:  can help me.

----------

## kosine

I usually works at three places:

1. home

2. office

3. public library

they have different essid for the wireless access,

How can I config my system to be able to work at these three places ?

Thank you

ps:

UberLord, Thank you so much for your great work on the 

software and the help to the people in this thread.

Thank you!

----------

## UberLord

in /etc/conf.d/wireless

```
key_Work="open s:workkey"

ifconfig_Work="dhcp"

key_Home="open s:homekey"

ifconfig_Home="192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0"

key_Library="open s:librarykey"

ifconfig_Work="dhcp"
```

That's a basic setup

----------

## UberLord

 *damned wrote:*   

> I know it, UberLord.
> 
> But this tread is most readable by wireless-users, and i hope what one of your fans   can help me.

 

I would suggest starting a new thread then.

I quick search of the forums shows there's a few threads about your particular card.

GL

----------

## atac

thanks for a great script!

though, for about 3-4 versions ago it stopped working when booting after a shutdown.

it says something about "you need to set a ESSID for operating in Ad-Hoc mode". i haven't set it to ad-hoc mode and the ESSID _is_ set. 

when i login and run it manually it works again, and if i reboot

it's working as it should.

----------

## Hase

I need help, I have posted here already, but I need to recap.

Right now, when I boot wired, eth0 works. When it is unplugged and I want to use wlan0 I am having problems. Fresh from reboot, iwconfig shows wlan0 with an empty essid, I can scan and see my AP but cannot change my ESSID using the "iwconfig wlan0 essid <name>". After entering that string (no errors, nothing in dmesg), I run iwconfig to find it the same as before. I have also modified /etc/conf.d/wireless but am unsure that anything even looks at this file (made no difference). I am very new and need explicit instructions (ie, I wouldn't know when to run rc-update on my own). I am learning and anxious to learn more. Any assistance or direction to a thoughrough tutorial would be great. BTW, I did run the script but has functionally done nothing. Is there anything I can run to test or a file to read to see if I am configured right?

Thanks and Prost!

Aaron

----------

## TealVeal

How do I get an ath0?  I'm missing something pretty basic here and I can't for the life of me figure it out.  I've gotten to

```
ACCEPT_KEYWORDS="~x86" emerge net-wireless/wireless-config
```

but I can't seem to get any further.

typing iwconfig shows the loopback devide and an eth0 but no ath0.  I'm thoroughly confused   :Shocked: 

----------

## UberLord

 *TealVeal wrote:*   

> How do I get an ath0?  I'm missing something pretty basic here and I can't for the life of me figure it out.  I've gotten to
> 
> ```
> ACCEPT_KEYWORDS="~x86" emerge net-wireless/wireless-config
> ```
> ...

 

The ebuild only provides scripts - to get the interface (ath0) itself you need to install kernel drivers specific to the chipset of your card.

For example, I have a NetGear W311. A quick google shows that some versions of this card use the madwifi driver - that's in portage so I 

```
emerge madwifi-driver
```

 to install it.

If you're running hotplug, the driver may autoload. If not, you may have to add the module name (ath_pci) to /etc/modules.autoload.d/<kernel version> and then reboot or "modprobe ath_pci"

----------

## UberLord

 *atac wrote:*   

> thanks for a great script!
> 
> though, for about 3-4 versions ago it stopped working when booting after a shutdown.
> 
> it says something about "you need to set a ESSID for operating in Ad-Hoc mode". i haven't set it to ad-hoc mode and the ESSID _is_ set. 
> ...

 

Could you PM me your /etc/conf.d/wireless and the exact output of the script + a few surrounding lines please? thanks

----------

## UberLord

 *Hase wrote:*   

> I need help, I have posted here already, but I need to recap.
> 
> Right now, when I boot wired, eth0 works. When it is unplugged and I want to use wlan0 I am having problems. Fresh from reboot, iwconfig shows wlan0 with an empty essid, I can scan and see my AP but cannot change my ESSID using the "iwconfig wlan0 essid <name>". After entering that string (no errors, nothing in dmesg), I run iwconfig to find it the same as before. I have also modified /etc/conf.d/wireless but am unsure that anything even looks at this file (made no difference). I am very new and need explicit instructions (ie, I wouldn't know when to run rc-update on my own). I am learning and anxious to learn more. Any assistance or direction to a thoughrough tutorial would be great. BTW, I did run the script but has functionally done nothing. Is there anything I can run to test or a file to read to see if I am configured right?
> 
> Thanks and Prost!
> ...

 

OK - sounds like a simple enough problem.

/etc/conf.d/wireless is hooked into /etc/conf.d/wireless.sh which in turn is hooked into /etc/conf.d/net which in turn is read by /etc/init.d/net.eth0 which in turn is sym-linked to /etc/init.d/net.wirelessinterface (net.eth1, net.wlan0, net.ath0, etc etc)

Phew!

The key part is to obey the intructions after the ebuild. Namely, do the following.

```
etc-update
```

Now, examine /etc/conf.d/net and check to see if it has the line "source /etc/init.d/wireless.sh" in it. If it does not then

```
ebuild /var/db/pkg/net-wireless/wireless-config/wireless-config-0.4.4.ebuild config
```

That essentially adds the wireless "hook" into /etc/conf.d/net for my scripts  :Smile: 

This of course will not help you straight away - I need to know a few more things.

1) Is /etc/init.d/net.wlan0 a symbolic link to /etc/init.d/net.eth0? If not, make it one

```
ln -sf /etc/init.d/net.eth0 /etc/init.d/net.wlan0
```

2) Whats the exact output of the script 

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

Thanks

----------

## TealVeal

Thank you!  I hooked net.ath0 into net.eth0, took out my plug, stopped eth0, and restarted ath0 and am currently installing firefox using nothing but wireless.

how would I go about making this work on boot? rc-update add net.ath0 defualt?  Yes it seemed to add correctly  :Smile: 

Yet my computer just froze =\

----------

## UberLord

 *TealVeal wrote:*   

> Yet my computer just froze =\

 

At what point?

----------

## TealVeal

 *UberLord wrote:*   

>  *TealVeal wrote:*   Yet my computer just froze =\ 
> 
> At what point?

 

In the middle of the download part of emerge.  it's the drivers fault I think.  It just did it again right now as I was emerging xpdf.

I had both ath_hal and ath_pci loaded, this boot I just loaded ath_pci, maybe it won't crash  :Smile: 

How would I go about finding my mac address? I tried iwconfig but it doesn't show it.  ifconfig looks like it might, it shows a HWaddr which I enteredinto my AP as my card's MACaddress for filtering.  We'll see if I can keep on thenetwork.  :Smile: 

Thanks for your help  :Smile: 

----------

## Hase

Thanks UberLord, you seem to be the go to guy for all this stuff and for good reason, I think you and others like you are why I have had better luck with Gentoo than any other distro.

Aaron

----------

## UberLord

 *TealVeal wrote:*   

>  *UberLord wrote:*    *TealVeal wrote:*   Yet my computer just froze =\ 
> 
> At what point? 
> 
> In the middle of the download part of emerge.  it's the drivers fault I think.  It just did it again right now as I was emerging xpdf.
> ...

 

If it's freezing when downloading during an emerge that's crappy mad-wifi drivers  :Sad: 

The current ones in CVS haven't frozen on me like that in a long time

(It's not actually freezing - it's just constantly re-assocaiting with the AP)

----------

## UberLord

 *Hase wrote:*   

> Thanks UberLord, you seem to be the go to guy for all this stuff and for good reason, I think you and others like you are why I have had better luck with Gentoo than any other distro.
> 
> Aaron

 

Awww shucks   :Embarassed: 

----------

## TealVeal

I checked out the CVS version of madwifi, what exactly do I do with it?  this is the firsttime I've ever used CVS.

Thanks

----------

## markfl

Scripts seem to be working pretty good (havent tested them at school yet though)

Also i think you have a redundant line in your install instructions

```
ebuild foo.ebuild digest
```

will fetch the sources for you if you don't have them. This makes

```
ebuild food.ebuild fetch
```

redundant.

Anyway, thanks for the sweet scripts

Mark

----------

## UberLord

 *TealVeal wrote:*   

> I checked out the CVS version of madwifi, what exactly do I do with it?  this is the firsttime I've ever used CVS.
> 
> Thanks

 

Go into the folder and type 

```
make
```

That builds the kernel modules

Then you do either a "make install" or "make modules_install" - can't remember which right now

----------

## UberLord

 *markfl wrote:*   

> 
> 
> Also i think you have a redundant line in your install instructions
> 
> ```
> ...

 

I'll check that out when I post a new version and update the instructions accordingly. Thanks

----------

## t_2199

Hi UberLord I have used your wireless scripts quite a long time ! First I want to thank you for your great work =)!!

Recently I upgraded to the latest version and I have a problem now. I get this error message

```
 * Running preup function

 *   Configuring wireless network for eth0

 *   Connecting to "WLAN" (WEP disabled)  [ !! ]

 * eth0 requires an ESSID to be set to operate in Ad-Hoc mode

 * Failed to configure wireless for eth0

 * preup eth0 failed
```

Its a bit confusing because I set the mode to Managed in the config file. Heres the config file /etc/conf.d/wireless

```

essid_eth0="WLAN"

mode_eth0="Managed"
```

and my /etc/conf.d/net file only has one line:

```
iface_eth0="dhcp"
```

Help would be cool!

----------

## Bigbang

I have the same problem as t_2199

I use "managed" but it tells that I need an ESSID (that I have set) in Ad-hoc mode.

(my other thread was started because I felt overwhelmed by the number of pages in this thread)

----------

## UberLord

 *t_2199 wrote:*   

> 
> 
> Recently I upgraded to the latest version and I have a problem now. I get this error message
> 
> ```
> ...

 

I have that fixed now - but it's just a display error in your case.

Here's a link to it directly - I have another bug to fix (but unrelated to your problem) before I release it.

http://rsm.demon.co.uk/~roy/downloads/wireless-config-0.4.5/wireless.sh

Could you tell me what version you were using and if it still works?

Thanks

----------

## UberLord

Do both of you have this problem if you use a static IP?

----------

## willdev

Uberlord,

Great stuff here.  This is a dumb question:

I see your wireless.sh script being called for iface=lo and iface=eth0.  

eth0 is my wireline nic and eth1 is my wireless nic running under cardmgr + pcmcia.

However, wireless.sh is not called for eth1.

How can I fix this?

Thanks,

John

----------

## markfl

By the way, is there any chance of this being included into baselayout? Maybe using the wifi flag thats only currently used by kdenetwork AFAIK (and doesnt work with that to boot)

UberLord of wireless  :Razz: 

It would make a great addition to gentoo

(oh and its still working great here - had a bit of a scare earlier because my school wifi stopped working, turns out that i needed to use open <WEP KEY> as opposed to just <WEP KEY> in the config)

Mark

----------

## t_2199

 *UberLord wrote:*   

>  *t_2199 wrote:*   
> 
> Recently I upgraded to the latest version and I have a problem now. I get this error message
> 
> ```
> ...

 

I was using version 0.4.4. but it is definatley not just an display error (in that case I wouldnt mind) because I have to bring up eth0 manaully every start and do all the stuff wireless-config should do..

OK I updated now and I got this error message 

```

root@holger holger # /etc/init.d/net.eth0 restart

 * Running preup function

 *   Configuring wireless network for eth0

 *   Connecting to "WLAN" (WEP disabled)...                               [ !! ]

 * Failed to configure wireless for eth0

 * preup eth0 failed
```

I changed the /etc/conf.d/net file to have a static IP but I got the same error. 

Anyway thanks for your help!

----------

## UberLord

 *t_2199 wrote:*   

> 
> 
> I was using version 0.4.4. but it is definatley not just an display error (in that case I wouldnt mind) because I have to bring up eth0 manaully every start and do all the stuff wireless-config should do..
> 
> 

 

0.4.4 is the latest!! I think I know the problem though - it may be todo with the ipw2100 fix I put in a few versions ago.

To accomodate, I'll put out a new version soon with a selectable association test defaulting to the old way.

----------

## UberLord

NEW EBUILD POSTED

Fixed test to see if ad-hoc had been set when managed fails

associate_test_eth0 can be set to "mac", "quality" or "both" to test for association. Defaults to "mac"

----------

## t_2199

 *UberLord wrote:*   

> NEW EBUILD POSTED
> 
> Fixed test to see if ad-hoc had been set when managed fails
> 
> associate_test_eth0 can be set to "mac", "quality" or "both" to test for association. Defaults to "mac"

 

Working!!

```

root@holger holger # /etc/init.d/net.eth0 restart

 * Running preup function

 *   Configuring wireless network for eth0

 *   Connecting to "WLAN" (WEP disabled)...                               [ ok ]

 *     eth0 connected to "WLAN" in managed mode

 *     on channel 11 (WEP disabled)

 * Bringing eth0 up via DHCP...                                           [ ok ]

 *   eth0 received address 90.0.0.101

```

Thanks for the quick support you made my life easier than ever!

----------

## UberLord

Excellent  :Smile: 

Bigbang, has this solved your problem too?

----------

## UberLord

 *willdev wrote:*   

> Uberlord,
> 
> Great stuff here.  This is a dumb question:
> 
> I see your wireless.sh script being called for iface=lo and iface=eth0.  
> ...

 

You can't.

Net.eth0 is a template script for all network interfaces (except for net.lo)

As such, your other network interface scripts need to symlink to net.eth0

Hence wired and non-wired both hook into wireless.sh as it's really the same script.

It sounds like you just took a copy of an old net.eth0 and copied it to net.eth1. This means that when baselayout gets updated, net.eth1 won't.

To fix this, make it a symbolic link instead

```
ln -sf /etc/init.d/net.eth0 /etc/initd.d/net.eth1
```

----------

## UberLord

 *markfl wrote:*   

> By the way, is there any chance of this being included into baselayout? Maybe using the wifi flag thats only currently used by kdenetwork AFAIK (and doesnt work with that to boot)
> 
> UberLord of wireless 
> 
> It would make a great addition to gentoo
> ...

 

Maybe I'll submit it to bugs.gentoo.org for inclusing within portage at some point.

I doubt that it will ever get included in baselayout though

----------

## Bigbang

Still not working.

I try first with my WEP:

```
* Bringing eth1 up via DHCP...                                                                                        [ !! ]
```

then without the WEP:

```
* eth1 requires an ESSID to be set to operate in Ad-Hoc mode

 * Failed to configure wireless for eth1

 * preup eth1 failed
```

I'm sure it's not the ebuild that causes the problem, it's probably me, but I really don't know what I'm doing wrong.

EDIT: Well, I just left my PC alone for a while, then came back and wireless works now   :Confused: 

Well, at least it works now! Thanks a lot UberLord

----------

## CougarX

I've downloaded this script and tried to get it working.  I started with the 0.4.4 ebuild and now have 0.4.5 installed.  I also followed the directions given to me after the ebuild was installed.  However, it does not seem like the script is even running with the gentoo net script.  I've been looking at the output of other people who have been having problems and the net init output is substantially different than mine, which is still the same as it would be for a normal wire based net interface.

Thanks for any help you all can give.  Let me know which files you need to see in order to help.....

----------

## UberLord

 *CougarX wrote:*   

> I've downloaded this script and tried to get it working.  I started with the 0.4.4 ebuild and now have 0.4.5 installed.  I also followed the directions given to me after the ebuild was installed.  However, it does not seem like the script is even running with the gentoo net script.  I've been looking at the output of other people who have been having problems and the net init output is substantially different than mine, which is still the same as it would be for a normal wire based net interface.
> 
> Thanks for any help you all can give.  Let me know which files you need to see in order to help.....

 

Have you run etc-update and merged any updates in?

Is your wired interface (say it's wlan0) symlinked to eth0?

```
ln -sf /etc/init.d/net.eth0 /etc/init.d/net.wlan0
```

Does your /etc/conf.d/net have a line starting preup() near the bottom?

----------

## UberLord

NEW EBUILD POSTED

Changed "both" to "all" for associate_test_eth0 - just incase a 3rd test is added

Fixed the error stating that scanning was not supported when the driver does support scanning but couldn't find any access points

Improved the comments in /etc/conf.d/wireless

----------

## CougarX

Yep I got the symlink and I believe I used ln - sf... I found that in a few other forum posts.

```
-rwxr-xr-x  1 root root 4963 May  5 18:23 net.eth0

lrwxrwxrwx  1 root root    8 May 26 13:24 net.eth1 -> net.eth0

```

I also ran etc-update before hand and yep my /etc/conf.d/net has the preup and predown functions:

```
###########################################

# Hook wireless into /etc/init.d/net.eth0

# Please note, these lines should appear

# at the END of the file

 

source /etc/init.d/wireless.sh

 

preup() {

        wireless_up ${1}

        return $?

}

 

predown() {

        wireless_down ${1}

        return $?

}

 

# End hook

###########################################

```

Also do I need to have my eth0 (hard wired) connection plugged in?  At the moment it and my wireless (eth1) is being controlled by ifplug (ver ifplugd 0.25 (SVN: 109))  The wireless works when I issues iwconfig the proper configuration information (essid and key) so my wireless connection does work.  

I've been trying a few things with runlevels and stuff but it does not seem to matter, the scripts do not want to seem to run... 

After I post this i'm going to try the new ebuild you just posts maybe it will work.

----------

## Legoguy

You need to patch your baselayout's net.eth0 script to not think the eth* is "up" unless it has an IP address - ifplugd, without the net.eth0 patch, causes it to think the interface is already up.

https://bugs.gentoo.org/show_bug.cgi?id=34484#c4

----------

## CougarX

according to ifconfig, my eth0 connection is not up....

```
eth1      Link encap:Ethernet  HWaddr FF:FF:FF:FF:FF:FF

          inet addr:192.168.1.8  Bcast:192.168.1.255  Mask:255.255.255.0

          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:7131 errors:0 dropped:0 overruns:0 frame:0

          TX packets:7674 errors:106 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:4608111 (4.3 Mb)  TX bytes:1496040 (1.4 Mb)

          Interrupt:3 Base address:0x100

 

lo        Link encap:Local Loopback

          inet addr:127.0.0.1  Mask:255.0.0.0

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:190 errors:0 dropped:0 overruns:0 frame:0

          TX packets:190 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:11179 (10.9 Kb)  TX bytes:11179 (10.9 Kb)

```

however, you are probably right, how do I apply these patches, and/or which ones do I need?

----------

## markfl

Ignore this, i updated to the latest version and it works fine now. 

Not a bad response to a bug report, fixed before its reported.

Mark

IGNORE:

I think i've found a cosmetic bug, when you start up without an ap in range it says that wlan0 does not support scanning (when clearly it does because it works when i'm in range)

I presume that an adapter that doesnt support scanning will bring up different results in iwlist than one that doesnt have any ap's in range

Maybe it could exit more gracefully like "Scan did not find any access points in range"

(this might be fixed already (i'm using 0.4.4)

----------

## d0wn_under

I am trying to get a sitecom wl-011 pc card working and having no luck.

Can anyone tell me if this:

```

Socket 0:

  no CIS present

Socket 1:

  funcid network_adapter

  lan_technology wireless

  lan_speed 1 mb/sec

  lan_speed 2 mb/sec

  lan_speed 5 mb/sec

  lan_speed 11 mb/sec

  lan_media 2.4_GHz

  lan_connector Closed connector standard

  lan_node_id 00 00 00 00 00 00

  vers_1 8.0, "", "", "", ""

  config_cb base 0x0000 last_index 0x01

  cftable_entry_cb 0x01 [default]

    [master] [parity] [serr]

    Vcc Vnom 3300mV

    irq mask 0xffff [level]

    mem_base 0

  BAR 1 size 64kb [mem]

  manfid 0x0001, 0x0000 

```

is bad? all the other examples I have seen of the output from this command have details in the vers_1 field.

Uberlord, I'd like to install your app but without a network connection I can't update my baselayout to a high enough version!

Also, where does iwconfig come from? Is it part of Uberlords app or is it something fundemental that I have missed installing?

----------

## markfl

iwconfig is part of the wireless-tools package, but without network you probably can't install it, might be on the livecd if you got the full one though

edit: found your card, should be using the atmel chipset, recompile your kernel with support for wirelss lan, pcmcia, and atmel support

reading the help for the atmel card shows that "many of these cards do not have flash memory" which means you might need to load firmware when you insert the card. i don't know how to do this though.

Mark

----------

## d0wn_under

I've installed the wireless-tools package and found this site http://thekelleys.org.uk which talks about loading the firmware image. I've installed it as it says but I can't tell if it has done anything more than activated my infra-red port (which is nice but I'd rather have wireless).

This is the url for the README for the package http://thekelleys.org.uk/atmel/READ-ME.

It talks about making sure I have the right image but I can't find the log it refers to when it talks about writing to a log. It isn't in the normal system log.

I assume that loading this firmware image will make the card show up correctly in the cardctl ident report, am I correct anyone?

I have the things you mention about the kernel set and compiled them into the kernel for now so that I know that they are definatly loaded.

----------

## d0wn_under

I've just found this page http://www.linux-wlan.org/docs/wlan_adapters.html.gz which says that my card is the following:

Sitecom  	802.11b  	WL-011 ver. 2  	Cardbus  	AMD  	

After all that it isn't the Atmel chipset, they changed over to the AMD am 1772.

Anyone got any pointers on getting AMD chipsets working?  :Smile: 

----------

## damianfrancis

Thanks very much for your work UberLord.  I wanted mention that though I am up and running using the ebuild, and I used your script before the ebuild, all the while with ndiswrapper, it seems that some one is leaving something out in their howto's.  Neither you nor the person with a howto on ndiswrapper mentions what to once you get the ebuild installed to start up your wireless interface.  If I hadn't done it back when it was with your script I wouldn't have known that  I could just make a copy of my net.eht0 and call it net.waln0 then add iface_wlan0="dhcp" to the conf.d/net file.  All I am saying is that it would really help others out if there was a clear cut how to that mentioned every step an individual would need to take to get there wifi up and running.  But maybe the problem is not with your howto, maybe it is with the ndiswrapper howto.  Anyway, when is that config file supposed to be created?

----------

## dedeaux

I would like to thank you Uberlord for the great work.  I have read through this thread completely and have a working setup with no complaints.

I bought a Buffalo 54g PCI card and ripped the minipci card out and used it to replace my builtin "b" card.  Of course, being broadcom based I am having to use ndiswrapper.  All funtions great.

I was having a time getting ndiswrapper automated to my liking when I stumbled across this thread.  All works to my liking now.

I have modified the preup() funtion in /etc/conf.d/net as follows to load ndiswrapper and the drivers for this card:

```
preup() {

        modprobe ndiswrapper

        loadndisdriver /etc/ndiswrapper/netcbg5m

        wireless_up ${1}

        return $?

}

```

While this works, is anyone else doing this differently?  Should these be placed elsewhere?

----------

## damianfrancis

I'm just curious, dedeaux.  Though using the preup function is great.  Why do you have the line 

```
loadndisdriver /etc/ndiswrapper/netcbg5m
```

I am using ndiswrapper and have since version 0.4 and all I have ever had to do once it is setup is modprobe.  Is this something you have to do if you have multiple windows drivers you want to change between?

----------

## UberLord

 *dedeaux wrote:*   

> 
> 
> ```
> preup() {
> 
> ...

 

I don't use ndiswrapper myself, but I would just load modules using /etc/modules.autoload.d/kernel-version

However, there's nothing wrong with putting it there except that the ndiswrapper will try and "load" everything you start any network interface - including non-wireless

----------

## UberLord

 *damianfrancis wrote:*   

> Neither you nor the person with a howto on ndiswrapper mentions what to once you get the ebuild installed to start up your wireless interface.  If I hadn't done it back when it was with your script I wouldn't have known that  I could just make a copy of my net.eht0 and call it net.waln0 then add iface_wlan0="dhcp" to the conf.d/net file.

 

http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=8#doc_chap2

The handbooks tells you about this already

 *Quote:*   

> 
> 
>   All I am saying is that it would really help others out if there was a clear cut how to that mentioned every step an individual would need to take to get there wifi up and running.  But maybe the problem is not with your howto, maybe it is with the ndiswrapper howto.  Anyway, when is that config file supposed to be created?

 

With a wide variety of hardware and drivers around  cannot provide instructions for every situation. I have tried to place comments in /etc/cond.d/wireless to try and help most people out. If you think you can improve on those comments then feel free to try and if I think they are an improvement then I will update the file accordingly.

However, i do not use ndiswrapper so I cannot help or provide instructions for that

Same goes with prism54 for loading it's firmware.

----------

## lululog

Hi UberLord

Any news about the support for WPA? I will try to get WPA running here as soon as my roomate doesn't need the AP for a while.

If I get it working I might help adding WPA support to your scripts.

----------

## UberLord

 *lululog wrote:*   

> Any news about the support for WPA? I will try to get WPA running here as soon as my roomate doesn't need the AP for a while.
> 
> If I get it working I might help adding WPA support to your scripts.

 

I don't have any WPA enabled hardware so I cannot put support for it into my ebuild at this time.  :Sad: 

I'm willing to accept any contributions in the form of a diff file though  :Smile: 

----------

## dedeaux

 *damianfrancis wrote:*   

> I'm just curious, dedeaux.  Though using the preup function is great.  Why do you have the line 
> 
> ```
> loadndisdriver /etc/ndiswrapper/netcbg5m
> ```
> ...

 

I have never been able to get ndiswrapper to behave as the docs and many describe.  I would prefer not to do it this way and do a simple modprobe and all would be dandy.  Unfortunately, modprobe ndiswrapper has never loaded the windows drivers.

----------

## dedeaux

 *UberLord wrote:*   

>  *dedeaux wrote:*   
> 
> ```
> preup() {
> 
> ...

 

Thanks for that response Uberlord.  This input is what I am looking for.  I guess I still need to work on getting ndiswrapper to work right.  when I modprobe ndiswrapper, it doesn't load the windows driver.

----------

## markfl

I have ndiswrapper working almost perfectly.

The only thing thats weird is when it comes to autoloading modules it tells me ndiswrapper failed but it still brings up and uses my wireless perfectly.

----------

## dedeaux

 *markfl wrote:*   

> I have ndiswrapper working almost perfectly.
> 
> The only thing thats weird is when it comes to autoloading modules it tells me ndiswrapper failed but it still brings up and uses my wireless perfectly.

 

nice... perfectly for me is the solution I posted earlier.  I tried it with the drivers from the ndiswrapper website, but they still don't autoload and neither of the two listed would connect to my ap.  So, I reverted back to the ones that came on my cd and I can connect to the ap no prob.

I think I will try and get the latest ndiswrapper as I only have the lastest in portage which is .6-r1.  The website lists .8-rc2 as the latest.

----------

## Pulseammo

Good evening. I was wondering if anyone would be able to give me a little help with configuring my wireless network card.

Ive just installed gentoo 3 days ago (and this is the first time ive touched linux). Ive managed to install the USB drivers for my network card and installed wireless-tools (for iwconfig) but am having a few problems figuring some things out:

I am able to setup my wireless network card fine using iwconfig commands but whenever i reboot the settings are cleared so this is not much use to me! Needless to say my travels brought me to this script  :Wink: .

Ive setup the script as best as i could and it seems to have added the files that it should but when i edit /etc/conf.d/wireless any settings ive made dont show up when i use "iwconfig" command.

Being a 3 day old newbie im finding it slightly hard to troubleshoot but i think ive limited it down to a few things:

I have a wired NIC installed which has a file in the /etc/init.d called net.eth0... i think that i added this to auto startup by using rc-update but unfortunatly i dont have a net.wlan0 to add (the usb wireless nic is definatly called wlan0).

I have added iface_wlan0 with an IP etc to my /etc/conf.d/net settings but the wlan0 doesnt take an IP when linux boots either! So i think im doing something wrong around the lines of not having that net.wlan0

The only other thing that i didnt manage to do was add 

```

edit /etc/make.conf and enable PORTDIR_OVERLAY (defaults to /usr/local/portage)

```

to the make.conf because my portage dir was not the default.... and i was kinda banking on not needing this in the make.conf so that might be a reason why the script doesnt work....im uneasy about re-compiling it though...

Any help would be greatly appreciated...sorry if ive caused any thread hijacks also!

Pulse.

----------

## iverson0881

Ok make sure you have a /etc/init.d/net.wlan0. If don't have one then you need to create one by 

```
ln -s /etc/init.d/net.eth0 /etc/init.d/net.wlan0
```

Also make sure you edited the /etc/conf.d/wireless to 

```
XXX_wlan0=
```

The /etc/conf.d/net should read 

```
iface_wlan="dhcp"
```

If you are connecting to a DHCP server

And below all that you need the preup code provided by UberLord or your own.

iverson0881

----------

## Pulseammo

Aaahhh...that all makes sense, thats what the gentoo handbook said to do but i was slightly skeptical seeings as net.eth0 refered (i thought) to a wired device...

Anyways...ive make a net.wlan0 and added it to auto load and now any settings im putting in the /etc/conf.d/wireless are working!

Thank you very very much  :Smile: .

----------

## UberLord

 *Pulseammo wrote:*   

> Aaahhh...that all makes sense, thats what the gentoo handbook said to do but i was slightly skeptical seeings as net.eth0 refered (i thought) to a wired device...

 

It does!

My ebuild hooks wireless into it   :Wink: 

Glad it's working for you  :Smile: 

----------

## damianfrancis

so do you have to copy it and create wlan0 or are you supposed to be able to just start eth0 and it will check for wireless extensions? Cause now when I start eth0 it gives output about eth0 not having wireless extensions and I am thinking "duh" even though I understand that my copying eth0 to wlan0 wouldn't have worked if the config file didn't look for wireless extensions.  Boy I sure do like using the Preup and predown functions for loading and unloading ndiswrapper much more than loading it with the modules.autoload file, this way ndiswrapper isn't loaded unless I am using it.    :Laughing: 

----------

## mizery de aria

Anyone happen to have a copy of wireless-config-0.4.6.tar.bz2?  Uber's site seems to be down  :Sad: 

----------

## markfl

 *mizery de aria wrote:*   

> Anyone happen to have a copy of wireless-config-0.4.6.tar.bz2?  Uber's site seems to be down 

 

mirror taken down because UberLord's site should be up again now

Oh and not wanting to cause offence but there are many religious people who do no harm to anyone so please change your sig. Thanks

Mark

----------

## UberLord

Sorry about that - installed a new wireless router.

Should be back now  :Smile: 

----------

## BeTo

Hello all.

I'm having a problem when trying to configure my conceptronic c54c

pcmcia wireless card. I'm trying to connect to an access point (conceptronic) connected

to my router to access to the local net.

After trying lots of things, now my 2 card leds are intermittent (first

one, then the other and so). I get this when using madwifi drivers and

getting the wireless interface up (net.ath0). I don´t get any errors

when doing /etc/init.d/net.ath0 start.

The problem is that it can't connect to the acces point. I have also

configured the /etc/conf.d/wireless and tried lots of things, but I

always get the same result (the 2 alternating leds).

This is my iwconfig output, I don't know why the access point address is not set up...:

```

lo        no wireless extensions.

 

eth0      no wireless extensions.

 

ath0      IEEE 802.11  ESSID:"WLAN"

          Mode:Managed  Frequency:2.437GHz  Access Point: FF:FF:FF:FF:FF:FF

          Bit Rate:1Mb/s   Tx-Power:off   Sensitivity=0/3

          Retry:off   RTS thr:off   Fragment thr:off

          Encryption key:off

          Power Management:off

          Link Quality:0/94  Signal level:-95 dBm  Noise level:-95 dBm

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

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

```

Anybody knows where is the problem or does anybody have a working

/etc/conf.d/wireless file?

Thanks a lot in advance.

----------

## UberLord

How about you post the output of 

```

iwlist ath0 scan

/etc/init.d/net.ath0 restart

```

----------

## BeTo

The output is:

```

ath0      No scan results

```

 :Crying or Very sad: 

----------

## Cryofix

BeTo try this

```
ifconfig ath0 up

```

then try the scan

----------

## BeTo

 *Quote:*   

> 
> 
> BeTo try this
> 
> Code:
> ...

 

It's always the same: No scan results.

And if I do:

```

root@localhost pcmcia # iwgetid ath0 -m

ath0      Mode:Managed

root@localhost pcmcia # iwgetid ath0 -a

ath0      Access Point/Cell: FF:FF:FF:FF:FF:FF

root@localhost pcmcia # iwgetid ath0 -s

s7z

```

I'm going to paste my /etc/conf.d/wireless, may be I have something wrong. So after trying lots of things this is what I have:

```

##############################################################################

# SETTINGS

##############################################################################

# Hard code an ESSID to an interface

# This needs to be done when the driver doesn't support scanning

# Set to "any" to connect to any ESSID

# This may work for drivers that don't support scanning but you need automatic

# AP association

essid_ath0="any"

 

# Set the mode of the interface (ad-hoc or managed). Managed is default

# If it's ad-hoc you also need to specify the channel below

mode_ath0="managed"

 

# If managed mode fails, drop to ad-hoc mode with the below ESSID?

# If this is set, then remember to configure wireless options such as ifconfig

# for the specified ESSID. Channel can be set (1-14), but defaults to 3 if

# not set.

#

# The below is taken verbatim from the BSD wavelan documentation found at

# http://www.netbsd.org/Documentation/network/wavelan.html

# There are 14 channels possible; We are told that channels 1-11 are legal for

# North America, channels 1-13 for most of Europe, channels 10-13 for France,

# and only channel 14 for Japan. If in doubt, please refer to the documentation

# that came with your card or access point. Make sure that the channel you

# select is the same channel your access point (or the other card in an ad-hoc

# network) is on. The default for cards sold in North America and most of Europe# is 3; the default for cards sold in France is 11, and the default for cards

# sold in Japan is 14.

#adhoc_essid_ath0="WLAN"

#adhoc_channel_ath0="3"

 

# Setup any other config commands. This is basically the iwconfig argument

# without the iwconfig $iface

#iwconfig_eth1="192.168.1.9"

 

# Set private driver ioctls. This is basically the iwpriv argument without

# the iwpriv $iface

#iwpriv_eth0=""

 

# We can define various timeouts here.

#sleep_scan_ath0="10000"

#sleep_associate_eth0="5"

 

# By default a successful association in Managed mode sets the MAC

# address of the AP connected to. However, some drivers (namely

# the ipw2100) don't set an invalid MAC address when association

# fails - so we need to check on link quality which some drivers

# don't report properly either.

# So if you have connection problems try flipping this setting

# Valid options are MAC, quality and all - defaults to MAC

associate_test_ath0="all"

                                                                                

# Some driver/card combinations need to scan in Ad-Hoc mode

# After scanning, the mode is reset to the one defined above

scan_mode_ath0="Ad-Hoc"

 

# Below you can define private ioctls to run before and after scanning

# Format is the same as the iwpriv_eth0 above

# This is needed for the HostAP drivers

#iwpriv_scan_pre_eth0="host_roaming 2"

#iwpriv_scan_post_eth0="host_roaming 0"

 

# Define a WEP key per ESSID

# You can't use "any" for an ESSID here

key_WLAN=""

# or you can use strings. Passphrase IS NOT supported

# Note - this example also sets the encryption method to open

# which is regarded as more secure than restricted

#key_WLAN="s:foobar enc open"

 

# You can also override the interface settings here - even provide

# a nameserver/domain per ESSID

#ifconfig_ESSID="dhcp"

#dhcpcd_ESSID="-t 5"

#inet6_ESSID=""

#routes_ESSID=""

#gateway_ESSID="192.168.1.1"

#nameserver_ESSID="192.168.0.1"

#domain_ESSID="some.domain"

 

# LEAP users will want to use the preassociate setting to specify

# an authentication script

#preassociate_ESSID="/run/this/script"

 

# Map a MAC address to an ESSID

# This is used when the Access Point is not broadcasting it's ESSID

# WARNING: This will override the ESSID being broadcast due to some

# Access Points sending an ESSID even when they have been configured

# not too!

# Change 001122334455 to the MAC address and ESSID to the ESSID

# it should map to

essid_00805A224A37="WLAN"

 

# This lists the preferred ESSIDs to connect to in order

# ESSID's can contain any characters here as they must match the broadcast

# ESSID exactly.

# Surround each ESSID with the " character and seperate them with a space

# If the first ESSID isn't found then it moves onto the next

# If this isn't defined then it connects to the first one found

preferred_aps=("WLAN")

```

I don't have a key defined by the moment. I'll put it after see that working. In Windows works fine.

If it helps, I'm using Gentoo.

Help please!

Thanks

----------

## UberLord

 *BeTo wrote:*   

> 
> 
> It's always the same: No scan results.
> 
> And if I do:
> ...

 

Well, that shows that the driver cannot find the Access Point - there's not really much I can do about that. The only thing I can recommend is that if you're using the current portage madwifi driver, then try the CVS version.

http://www.mattfoster.clara.co.uk/madwifi-2.htm

After reviewing your settings, all you need is the following 

```

essid_00805A224A37="WLAN"

preferred_aps=("WLAN")

```

You only need to set essid_008 if the AP is not broadcasting it's ESSID.

The above also makes the assumption that your ESSID is WLAN.

But I repeat, if it's working in windows then your results show that it's a driver problem - something I cannot really help with. FWIW, I use a recent CVS version of the madwifi driver on my main PC without any problems (pci card)

----------

## BeTo

I tried th CVS version but it's still the same problem.

I don't know if I'm doing something wrong. Resuming:

First of all I emerge wireless-tools, wireless-config and madwifi. Then, as I have pcmcia support in the kernel (I also tried non-pcmcia recompiled kernels), I just load the drivers wlan, ath_hal and ath_pci. I linked the net.eth0 to net.ath0 (I also tried to copy it). Everything goes well, no errors at the moment.

Then i configured my /etc/conf.d/wireless file. After I run the /etc/init.d/wireless.sh. Ok, no errors. 

And then I run /etc/init.d/net.ath0 start. No errors,  but the 2 alternating leds (first one, then the other and so). And no results in iwconfig ath0 scan.

I noticed that the changes I do in /etc/conf.d/wireless are not being set by running /etc/init.d/wireless.sh., because the output of iwconfig is always the same. The only way to change that is doing iwconfig ath0 essid WLAN and so on.

Do you know where is the problem?

Sorry, I'm a bit desperated.

----------

## UberLord

 *BeTo wrote:*   

> 
> 
> Then i configured my /etc/conf.d/wireless file. After I run the /etc/init.d/wireless.sh. Ok, no errors. 
> 
> And then I run /etc/init.d/net.ath0 start. No errors,  but the 2 alternating leds (first one, then the other and so). And no results in iwconfig ath0 scan.
> ...

 

You don't actually run wireless.sh as it gets loaded by /etc/conf.d/net

You did patch /etc/conf.d/net as the ebuild instructed you?

Here's a sample output

```
* Running preup function

 *   Configuring wireless network for eth1

 *   Scanning for access points

 *     Found "UberNET" at 00:0C:76:70:79:B0 (WEP required)

 *   Connecting to "UberNET" (WEP enabled)...                             [ ok ] *     eth1 connected to "UberNET" in managed mode

 *     on channel 11 (WEP enabled)

 * Bringing eth1 up via DHCP...                                           [ ok ] *   eth1 received address 192.168.2.11

```

If you don't see anything saying "wireless" when starting, stopping or restarting net.eth0 or net.ath0 then your /etc/conf.d/net is not patched correctly.

```

ebuild /var/db/pkg/net-wireless/wireless-config/wireless-config-0.4.6.ebuild config

```

That will patch /etc/conf.d/net accordinly

But I repeat - it still will not work as the driver cannot "see" any access points

----------

## amigafan

I switched from orinoco_cs (included in kernel 2.6.x source) to linux-wlan-ng drivers and now I've got some trouble with my /etc/init.d/net.wlan0 : when I try to start it I get the following (yellow) error messages:

```
wlan0 does not support setting the mode to "managed"

wlan0 does not support setting keys

wlan0 does not support setting essid
```

Maybe wlan-ng is not comaptible with wireless-tools!? How to fix?

kernel 2.6.7-rc2

uberlords "old" net.ethx scripts (they worked fine with orinico_cs)

Thanks,

 kai

----------

## Tanisete

Hi to all:

I'm using wireless-config but i have a little problem. I don't know why, at start, it brings down ath0 and then brought it up again... failing. But when i do manually /etc/init.d/net.ath0 start after, it all goes well!! What can be the problem? Do i post my configs?

I'm using madwifi drivers from the portage, but compiled them manually (because trying to merge have a lot of problems). And I autoload the modules wlan, ath_pci and ath_hal.

Thanks a lot

pd: i've changed the runlevel from default to boot and there's no problem now... well at least at the moment... what can be happening???? something to do with the drivers? the autoload?

I've been testing things all night, and all that /var/log/messages says is:

Jun  6 00:36:28 krynn rc-scripts: Failed to configure wireless for ath0

Jun  6 00:36:28 krynn rc-scripts: preup ath0 failed

Jun  6 00:36:38 krynn rc-scripts: Failed to configure wireless for ath0

Jun  6 00:36:38 krynn rc-scripts: preup ath0 failed

I'm a bit desperate right now... and sleepy!!  :Razz: Last edited by Tanisete on Sun Jun 06, 2004 8:22 am; edited 1 time in total

----------

## Hase

Ok, I killed my gentoo partitions and just reinstalled everything (my, was it easier the second time). But, the wireless is still not working right. "Iwlist wlan0 scan" works, eth0 connects and works,

 /etc/conf.d/net:

 *Quote:*   

> iface_eth0="dhcp"
> 
> iface_wlan0="dhcp"
> 
> ...
> ...

 

eth0 and wlan0 are linked

and /etc/conf.d/wireless:

 *Quote:*   

> 
> 
> essid_wlan0="Hatbox"
> 
> mode_wlan0="Managed"
> ...

 

Etc-update has been run, I can "ifconfig wlan0 up" and "... down", 

but:

 *Quote:*   

> bash-2.05b# /etc/init.d/net.wlan0 restart
> 
>  * Running preup function
> 
>  *   Configuring wireless network for wlan0
> ...

 

dmesg gives no error.

Any ideas?

----------

## UberLord

 *amigafan wrote:*   

> I switched from orinoco_cs (included in kernel 2.6.x source) to linux-wlan-ng drivers and now I've got some trouble with my /etc/init.d/net.wlan0

 

linux-wlan-ng do not currently support the entire wireless-tools package which my script uses - which sucks. AFAIK it's the only driver that uses it's own setup. If you wish to continue using my script you have to go back to the orinoco kernel drivers or wait until linux-wlan-ng supports wireless-tools completely - which the developers are aiming for I believe

----------

## UberLord

 *Hase wrote:*   

> Ok, I killed my gentoo partitions and just reinstalled everything (my, was it easier the second time). But, the wireless is still not working right. "Iwlist wlan0 scan" works, eth0 connects and works,
> 
> ```
> 
> essid_wlan0="Hatbox"
> ...

 

If iwlist wlan0 scan works, then you really don't need to hardset the ESSID - so comment out the line essid_wlan0=

If the ESSID is not being broadcast, you can may the MAC addresss to the ESSID so that you can still scan.

essid_012344555="Hatbox"

As to it not connecting - if it see's it fine then the chances are that the WEP key is incorrect. Try removing WEP and then trying.

----------

## UberLord

 *Tanisete wrote:*   

> Hi to all:
> 
> I'm using wireless-config but i have a little problem. I don't know why, at start, it brings down ath0 and then brought it up again... failing. But when i do manually /etc/init.d/net.ath0 start after, it all goes well!! What can be the problem? Do i post my configs?
> 
> I'm using madwifi drivers from the portage, but compiled them manually (because trying to merge have a lot of problems). And I autoload the modules wlan, ath_pci and ath_hal.
> ...

 

I would guess that there's a driver loading problem.

I would also guess that you're running hotplug - if you are then you do not need to autoload the modules as hotplug will do this for you  :Smile: 

Also, if it's a PCI card then you do not need to put net.ath0 in any startup as hotplug will also start it for you  :Smile: 

----------

## _hephaistos_

hello UeberLord,

again some problems  :Smile: 

with ndiswrapper...

I stupidly deleted the "working" (for me) sources from the CVS repository from may... a past 0.7 version.

well -> so I downloaded the current version from CVS 0.8-rc3... but after a time my whole System freezes and I have to hard-reboot.

well so I decided to download the 0.7 version -> but this is not working...

iwlist scan -> lists my AP

iwconfig wlan0 -> also my AP

/etc/init.d/net.wlan0 start -> brings:

```

 * Running preup function

 *   Configuring wireless network for wlan0

 *   Connecting to "APNAme" (WEP enabled)...                              [ ok ]

 *     wlan0 connected to "APNAme" in managed mode

 *     on channel 10 (WEP enabled)

 * Bringing wlan0 up via DHCP...                                          [ !! ]

```

where can I find the "!!" log message?

I post here, because I will try to find help here before I write to the mailing list...

thx in advance

----------

## BeTo

I have the same problem. After hours probing things this is the output if I configured the ath0 with DHCP:

```

root@localhost beto # /etc/init.d/net.ath0 start

 * Running preup function

 *   Configuring wireless network for ath0

 *   Connecting to "WLAN" (WEP disabled)...                               [ ok ]

 *     ath0 connected to "WLANPz" in managed mode

 *     on channel 07 (WEP disabled)

 * Bringing ath0 up via DHCP...                                           [ !! ]

```

First of all, is it normal that first says "connecting to WLAN", and after ..."connected to WLANPz"? The error in /var/log/messages is:

```

Jun  6 19:22:54 localhost dhcpcd[2544]: timed out waiting for a valid DHCP server response

```

If I try to configure ath0 with a static IP, the error is:

```

root@localhost beto # /etc/init.d/net.ath0 start  * Running preup function

 *   Configuring wireless network for ath0

 *   Connecting to "WLAN" (WEP disabled)...                               [ !! ] 

 * Failed to configure wireless for ath0

 * preup ath0 failed

```

And in /var/log/messages:

```

Jun  6 19:21:46 localhost rc-scripts: Failed to configure wireless for ath0

Jun  6 19:21:47 localhost rc-scripts: preup ath0 failed

```

Of course, iwlist ath0 scan gives no results. And finally the iwgetid output:

```

root@localhost beto # iwgetid ath0 -s

WLANz

root@localhost beto # iwgetid ath0 -a

ath0      Access Point/Cell: 00:80:5A:22:4A:37

root@localhost beto # iwgetid ath0 -f

ath0      Frequency:2.432GHz

root@localhost beto # iwgetid ath0 -p

ath0      Protocol Name:"IEEE 802.11"

```

Please help...

----------

## electric_hamster

I carried out the installation instructions for the script exactly, but when performing the final emerge I got these two errors:

```
install: cannot stat `wireless.sh': No such file or directory

install: cannot stat `wireless': No such file or directory
```

After the emerge completes, "wireless.sh" does not exist on my system, nor does the "wireless" config file, but all of the modifications to other files have taken place correctly ("/etc/conf.d/net" for example).

Can anyone help? I need wifi working ASAP....   :Confused: 

----------

## Hase

 *UberLord wrote:*   

> 
> 
> If iwlist wlan0 scan works, then you really don't need to hardset the ESSID - so comment out the line essid_wlan0=

 

I commented it out and now:

 *Quote:*   

> bash-2.05b# /etc/init.d/net.wlan0 restart
> 
>  * Running preup function
> 
>  *   Configuring wireless network for wlan0
> ...

 

 *Quote:*   

> 
> 
> As to it not connecting - if it see's it fine then the chances are that the WEP key is incorrect. Try removing WEP and then trying.

 

I have removed the key from both the router as well as the setup, prior to the the try posted above (as you can see by the "wep disabled"). Might I need to try a different ebuild of yours or a different driver? I would assume that if the scan is working, the driver works but I could be (and often am) wrong.[/quote]

----------

## Hase

Ok, I redid the ebuild and entirely disabled the wep and it works. When I reenable it, it will not connect. I have checked and rechecked the keys. Is there another setting that it might be? I guess I will just use MAC filtering until I get it resolved.

----------

## Sqeaky

I just got my laptop mostly up. a few little things that I think I can troubleshoot. I am just wondering if what I did is ok.

After the emerge completed it asked me to patch /etc/conf.d/net. following the instructions provided failed. so I added this to the end of my /etc/conf.d/net file

```

source /etc/init.d/wireless.sh

preup() {

        wireless_up ${1}

        return $?

}

predown() {

        wireless_down ${1}

        return $?

} 

```

I found this in this thread a few pages back I am just wondering is there anything else I should do, is this what the patch should be?

----------

## Hase

Assuming that that patch is correct, all you should have to do is "etc-update" then configure your /etc/conf.d/wireless file with your correct settings essid, wep key, etc.). I am still fairly new and not sure that this is it so anyone else feel free to chime in.

----------

## UberLord

 *hephaistos6 wrote:*   

> 
> 
> iwlist scan -> lists my AP
> 
> iwconfig wlan0 -> also my AP
> ...

 

If iwlist shows your AP, there is no need to hardcode the essid. Instead it's preferred to use the preferred list  :Wink: 

```

#essid_wlan0=""

preferred_aps=("APNAme")

```

As to it not connecting, well thats probably a WEP key problem

----------

## UberLord

 *BeTo wrote:*   

> I have the same problem. After hours probing things this is the output if I configured the ath0 with DHCP:
> 
> ```
> 
> root@localhost beto # /etc/init.d/net.ath0 start
> ...

 

That's an error with the madwifi drivers. I stopped getting it when I used a recent CVS version

 *Quote:*   

> 
> 
>  The error in /var/log/messages is:
> 
> ```
> ...

 

That clearly shows there is a problem with your card talking to your Access Point as sometimes it connects to the AP and sometimes it does not and sometime scanning works and sometimes it does not.

[url=https://forums.gentoo.org/viewtopic.php?t=182163]As you stated in another thread[/quote] scanning does work at times. Did my advise there work? I don't know as you never replied.

Do you get the same problem if you're right next to the access point?

----------

## UberLord

 *electric_hamster wrote:*   

> I carried out the installation instructions for the script exactly, but when performing the final emerge I got these two errors:
> 
> ```
> install: cannot stat `wireless.sh': No such file or directory
> 
> ...

 

I've never seen that one!

You could always extract the two files from the tarball - put wireless in /etc/conf.d and wireless.sh in /etc/init.d and patch /etc/conf.d/net as shown a few posts ago

----------

## UberLord

 *Hase wrote:*   

> Ok, I redid the ebuild and entirely disabled the wep and it works. When I reenable it, it will not connect. I have checked and rechecked the keys. Is there another setting that it might be? I guess I will just use MAC filtering until I get it resolved.

 

May be "open" or "restricted" WEP type as well.

I use "open" myself as it's more secure imo. Of course, you can configure some AP's to only accept open or restricted WEP types

----------

## UberLord

 *Sqeaky wrote:*   

> After the emerge completed it asked me to patch /etc/conf.d/net. following the instructions provided failed.

 

How did it fail?

Can I improve my instructions?

 *Quote:*   

> 
> 
>  so I added this to the end of my /etc/conf.d/net file
> 
> ```
> ...

 

That's the right patch OK  :Smile: 

----------

## Tanisete

Thanks UberLord, it seems that the autoloaded modules were the problem. But i deleted net.ath0 from rc and hotplug didn't started it so i had to add it again manually to default runlevel. I've read some posts were you suggest to change to cvs madwifi drivers... is there a great improvement? I'm using the ones from the portage.

Thanks a lot!!

----------

## markfl

 *UberLord wrote:*   

>  *Hase wrote:*   Ok, I redid the ebuild and entirely disabled the wep and it works. When I reenable it, it will not connect. I have checked and rechecked the keys. Is there another setting that it might be? I guess I will just use MAC filtering until I get it resolved. 
> 
> May be "open" or "restricted" WEP type as well.
> 
> I use "open" myself as it's more secure imo. Of course, you can configure some AP's to only accept open or restricted WEP types

 

Yeah this helped for me, at school i needed to use open WEP.

Kind of an oxymoron, "Open Security".....

Mark

----------

## _hephaistos_

hello,

well I didn't make any changes to the config files...

they worked as they are  :Sad: 

ahhh - it's so strange  :Smile: 

ciao

----------

## UberLord

 *Tanisete wrote:*   

> Thanks UberLord, it seems that the autoloaded modules were the problem. But i deleted net.ath0 from rc and hotplug didn't started it so i had to add it again manually to default runlevel. I've read some posts were you suggest to change to cvs madwifi drivers... is there a great improvement? I'm using the ones from the portage.
> 
> Thanks a lot!!

 

The latest one in portage kept on dropping it's connection to my AP on a very regular basis. Plus, iwgetid didn't work too well with it.

Both issues are fixed with a recent CVS driver - well, for me at any rate   :Cool: 

----------

## noneckturtle

I currently have a laptop that uses eth0 as the onboard ethernet connection. For maximum flexibility I also use a pcmcia ethernet card that is eth1 when plugged in.

I haven't tested the wireless-config ebuild yet but would like to know how this handles configurations like mine. eg If I have the pcmcia card (eth1) plugged in will it load without errors? Can I then use cardmgr to unload the pcmcia (eth1) when required, eject the card and insert the pcmcia wireless card, restart eth1 and have the wireless extensions enabled?

----------

## UberLord

 *noneckturtle wrote:*   

> I currently have a laptop that uses eth0 as the onboard ethernet connection. For maximum flexibility I also use a pcmcia ethernet card that is eth1 when plugged in.
> 
> I haven't tested the wireless-config ebuild yet but would like to know how this handles configurations like mine. eg If I have the pcmcia card (eth1) plugged in will it load without errors? Can I then use cardmgr to unload the pcmcia (eth1) when required, eject the card and insert the pcmcia wireless card, restart eth1 and have the wireless extensions enabled?

 

The answer is yes you can!

I have a config like yours on my lappy.

For the wired connection I use ifplugd which brings up/takes down the interface if the cable is plugged in or not - it's like pcmcia cardmgr but for ethernet  :Smile: 

----------

## BeTo

UberLord wrote:

 *Quote:*   

> 
> 
> That's an error with the madwifi drivers. I stopped getting it when I used a recent CVS version 
> 
> 

 

No way with the CVS drivers. I unmerged the madwifi drivers on portage and make the CVS version. It compiled without problems, but when doing "make install" to locate them in /lib/modules theres a problem with unresolved symbols with loop and rd, but it place them right in the directory. 

UberLord wrote:

 *Quote:*   

> 
> 
> As you stated in another thread

  scanning does work at times. Did my advise there work? I don't know as you never replied.

Do you get the same problem if you're right next to the access point?

[/quote]

Not, it didn't work..but thanks a lot because I know I'm being a bit boring asking all the time.

Now I'm getting all the time the same error:

```

* Failed to configure wireless for ath0

 * preup ath0 failed

```

or

```

 *   Failed to associate with any preferred access points

 * No access points found for ath0

 * Failed to configure wireless for ath0

 * preup ath0 failed

```

I'm thinking it may be a problem with pcmcia, but the leds of card and so on are working. May be there is some kind of requirement for the kernel...

----------

## UberLord

 *BeTo wrote:*   

> 
> 
> No way with the CVS drivers. I unmerged the madwifi drivers on portage and make the CVS version. It compiled without problems, but when doing "make install" to locate them in /lib/modules theres a problem with unresolved symbols with loop and rd, but it place them right in the directory. 
> 
> 

 

I get the same unresolved symbols messages, but the driver still works - trust me on this.

 *Quote:*   

> 
> 
> I'm thinking it may be a problem with pcmcia, but the leds of card and so on are working. May be there is some kind of requirement for the kernel...

 

You may be right

Try putting this line imediately after preup() { in /etc/conf.d/wireless

```

sleep 10
```

This will force a 10 second pause before trying to configure wireless.

----------

## rhcreed

ok, I've got a wireless card, orinoco gold pcmcia, the ethernet in the second pcmcia slot is good, I beleive I built in wireless to everything during my install, however - 

I have none of the commands you are refering to- iwconfig ifconfig

I have no wireless in my /etc/conf.d directory

I have no idea if the card is even alive (no lights...)

can you help a no0b out?...

----------

## incognita

first, big thanx to the author of the ebuild: it does its job perfectly connecting a BELKIN F5D7010 PCMCIA card to a D-LINK DI-514 Router  :Very Happy: 

just in case anybody has any questions about those two, just ask me, I've probably seen all the dead ends ...  :Wink: 

now my question:

there are options in /etc/conf.d/wireless to override the settings of network interfaces on a per ESSID basis - what is the syntax expected by routes_MyEssid="..." ? a small example would be very welcome ...

thank u

incognita

----------

## UberLord

 *incognita wrote:*   

> now my question:
> 
> there are options in /etc/conf.d/wireless to override the settings of network interfaces on a per ESSID basis - what is the syntax expected by routes_MyEssid="..." ? a small example would be very welcome ...
> 
> 

 

I don't actually know - they just overwrite the same options in /etc/conf.d/net

A quick look in net.eth0 shows the following

```
#       routes_IFACE                    (array of route lines)
```

So I would guess that you do this

```
route_ESSID=("route command 1" "route command 2")
```

----------

## UberLord

 *rhcreed wrote:*   

> ok, I've got a wireless card, orinoco gold pcmcia, the ethernet in the second pcmcia slot is good, I beleive I built in wireless to everything during my install, however - 
> 
> I have none of the commands you are refering to- iwconfig ifconfig
> 
> I have no wireless in my /etc/conf.d directory
> ...

 

I suggest you follow the intructions on page 1 of this thread.

----------

## UberLord

NEW EBUILD POSTED

Added a new variable - ifconfig_fallback_ESSID

According to net.eth0 it uses this ifconfig command if DHCP fails to get an IP address

Fixed a few outstanding bugs

This should be the last ebuild I post for a while as it's pretty much feature complete now.

The only thing I plan todo in the future is to integrate WPA support. My hardware now fully supports WPA, but alas my drivers do not. When prism54 or madwifi support WPA then I shall begin implementing it.

In the meantime, patches are welcome if anyone else can beat me to it   :Wink: 

----------

## jido

I am using wireless-config. Do I need to keep the firmware of the card in /usr/lib/hotplug/firmware ?

If I remove it the wireless card (WG511) stops working, like that:

```
bash-2.05b# /etc/init.d/net.eth0 start

 * Running preup function

 *   Configuring wireless network for eth0

 *   Connecting to "any" (WEP disabled)...                                [ !! ]

 * No access points found for eth0

 * Failed to configure wireless for eth0

 * preup eth0 failed

```

But if I put the firmware back in /usr/lib/hotplug/firmware, I see:

```
bash-2.05b# /etc/init.d/net.eth0 start

 * Running preup function

 *   Configuring wireless network for eth0

 *   Connecting to "any" (WEP disabled)...                                [ ok ]

 *   Connecting to "fNCR" (WEP enabled)...        [ ok ]

 *     eth0 connected to "fNCR" in managed mode

 *     on channel 1 (WEP enabled)

 * Bringing eth0 up via DHCP...                                           [ ok ]

 *   eth0 received address 10.0.1.5

```

I got the idea of removing the firmware because I noticed in dmesg many messages that made me think that it was uploaded to the card each time the network is started  :Rolling Eyes: 

----------

## Sqeaky

 *Quote:*   

> How did it fail?
> 
> Can I improve my instructions?
> 
> Quote:
> ...

 

I am going to update with the latest version that you just put up. And I will give you the exact error message. Thanks for getting back to me.

----------

## Sqeaky

 *Quote:*   

> * To complete installation, you must
> 
>  * 1. Update your configuration files:
> 
>  *      etc-update
> ...

 

this is the part of the install i get to this time when I etc-update. the first time I merged everything, this time I used my my /etc/conf.d/wireless and just updated the script. I had to remove th patch from /etc/conf.d/net to get step 2 to come up the correct way, thats kinda nifty. I like the autodetection.

this is my outcome when I run part two, I am logged in as root when I do it.

```
sqeaky wireless-config # ebuild /var/db/pkg/wireless-config-0.4.7/wireless-config-0.4.7/wireless-config-0.4.7.ebuild config

!!! doebuild: /var/db/pkg/wireless-config-0.4.7/wireless-config-0.4.7/wireless-config-0.4.7.ebuild not found for config

```

I believe this error is similar to the one I got yesterday, what does it mean. normally I am pretty good with errors but this is a bit to vague for me so I will just stick with the manual patch.

anyway this is end result with my config file setup the way I want.

```

sqeaky wireless-config # /etc/init.d/net.wlan0 restart

 * Unmounting network filesystems...                                      [ ok ]

 * Stopping SETI@home...                                                  [ ok ]

 * Running predown function

 *   Removing wireless configuration from wlan0...                        [ ok ]

 * Bringing wlan0 down

 *   Releasing DHCP lease for wlan0...                                    [ ok ]

 *   Stopping wlan0...                                                    [ ok ]

 * Running preup function

 *   Configuring wireless network for wlan0

 *   Connecting to "any" (WEP disabled)...                                [ !! ]

 *   No preferred access points found

 *   Trying to force preferred incase they are hidden

 *   Connecting to "docenter" (WEP enabled)...                            [ !! ]

 *   Connecting to "sqeaky" (WEP enabled)...                              [ ok ]

 *     wlan0 connected to "sqeaky" in managed mode

 *     on channel 11 (WEP enabled)

 * Bringing wlan0 up via DHCP...                                          [ ok ]

 *   wlan0 received address 192.168.1.109

 * Mounting network filesystems...                                        [ ok ]

 * Starting SETI@home...                                                  [ ok ]

```

----------

## UberLord

@Squeaky

Could you verify that the ebuild exists?

/var/db/pkg/wireless-config-0.4.7/wireless-config-0.4.7/wireless-config-0.4.7.ebuild

Also, when connecting to "any" it completely ignores your preferred list so I would not set the ESSID to anything at all for wlan0

#wlan0="any"

----------

## UberLord

 *jido wrote:*   

> I am using wireless-config. Do I need to keep the firmware of the card in /usr/lib/hotplug/firmware ?
> 
> ....
> 
> I got the idea of removing the firmware because I noticed in dmesg many messages that made me think that it was uploaded to the card each time the network is started 

 

Yes oh yes - you need to keep the firmware.

The firmware is uploaded everytime the card is inserted (PCMCIA) or the computer is turned on.

----------

## Sqeaky

The file does not exist, Idon't know why I thought I followed the instructions.It works better  now it goes directly to the correct essid. Thanks  :Smile: 

----------

## UberLord

 *Sqeaky wrote:*   

> The file does not exist, Idon't know why I thought I followed the instructions.

 

The file should be installed by portage.

If it doesn't exists then you have problems - big problems with your system afaik.

/var/db/pkg stores all the installed ebuilds. I would emerge another package and check for any errors after the emerge command - something small and quick like my wireless-config  :Wink: 

----------

## jido

 *UberLord wrote:*   

>  *jido wrote:*   I am using wireless-config. Do I need to keep the firmware of the card in /usr/lib/hotplug/firmware ?
> 
> ....
> 
> I got the idea of removing the firmware because I noticed in dmesg many messages that made me think that it was uploaded to the card each time the network is started  
> ...

 

Thanks for the info. In that case, I imagine the "firmware" is written to the card volatile memory, not to Flash memory? I would not want to damage the card with a bad flashing.

----------

## UberLord

 *jido wrote:*   

> 
> 
> Thanks for the info. In that case, I imagine the "firmware" is written to the card volatile memory, not to Flash memory? I would not want to damage the card with a bad flashing.

 

I think that more modern cards don't have flash memory as such - I know that Windows drivers upload firmware to Prism54 devices everytime the driver loads.

I think this is so that customers don't ever have to risk "flashing" their units so they don't have to be returned in the event of a faulty flash.

----------

## species007

Hi there,

first of all, big credits to the author of this suite of scripts - they are awesome. No more fuddling around with command-line configuration issues ... thumbs up!

One minor question arises though - I hope I have not missed it while glancing through this thread, but more than 30 pages are not easy to check ....  :Wink: 

I have a notebook with eth0=fixed, built-in network adapter, and my pcmcia-card netgear ma401 as eth1. both nics work perfectly. When the pcmcia-card is inserted, the network interface is started up according to its settings in /etc/conf.d/wireless.

Okay, now i wish to achieve the following: At home, I have a wired network solution as well as a wireless network. When inserting the pcmcia-card, it should dominate the gateway settings of the fixed, built-in network adapter.

In "wireless", I already have set the "gateway"-variable as well as the "routes"-variable. Both values look like this:

routes_myESSID="default gw my_gateway_ip dev eth1"

gateway_myESSID="my_gateway_ip"

Nevertheless, the route is not set accordingly, but no error message is thrown, though.

What is wrong, and how to solve this problem? I do not want to use either NIC, which means, that even when eth0 is physically connected, I want eth1's settings to dominate the settings of eth0 ...

Thanks for any solutions! I love Gentoo  :Wink: 

Bye

MS

----------

## UberLord

Not sure - I'll look into it when I get back form work! Not many people use those settings so it may be a bug with my script.

----------

## species007

 *UberLord wrote:*   

> Not sure - I'll look into it when I get back form work! Not many people use those settings so it may be a bug with my script.

 

Thanks - tell me if you need any further details about my system!

Bye

MS

----------

## rhcreed

ok, in order to use kismet, the orinoco card needs to be patched. 

I've found the patches and teh drivers, but whenever i try to 'make' them, I get a ton of errors.

I'm using the 2.6.5 kernel, how can I find the driver version I'm using so I can get the patch for it.

if I copy the orinoco.cs files from the driver .tar file over the ones in my system now will that work?

anyone have any luck with this and the 2.6.5-r1 kernel?

thx..

----------

## UberLord

 *species007 wrote:*   

> 
> 
> In "wireless", I already have set the "gateway"-variable as well as the "routes"-variable. Both values look like this:
> 
> routes_myESSID="default gw my_gateway_ip dev eth1"
> ...

 

OK - I've looked into this and the variables are working accordingly.

Please out the output of starting net.eth1 and your /etc/conf.d/wireless settings - leave everything as is except for WEP keys.

----------

## species007

Thanks for your quick reply. The "./net.eth1 start" command results in the following route error (after some time):

```
init.d # ./net.eth1 start

 * Running preup function

 *   Configuring wireless network for eth1

 *   Connecting to "mine" (WEP enabled)...                             [ ok ] *     eth1 connected to "mine" in managed mode

 *     on channel 10 (WEP enabled)

 * Bringing eth1 up (10.37.147.133)...                                    [ ok ] *   Adding routes

 *     route add default gw 10.37.147.130 dev eth1...

route: Host name lookup failure                                           [ !! ]

```

The following is my wireless - configurationfile:

```

# /etc/conf.d/wireless:

# Global wireless config file for net.* rc-scripts

##############################################################################

# HINTS

##############################################################################

# Remember to change eth0 to your wireless interface which may be

# eth0, eth1, wlan0, ath0 - you get the idea. If you're not sure

# you can type "iwconfig" at the command prompt and it will tell you which

# interfaces are wireless.

# Say that your wireless interface is ath0 - the line

#      #essid_eth0="any"

# becomes

#      #essid_ath0="any"

#

# Remember to change ESSID to your ESSID.

# Say that your ESSID is My NET - the line

#      #key_ESSID="s:passkey"

# becomes

#      #key_My_NET="s:passkey"

# Notice that the space has changed to an underscore - do the same with all

# characters not in a-z A-Z (english alphabet) 0-9.

#

# Any ESSID's in quotes like essid_eth0="My NET" may need to be escaped

# This means placing the character \ before the character

# \" need to be escaped for example

# So if your ESSID is

#      My "\ NET

# it becomes

#      My \"\\ NET

# for example

#      #essid_eth0="My\"\\NET"

#

# As a final note, most users will just need to set the following options

# key_ESSID1="s:yourkeyhere enc open"

# key_ESSID2="s:yourothrkey enc open"

# preferred_aps=("ESSID1" "ESSID2")

#

# Clear? Good. Now configure your wireless network below

#########################################################

##############################################################################

# SETTINGS

##############################################################################

# Hard code an ESSID to an interface - leave this unset if you wish the driver

# to scan for available Access Points

# Set to "any" to connect to any ESSID - the driver picks an Access Point

# This needs to be done when the driver doesn't support scanning

# This may work for drivers that don't support scanning but you need automatic

# AP association

# I would only set this as a last resort really - use the preferred_aps

# setting at the bottom of this file

essid_eth1="mine"

# Set the mode of the interface (ad-hoc or managed). Managed is default

# If it's ad-hoc you also need to specify the channel below

#mode_eth0="Managed"

# If managed mode fails, drop to ad-hoc mode with the below ESSID?

# If this is set, then remember to configure wireless options such as ifconfig

# for the specified ESSID. Channel can be set (1-14), but defaults to 3 if

# not set.

#

# The below is taken verbatim from the BSD wavelan documentation found at

# http://www.netbsd.org/Documentation/network/wavelan.html

# There are 14 channels possible; We are told that channels 1-11 are legal for

# North America, channels 1-13 for most of Europe, channels 10-13 for France,

# and only channel 14 for Japan. If in doubt, please refer to the documentation

# that came with your card or access point. Make sure that the channel you

# select is the same channel your access point (or the other card in an ad-hoc

# network) is on. The default for cards sold in North America and most of Europe

# is 3; the default for cards sold in France is 11, and the default for cards

# sold in Japan is 14.

#adhoc_essid_eth0="WLAN"

#adhoc_channel_eth0="3"

# Setup any other config commands. This is basically the iwconfig argument

# without the iwconfig $iface

#iwconfig_eth0=""

# Set private driver ioctls. This is basically the iwpriv argument without

# the iwpriv $iface

#iwpriv_eth0=""

# We can define various timeouts here.

#sleep_scan_eth0="1"

#sleep_associate_eth0="5"

# By default a successful association in Managed mode sets the MAC

# address of the AP connected to. However, some drivers (namely

# the ipw2100) don't set an invalid MAC address when association

# fails - so we need to check on link quality which some drivers

# don't report properly either.

# So if you have connection problems try flipping this setting

# Valid options are MAC, quality and all - defaults to MAC

#associate_test_eth0="MAC"

# Some driver/card combinations need to scan in Ad-Hoc mode

# After scanning, the mode is reset to the one defined above

#scan_mode_eth0="Ad-Hoc"

# Below you can define private ioctls to run before and after scanning

# Format is the same as the iwpriv_eth0 above

# This is needed for the HostAP drivers

#iwpriv_scan_pre_eth0="host_roaming 2"

#iwpriv_scan_post_eth0="host_roaming 0"

# Define a WEP key per ESSID

# You can't use "any" for an ESSID here

#key_ESSID="1234-1234-1234-1234-1234-1234-56"

# or you can use strings. Passphrase IS NOT supported

# Note - this example also sets the encryption method to open

# which is regarded as more secure than restricted

key_mine="<deleted>"

# You can also override the interface settings found in /etc/conf.d/net

# Setting name/domain server causes /etc/resolv.conf to be overwritten

#ifconfig_ESSID="dhcp"

#dhcpcd_ESSID="-t 5"

#inet6_ESSID=""

routes_mine=("route add default gw 10.37.147.130 dev eth1")

gateway_mine="10.37.147.130"

#iwconfig_fallback_ESSID="

#nameserver_ESSID="192.168.0.1"

#domain_ESSID="some.domain"

# LEAP users will want to use the preassociate setting to specify

# an authentication script

#preassociate_ESSID="/run/this/script"

# Map a MAC address to an ESSID

# This is used when the Access Point is not broadcasting it's ESSID

# WARNING: This will override the ESSID being broadcast due to some

# Access Points sending an ESSID even when they have been configured

# not too!

# Change 001122334455 to the MAC address and ESSID to the ESSID

# it should map to

#essid_001122334455="ESSID"

# This lists the preferred ESSIDs to connect to in order

# ESSID's can contain any characters here as they must match the broadcast

# ESSID exactly.

# Surround each ESSID with the " character and seperate them with a space

# If the first ESSID isn't found then it moves onto the next

# If this isn't defined then it connects to the first one found

#preferred_aps=("ESSID 1" "ESSID 2")

```

[/code]

----------

## UberLord

 *species007 wrote:*   

> Thanks for your quick reply. The "./net.eth1 start" command results in the following route error (after some time):
> 
> ```
> init.d # ./net.eth1 start
> 
> ...

 

OK - I've checked this with the net.eth0 script and here's what it does.

1 - Routes are set regardless

2 - Gateway is only set if a) the default gateway is not set b) the default gateway is not the same as the one requested.

I would remove the routes_mine setting and instead change the gateway to an IP address in your netmask, but not a valid IP.

Restart the interface and the invalid gateway IP should be set.

Now, replace the invalid IP with the correct one and it should be showtime.

If not, then it's a problem with Gentoo's net.eth0 script or the way you're trying to make it work.

----------

## species007

 *UberLord wrote:*   

> 
> 
> I would remove the routes_mine setting and instead change the gateway to an IP address in your netmask, but not a valid IP.
> 
> Restart the interface and the invalid gateway IP should be set.
> ...

 

Ok, so i removed the routes_mine setting. The problem also with an invalid IP is, that the gateway/routes are not set accordingly.

What I've been able to achieve was that I was able to work, but only when su'ing to root and manually configuring the routing table. I only want this to happen automatically .... I also tried to remove the existing route over eth0 first, then add the new route over eth1 (in the routes_mine-setting), but without success ...

Any more ideas of how to achieve that?

Thanks,

MS

----------

## UberLord

If you stop all interfaces and then start the wireless interface, is the gateway correctly set then?

----------

## species007

 *UberLord wrote:*   

> If you stop all interfaces and then start the wireless interface, is the gateway correctly set then?

 

yes it does (i did reset the routes_mine setting, basically only the gateway-setting is active now).

I guess it would be easy to do with ifplugd ... is there any other way, though? I do not want to unplug my NIC everytime I want to go wireless ...

----------

## UberLord

Looking over your first posting, you imply that you have wired and wireless at home - do they use the same IP subnet?

----------

## species007

yes they do - actually they're running over the same router. does this impose a problem i didn't identify so far?

----------

## UberLord

 *species007 wrote:*   

> yes they do - actually they're running over the same router. does this impose a problem i didn't identify so far?

 

Only for the gentoo net.eth0 script.

You're going to either hack net.eth0 to always set gateway when the variable is set or add custom postup() and postdown() functions to /etc/conf.d/net to add and remove routes based on IFACE.

EDIT: The below thread may help you out

https://forums.gentoo.org/viewtopic.php?t=183826

----------

## species007

thank you very much for your effort. i'm off into weekend now, but try as described in that thread and report back next week.

have a nice day  :Wink: 

----------

## rhcreed

this may be a dumb question, but would this work in Suse9?

thanks

----------

## roboguy

Hi all,

Firstly a big up to UberLord for his brilliant work on these scripts!

Well I have read right through this thread (wow that took a while   :Wink:  ), but I still have a little problem. Unfortunately DHCP refuses to work for me.

If I do an "net.eth1 start" I get the following

```

porthos root # /etc/init.d/net.eth2 start

 * WARNING:  "net.eth2" has already been started.

porthos root # /etc/init.d/net.eth2 restart

 * Running predown function

 *   Wireless extensions not found for eth2

 * Bringing eth2 down...                                                  [ ok ]

 * Running preup function

 *   Wireless extensions not found for eth2

 * Bringing eth2 up via DHCP...                                           [ !! ]

```

the output of iwconfig is:

```

porthos root # iwconfig

lo        no wireless extensions.

eth0      no wireless extensions.

eth2      no wireless extensions.

eth1      NOT READY!  ESSID:"PorthosNet"  

          Mode:Managed  Channel:11  Access Point: 00:00:00:00:00:00  

          Tx-Power=31 dBm   Sensitivity=0/200  

          Retry min limit:0   RTS thr=-1 B   Fragment thr=-1 B   

          Encryption key:<real key in here>   Security mode:restricted

          Link Quality:0  Signal level:0  Noise level:0

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

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

```

And I get no ip address assigned to me.

My /etc/conf.d/net file settings are :

```

iface_eth0="192.168.1.120 broadcast 192.168.1.255 netmask 255.255.255.0"

iface_eth0="dhcp"

iface_eth2="dhcp"

```

And my wireless config settings are:

```

essid_eth1="PorthosNet"

mode_eth1="Managed"

iwconfig_eth2="channel 11"

key_PorthosNet="my real key in here"

ifconfig_PorthosNet="dhcp"

dhcpcd_PorthosNet="-t 5"

gateway_PorthosNet="192.168.1.1"

```

Any one have any clues?

Thanks very much!

Roboguy.

----------

## UberLord

 *rhcreed wrote:*   

> this may be a dumb question, but would this work in Suse9?
> 
> thanks

 

Probably not out of the box - it really depends how another distro's network script layout is.

However, orverriding some network settings (ip address, dhcp, routing, gateway) will not work unless wireless.sh is hacked for the distro's equivalent naming scheme.

As a starting point, you simply need to include the script wireless.sh in the "ifup" or similar script and then hook the preup() and predown() functions in the same way you do in /etc/conf.d/net

You could always try porting them - I have no wish to do this myself.

----------

## UberLord

@roboguy - you need to add iface_eth1="dhcp" to /etc/conf.d/net

The error output is from net.eth2 - which is not a wireless interface. As such I cannot really provide any help for it.

Secondly, your wireless config file has an iwconfig command for eth2 which is wired!!!

I suggest you sort your wired from your non-wired and then get back   :Rolling Eyes: 

----------

## motzky

Hi,

i have a little problem: I cannot get the script to work... It seems that it's functions are never executed...

While emergeing net-wireless/wireless-config-0.4.7 everything went well... So what  else do I have to do ?

Please help

----------

## roboguy

Hi UberLord,

Yup, made the changes you suggested and everything works perfectly! Cheers for that. I should have seen those typos myself... one of those things where after you've been staring at a problem for a while you don't even see the simple stuff  :Wink: 

Fantastic work on these scripts. Makes setting up wireless a breeze. I certainly hope they make it into portage soon!

Cheers,

Roboguy.

----------

## UberLord

 *motzky wrote:*   

> Hi,
> 
> i have a little problem: I cannot get the script to work... It seems that it's functions are never executed...
> 
> While emergeing net-wireless/wireless-config-0.4.7 everything went well... So what  else do I have to do ?
> ...

 

I bet you didn't read the emerge output telling you to patch your /etc/conf.d/net

```

ebuild /var/db/pkg/net-wireless/wireless-config/wireless-config-0.4.7.ebuild config
```

----------

## motzky

I did ebuild config and the output was:

```

root@natascha / # ebuild /var/db/pkg/net-wireless/wireless-config-0.4.7/wireless-config-0.4.7.ebuild config

 * /etc/conf.d/net patched

 * You will have to edit the file /etc/conf.d/net

 * and merge the two preup and/or predown functions together

```

And this is my /etc/conf.d/net (after deleting the second preup and predown functions):

```

# /etc/conf.d/net:

# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/conf.d/net,v 1.7 2002/11/18 19:39:22 azarah Exp $

# Global config file for net.* rc-scripts

iface_eth0="dhcp"

iface_eth1="10.0.0.123 broadcast 10.255.255.255 netmask 255.0.0.0"

iface_wlan0="dhcp"

dhcpcd_eth0="-t 10"

dhcpcd_wlan0="-t 5"

###########################################

# Hook wireless into /etc/init.d/net.eth0

# Please note, these lines should appear

# at the END of the file

source /etc/init.d/wireless.sh

preup() {

   wireless_up ${1}

   return $?

}

predown() {

   wireless_down ${1}

   return $?

}

# End hook

###########################################

```

----------

## UberLord

Motzky, did you create a symbolic link from /etc/init.d/net.eth0 to /etc/init.d/net.yourinterface (like eth1, wlan0, ath0, etc etc)???

----------

## motzky

yes, of course and the /etc/init.d/net.eth0 has version 1.34 2003/11/26

EDIT:

I had a closer look on /etc/init.d/net.eth0 and (if I'm correct) all the script does is to ask the dhcp server for the config data...

But for my wlan0, it has to set the encyption key first, since the driver associates with the first ap matching the key.

So, do I have to modify the /etc/init.d/net.eth0 script somehow ?

----------

## iverson0881

I'm using the latest stable baselayout (1.9.4-r2) and getting v 1.41 2004/05/10 14:16:35 for /etc/init.d/net.eth0. Maybe try upgrading your baselayout and then try UberLord's script.

----------

## UberLord

 *iverson0881 wrote:*   

> I'm using the latest stable baselayout (1.9.4-r2) and getting v 1.41 2004/05/10 14:16:35 for /etc/init.d/net.eth0. Maybe try upgrading your baselayout and then try UberLord's script.

 

Remember to update net.eth0 with etc-update as well

----------

## Helena

Just a simple question. How does one completely remove wireless configuration from an installation? I already performed several steps, including

```
emerge unmerge wireless-tools

emerge unmerge wireless-config

rm /etc/init.d/wireless.sh
```

and removing ndiswrapper and its configuration; after editing /etc/conf.d/net manually, I did

```
update-modules
```

but I still get a boot message:

```
Bringing eth0 up via DHCP...

  eth0 received address x.x.x.x

Please make sure that /etc/conf.d/net has $ifconfig_wlan0 set

(or $iface_wlan0 for old-style configuration)
```

I apologize for not flipping through all 36 pages, it may be in there somewhere...

----------

## UberLord

```
rm /etc/conf.d/wireless
```

Unfortunately, all the my wireless files go into the "protected" areas, meaing that they won't get removed automatically and if there are existing files there etc-update has to update them.... 

However, it looks like you have a wireless device hanging around in a runlevel

```
rc-update del net.wlan0
```

----------

## Helena

Oh, of course  :Embarassed:  Thx for the quick reply!

----------

## motzky

Well, I just updated to baselayout 1.9.4-r2 and guess what: my /etc/init.d/net.eth0 still has v1.31 2003/11/26 19:23:15 and no wireless script calls...   :Crying or Very sad: 

----------

## UberLord

Did you do an etc-update?

----------

## motzky

yes, and it said

```

Scanning Configuration files...

Exiting: Nothing left to do; exiting. :)

```

EDIT:

I deleted the net.* links to net.eth0 and net.eth0, reemerged the baselayout and now it works   :Cool: 

EDIT2:

Now I am at home and have another problem: the script ignores my key_ESSID setting (key_ESSID="s:XXXXX enc open") and always tries to connect to ESSID without WEP...   :Rolling Eyes: 

----------

## shoomo

Hi,

I emerged wireless-config 0.4.7, patched /etc/conf.d/net and did a symlink /etc/init.d/net.ath0 to net.eth0

I set key_<mySSID> and preferred_aps in /etc/conf.d/wireless , the rest is commented out.

in /etc/conf.d/net I did

```
iface_ath0="dhcp"

key_AP="****.****.****.****.****.****.**"

iface_eth0="192.168.0.99 broadcast 192.168.0.255 netmask 255.255.255.0"
```

dhcpcd ath0 does time out, so i can´t bring ath0 up. And what I don´t understand:

```
> /etc/init.d/net.ath0 restart

 * Detecting network for ath0...                                          [ ok ]

 * Bringing ath0 up...

 * Failed to bring ath0 up                                                [ !! ]

```

and nothing like 

```

* Running preup function

*   Configuring wireless network for ath0

* Bringing eth0 up via DHCP... 

```

 or something what I read in some previous posts...

thanks,

Tibor

----------

## objectswitch

I have an IBM Thinkpad T40 with the built-in cisco PCI 350 card.

Running gentoo-dev-kernel built with genkernel.  However I found that the cisco driver in those sources did not support my card's firmware, so I picked up patch's from Fabrice Ballet's site that update them to match Cisco's recently released V2.1 driver release for the 2.4 kernel.

Using uberlord's script, all appears to be well.  I added the lines with "RUN" to show what commands it is actually running:

root@espoir>> /etc/init.d/net.eth1 start

 * Running preup function

RUN: /usr/sbin/iwconfig eth1

 *   Configuring wireless network for eth1

/sbin/ifconfig eth1 down

RUN /usr/sbin/iwconfig eth1 rts off 

RUN /usr/sbin/iwconfig eth1 frag off

RUN /usr/sbin/iwconfig eth1 power off

RUN /usr/sbin/iwconfig eth1 txpower auto 

RUN /usr/sbin/iwconfig eth1 key off 

RUN /usr/sbin/iwconfig eth1 essid any

RUN /usr/sbin/iwconfig eth1 mode managed

RUN /usr/sbin/iwconfig eth1 key 2EEA-4467-7534-3B43-3201-932C-32 enc open

RUN /usr/sbin/iwconfig eth1 essid peapod

/sbin/ifconfig eth1 up

 *   Connecting to "peapod" (WEP enabled)...                                             [ ok ]

RUN /usr/sbin/iwlist eth1 channel 

RUN /usr/sbin/iwgetid -s eth1

RUN /usr/sbin/iwgetid -m eth1 

 *     eth1 connected to "peapod" in managed mode

 *     on channel 07 (WEP enabled)

/sbin/ifconfig eth1

 * Bringing eth1 up via DHCP...                                                          [ ok ]

 *   eth1 received address 10.240.4.104

Now:

root@espoir>> iwconfig

lo        no wireless extensions.

eth0      no wireless extensions.

eth1      IEEE 802.11-DS  ESSID:"peapod"  

          Mode:Managed  Frequency:2.442GHz  Access Point: 00:40:96:36:62:38  

          Bit Rate:11Mb/s   Tx-Power=20 dBm   Sensitivity=0/65535  

          Retry limit:16   RTS thr:off   Fragment thr:off

          Encryption key:****-****-****-****-****-****-**   Security mode:open

          Power Management:off

          Link Quality:23/10  Signal level:-37 dBm  Noise level:-97 dBm

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

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

wifi0     IEEE 802.11-DS  ESSID:"peapod"  

          Mode:Managed  Frequency:2.442GHz  Access Point: 00:40:96:36:62:38  

          Bit Rate:11Mb/s   Tx-Power=20 dBm   Sensitivity=0/65535  

          Retry limit:16   RTS thr:off   Fragment thr:off

          Encryption key:****-****-****-****-****-****-**   Security mode:open

          Power Management:off

          Link Quality:23/10  Signal level:-37 dBm  Noise level:-97 dBm

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

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

Logged into the access point and saw that it also agreed there was a good association.

But here is the problem.  If I configure the wired interface down (eth0) or boot with the wired ethernet disconnected, I can't get any traffic through eth1.  Notice the errors returned by ifconfig:

root@espoir>> ifconfig eth1

eth1      Link encap:Ethernet  HWaddr 00:02:8A:A3:44:D2  

          inet addr:10.240.4.104  Bcast:10.240.4.255  Mask:255.255.255.0

          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:107 errors:25818 dropped:0 overruns:0 frame:25818

          TX packets:219 errors:11 dropped:0 overruns:0 carrier:0

          collisions:2 txqueuelen:1000 

          RX bytes:7336 (7.1 Kb)  TX bytes:22790 (22.2 Kb)

          Interrupt:11 Base address:0x8000 

What can be the reason for this interface not working?  Driver issues?

----------

## ximianx0x

hey guys... i have a wireless acx100 card, actually is a Dlink 520+ PCI,  i managed to get the drivers from from the acx project at sourceforge http://acx100.sourceforge.net/ and  patched my kernel. i did it with a 2.6.7-rc2-love2 sources, and  the driver worked fine but i couldnt get my card runing, i emerged wireless-config and no such luck .. so i used the script in the drivers and works like a charm i am actually sending this with my wireless...

 but my question is why didnt it work...?

-i mean could it be that the module has issues with modprobe , i can only get to work using the script, if i load the module manually doesnt work. umm?

-that your script does not suppor my card, although it should?

- or the driver version?, i use a 0.2.0_pre7_plus_fixes_10 , i got it working with that one..

 and my wireless config is 0.4.6 

 any ideas let me know k..  :Cool: 

----------

## gmichels

Just went thru these 36 pages and I guess I haven't seen anyone with a problem similar to mine. My excuses if it already has.

I am using ndiswrapper.

My problem is it looks like the script isn't executing the encryption part. Setting the key manually works.

Uncommented parts of /etc/conf.d/wireless:

```
essid_wlan0="any"

key_homeap="s:blablabla enc open"
```

Calling the script:

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

 * Loading module

 * Configuring wireless network for wlan0...

 *   Scanning for access points

 *     Found "homeap"

 *   Connecting to "homeap"

 *   Failed to associate with the access point homeap

 * No Access Points found for wlan0

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

```
# iwconfig wlan0

wlan0     IEEE 802.11g  ESSID:""

          Mode:Managed  Frequency:2.462GHz  Access Point: FF:FF:FF:FF:FF:FF

          Bit Rate:54Mb/s   Tx-Power:24 dBm

          RTS thr:2347 B   Fragment thr:2346 B

          Encryption key:off

          Power Management:off

          Link Quality:100/100  Signal level:-10 dBm  Noise level:-256 dBm

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

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

# iwlist wlan0 scan

wlan0     Scan completed :

          Cell 01 - Address: 00:0F:3D:3E:FF:06

                    ESSID:"homeap"

                    Protocol:IEEE 802.11b

                    Mode:Managed

                    Frequency:2.437GHz

                    Quality:0/100  Signal level:-35 dBm  Noise level:-256 dBm

                    Encryption key:on

                    Bit Rate:1Mb/s

                    Bit Rate:2Mb/s

                    Bit Rate:5.5Mb/s

                    Bit Rate:11Mb/s

                    Bit Rate:6Mb/s

                    Bit Rate:12Mb/s

                    Bit Rate:24Mb/s

                    Bit Rate:36Mb/s

                    Bit Rate:9Mb/s

                    Bit Rate:18Mb/s

                    Bit Rate:48Mb/s

                    Bit Rate:54Mb/s

# iwconfig wlan0 key s:blablabla enc open

# iwconfig wlan0

wlan0     IEEE 802.11g  ESSID:"homeap"

          Mode:Managed  Frequency:2.437GHz  Access Point: 00:0F:3D:3E:FF:06

          Bit Rate:54Mb/s   Tx-Power:24 dBm

          RTS thr:2347 B   Fragment thr:2346 B

          Encryption key:ABCD-ABCD-ABCD-ABCD-ABCD-ABCD-AB   Security mode:open

          Power Management:off

          Link Quality:100/100  Signal level:-39 dBm  Noise level:-256 dBm

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

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

As you may see, setting the key manually works, but using the script doesn't.

I also tried changing the key line in /etc/conf.d/wireless to "open s:blablabla", no good either.

Any ideas?

----------

## motzky

here is my solution to the encryption setting problem:

change your /etc/conf.d/wireless from

```
key_YOURESSID="s:STRING enc open"
```

into

```
key_YOURESSID="s:STRING"

enc_YOURESSID="open"
```

and then add the following line at the line number specified to /etc/init.d/wireles.sh:

```
95:         eval enc_ESSID=\"\$\{enc_${essid}\}\"

```

and edit line 207 from

```
                e=`${IWCONFIG} ${IFACE} key ${key_ESSID} 2>&1`

```

into

```
                e=`${IWCONFIG} ${IFACE} key ${enc_ESSID} ${key_ESSID} 2>&1`

```

and then line 563 from

```
        local essid_has_config key_ESSID iface_ESSID ifconfig_ESSID d$

```

into

```
        local essid_has_config key_ESSID enc_ESSID iface_ESSID ifconfig_ESSID d$

```

(Sorry, I didn't save the original file  :Rolling Eyes:  , so line numbers could be inaccurate...) 

And now a

```
# /etc/ini.d/net.wlan0 restart
```

should bring your interface up nicely with WEP enabled   :Wink: 

----------

## species007

hi again,

thank you uberlord for providing that proposal of yours last week. just to remember: i'm the guy who wanted to set the SAME gateway (access point) after inserting a wireless interface card. but the net-script refused to do so since there was already a gateway defined with that address.

i now figured out how to unset the default gateway in the preup() - part of the net-script and now need some bash-guru to let me know how to get the correct eth0-gateway-address to set it again in the predow()-function again in order to make wired network work correctly again. or is this idea completely nuts?

bye and thank you

MS

----------

## gmichels

@motzky

Unfortunately that didn't work. I may be wrong but I don't see any practical differences between your changes and the original script, you just split the encryption part into two variables and changed their order in the iwconfig command, which (at least for me) makes no difference.

Thanks for the try anyway  :Smile: 

Anyone else?

----------

## voosuz

 *UberLord wrote:*   

> NEW EBUILD POSTED
> 
> The only thing I plan todo in the future is to integrate WPA support. My hardware now fully supports WPA, but alas my drivers do not. When prism54 or madwifi support WPA then I shall begin implementing it.
> 
> In the meantime, patches are welcome if anyone else can beat me to it  

 

madwifi now supports WPA-PSK (the one most not-enterprise people would use) via wpa_supplicant.

One needs CVS version of both, madwifi and wpa_supplicant, for it though.

in the madwifi FAQ theres a new entry on how to use it.

I haven't tested it yet, but it seems that, after the wpa_supplicant config file is set the only thing to do is:

```

/usr/local/sbin/wpa_supplicant -Bw -d -c/etc/wpa_supplicant.conf -iath0

ifup ath0
```

i don't know if its worth implementing that in this script or if it would be infact easier to just add those lines to local.start or so...

----------

## objectswitch

Answer to my own question.

The ario.c driver does not support the following cisco extensions, which you must disable at your access point:

Enhanced MIC verification for WEP:   	none

Temporal Key Integrity Protocol:             none

You will find these settings under Setup->Ap Radio->Advanced

-David

----------

## brkdncr

output of /etc/init.d/net.ath0 start

```
* Configuring wireless network for ath0...

 * Scanning for access points

 * Found opennet

 * No Access Points found for ath0

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

Uncommented settings in /etc/conf.d/wireless

```
key_OPENNET="s:aabbccddee enc open"

key_BARKERNET="s:aabbccddee enc open"

#essid_ath0="any"

preferred_aps=("OPENNET" "BARKERNET")
```

What's slowing me down here?

----------

## motzky

when you do

```
# iwconfig ath0 key s:aabbccddee enc open

# iwconfig
```

is your card associated with the ap (i.e. is the mac adress listed) ?

If not then try removing "enc" and/or changing the order of "open" and "s:aabbccddee" from your KEY_OPENNET setting or try my patch for the script on p.36

----------

## hawaiianguy203

I followed all your directions, but when i did this:

"ACCEPT_KEYWORDS="~x86" emerge net-wireless/wireless-config"   :Very Happy: 

it gave this error message:

"Nothing to satisfy net-apps/baselayout-1.8.11"   :Sad: 

----------

## iverson0881

If you know how you can edit the ebuild and change that dependancy by removing the numbers after it. I guess the portage devs removed that package now as it is pretty old now.  Just make it "net-apps/baselayout"

iverson0881

----------

## gmichels

I read somewhere at the ndiswrapper mailing list that the key and encryption type must be set before the ESSID is set.

Is this the behavior in this script?

----------

## motzky

after i applied my patch (see p.36), I got it working with and without WEP on 3 different APs with my "ndiswrapped" Dell Truemobile 1300 card

----------

## markfl

 *gmichels wrote:*   

> I read somewhere at the ndiswrapper mailing list that the key and encryption type must be set before the ESSID is set.
> 
> Is this the behavior in this script?

 

It must be because this works fine for me with ndiswrapper

----------

## markfl

@brkdncr

Can you see any access points when you do an "iwlist scan"?

----------

## UberLord

 *shoomo wrote:*   

> Hi,
> 
> I emerged wireless-config 0.4.7, patched /etc/conf.d/net and did a symlink /etc/init.d/net.ath0 to net.eth0
> 
> dhcpcd ath0 does time out, so i can´t bring ath0 up. And what I don´t understand:
> ...

 

I would move /etc/init.d/net.eth0 somewhere else and then re-emerge baselayout. Then it should work.

----------

## UberLord

 *brkdncr wrote:*   

> output of /etc/init.d/net.ath0 start
> 
> ```
> * Configuring wireless network for ath0...
> 
> ...

 

opennet != OPENNET

try this

```
key_opennet="s:aabbccddee enc open"

key_barkernet="s:aabbccddee enc open"

preferred_aps=("opennet" "barkernet")
```

----------

## UberLord

 *gmichels wrote:*   

> I read somewhere at the ndiswrapper mailing list that the key and encryption type must be set before the ESSID is set.
> 
> Is this the behavior in this script?

 

Yes

----------

## UberLord

 *iverson0881 wrote:*   

> If you know how you can edit the ebuild and change that dependancy by removing the numbers after it. I guess the portage devs removed that package now as it is pretty old now.  Just make it "net-apps/baselayout"
> 
> iverson0881

 

It's still there.

The problem was he's trying to emerge it from the liveCD - which afaik won't work as no liveCD has wireless tools.

----------

## UberLord

 *voosuz wrote:*   

>  *UberLord wrote:*   NEW EBUILD POSTED
> 
> The only thing I plan todo in the future is to integrate WPA support. My hardware now fully supports WPA, but alas my drivers do not. When prism54 or madwifi support WPA then I shall begin implementing it.
> 
> In the meantime, patches are welcome if anyone else can beat me to it   
> ...

 

From what I've read, I think I would need to interact with the supplicant directly via a C program or something. Luckily I do know a small bit of C

I'll be looking into it more after I get some free time after I move house - so nothing for a few weeks or so.

----------

## UberLord

Sorry I haven't replied to everyone promptly - I just discovered the thread was moved to the D,T&T forum   :Confused: 

----------

## gmichels

So it seems I am the only one with bad luck here, this script doesn't like me, even with the changes proposed by motzky on p.36  :Very Happy: 

----------

## UberLord

 *gmichels wrote:*   

> So it seems I am the only one with bad luck here, this script doesn't like me, even with the changes proposed by motzky on p.36 

 

The output you posted looks like it's from an older version.

The latest one should show if WEP is required or not for all access points found and if you're connecting with WEP or not.

Check the version of /etc/init.d/wireless.sh

----------

## gmichels

```
# Wireless configuration script

# Version 0.4.7

# Copyright (c) 2004 Roy "UberLord" Marples (uberlord@rsm.demon.co.uk)
```

```
# emerge -p wireless-config

These are the packages that I would merge, in order:

Calculating dependencies ...done!

[ebuild   R   ] net-wireless/wireless-config-0.4.7
```

Trying the latest version.

----------

## gmichels

My apologies, it was all my fault. Here was the problem:

```
# ls -l /etc/init.d/net.wlan0

-rwxr-xr-x  1 root root 16103 Feb 19 18:49 /etc/init.d/net.wlan0
```

It wasn't a link to net.eth0, it was an older version of the script, which I tried back in February.

Uberlord's comment on being an older version made me remember that once I tried this script and there were some leftovers.

Anyway, here it is:

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

 * Running preup function

 *   Configuring wireless network for wlan0

 *   Scanning for access points

 *     Found "homeap" at 00:0F:3D:3E:FF:06 (WEP required)

 *   Connecting to "homeap" (WEP enabled)...                              [ ok ]

 *     wlan0 connected to "homeap" in managed mode

 *     on channel 06 (WEP enabled)

 * Bringing wlan0 up via DHCP...                                          [ ok ]

 *   wlan0 received address 172.16.0.101
```

Thanks a LOT for this nice script.

----------

## brkdncr

 *markfl wrote:*   

> @brkdncr
> 
> Can you see any access points when you do an "iwlist scan"?

 

```
lo        Interface doesn't support scanning : Operation not supported

 

eth0      Interface doesn't support scanning : Operation not supported

 

ath0      No scan results

```

----------

## brkdncr

 *UberLord wrote:*   

>  *brkdncr wrote:*   output of /etc/init.d/net.ath0 start
> 
> ```
> * Configuring wireless network for ath0...
> 
> ...

 

No difference was made...the correct essid is opennet in lowercase though.

----------

## brkdncr

If it makes any difference, this setup was working until i switched from an old script that used /etc/conf.d/net to set essid.  in fact, i can still use those settings to get my network back up.

----------

## UberLord

 *brkdncr wrote:*   

> If it makes any difference, this setup was working until i switched from an old script that used /etc/conf.d/net to set essid.  in fact, i can still use those settings to get my network back up.

 

Could you confirm that net.ath0 is a symlink to net.eth0? If not, do the following

```

rm /etc/init.d/net.ath0

ln -s /etc/init.d/net.eth0 /etc/init.d/net.ath0

```

Then you should get different output

----------

## mlybarger

wow, 37 pages of content! imazing.  i can't seem to reliably connect to my access point (belkin router) using gentoo and encryption. currently have encryption turned off. nice. i haven't tried this ebuild  yet, but it's on the todo for 2night.  just curious if this is in bug.gentoo.org?  is it more challenging to keep a current ebuild there?

anyways, my problem with my current setup is that my essid doesn't get set when i turn encyrption on (if it's already been set with encryption turned off, then it stays set, and i can use encryption). will see if these help out.

----------

## UberLord

 *mark_lybarger wrote:*   

> wow, 37 pages of content! imazing.  i can't seem to reliably connect to my access point (belkin router) using gentoo and encryption. currently have encryption turned off. nice. i haven't tried this ebuild  yet, but it's on the todo for 2night.  just curious if this is in bug.gentoo.org?  is it more challenging to keep a current ebuild there?

 

Not yet - I'm not entirely happy with the ebuild. The script is fine though  :Smile: 

 *Quote:*   

> 
> 
> anyways, my problem with my current setup is that my essid doesn't get set when i turn encyrption on (if it's already been set with encryption turned off, then it stays set, and i can use encryption). will see if these help out.

 

My script may not work for you then as ndiswrapper users require encryption being set before ESSID is set.

Lemmie know how you go though!

----------

## oisch

Hi

Great work. This script really saves me a lot of work.

Nevertheless I would need some sort of post-associate function where I can run my own script (a vpn client in this case).

Is something like this possible?

----------

## UberLord

 *oisch wrote:*   

> Hi
> 
> Great work. This script really saves me a lot of work.
> 
> Nevertheless I would need some sort of post-associate function where I can run my own script (a vpn client in this case).
> ...

 

Doesn't the VPN client need to be run after the network is brought up? If so, then my wireless script can do nothing about that.

There's a postup() and postdown() functions that you can build into /etc/conf.d/net that the net.eth0 script will use.

Do you want to launch the VPN depending on which ESSID you connect to?

----------

## sog

I know this is going to be something ridiculous, but after some false starts, a few issues here and there, i got the script to run - i think. 

basically, the process i followed was as follows:

1. setting up net.eth1 (which is what iwconfig told me my wirless was) as specified in the Gentoo networking docs

2. following install instructions in first post

3. following install instructions in ebuild

so my situation now is that the following: /etc/init.d/net.eth1 start  

returns me this:

```
* Running preup function

 *   Configuring wireless network for eth1

 *   Scanning for access points

 *   eth1 does not support scanning

 *   No preferred access points found

 *   Trying to force preferred incase they are hidden

 *   Connecting to "sog" (WEP enabled)...                                 [ ok ] *     eth1 connected to "sog" in managed mode

 *     on channel 10 (WEP enabled)

 * Bringing eth1 up via DHCP...

```

the DHCP bit gets a !!, so i hardcoded in an IP and it didn't make any difference. 

so in Gnome, the Wireless Link Monitor 2.6 applet shows me as connected, 100% signal strength, but the connection doesn't work. nothing returns. gentoo.org not found, etc. pings fail, etc.

so i've been through most of the posts here, and have figured a few things out, but i'm a bit at a loss here. 

anybody have any thoughts? help much appreciated.

----------

## UberLord

I would guess that your WEP key is wrong.

To verify, disable WEP on your Gentoo and the AP and try again. If it works, then WEP is your problem and try configuring it again.

things to try

key_sog="s:key enc open"

key_sog="open s:key"

key_sog="s:key enc restricted"

key_sog="restricted s:key"

And try all the above with your key in HEX

It's also important to note that this does not support keys generated from a passphrase

----------

## sog

thx for the feedback UberLord. did as requested - shut off encryption (which was only 64 bit, FYI) on the AP - then #'d the key in my wirless file, but on a net.eth1 restart i now get the following:

```

 * Running preup function

 *   Configuring wireless network for eth1

 *   eth1 does not support setting the mode to "managed"

 *   Scanning for access points

SIOCSIFFLAGS: Device or resource busy

 *   eth1 does not support scanning

 *   No preferred access points found

 *   Trying to force preferred incase they are hidden

 *   eth1 does not support setting ESSID to "sog"

 *   Connecting to "sog" (WEP disabled)...                                [ ok ] *     eth1 connected to "" in  mode

 *     on channel  (WEP disabled)

 * Bringing eth1 up (192.168.0.5)...

SIOCSIFFLAGS: Device or resource busy                   
```

tried rebooting the AP, got the same thing. 

anything else to try?

----------

## xJoni

hi,

realy great script - good work, but i also need to run a script after the netup (dhcp) depending on essid (also vpn client).

----------

## mlybarger

 *UberLord wrote:*   

> 
> 
> things to try
> 
> key_sog="s:key enc open"
> ...

 

holy smokes batman! after getting all flustered, i saw this and gave each one a shot.  for me, only the 2nd one worked ok (without the "s:" in there, just "open 1234-5678-90" using my specific hash key.  i also have been trying keys that were generated by passphrase, but i can't imagine how that would mess things up. a key is a key, right?

anyway.  i'm _VERY_ happy for now at least to have encryptoin turned on!!.it even worked through a reboot, which i'm not sure i've had happen yet with encryption.  there seems to be a lot of complicated stuff going on with the config file and the settings.  how does this handle my roaming to a new hotspot?  say i go to the mall which has an open hotspot (no encryption, just connect). do i need to put the ESSID for that location into this config file for it to work?

----------

## oisch

 *Quote:*   

> Doesn't the VPN client need to be run after the network is brought up? If so, then my wireless script can do nothing about that. 
> 
> There's a postup() and postdown() functions that you can build into /etc/conf.d/net that the net.eth0 script will use. 

 

Yes, the vpnc needs a network connection. I followed your reccomendation and wrote this short postup() function (stole some stuff from your script as I'm not really in shell scripting  :Smile: )

It works wuite well. Thanks again for your help.

```
postup() {

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

                IWGETID=`which iwgetid 2>${devnull}`

                essid=`${IWGETID} -s ${IFACE}`

                if [ "unifunk1" = "${essid}" ]; then

                        /usr/bin/vpnc-connect &>/dev/null

                fi

        fi

}
```

To stop the vpn client I modified the postdown() function

```
predown() {

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

                if [ "unifunk1" = "${essid}" ]; then

                        killall vpnc &>/dev/null

                fi

        fi

        wireless_down ${1}

        return $?

}
```

----------

## markfl

 *mark_lybarger wrote:*   

>  say i go to the mall which has an open hotspot (no encryption, just connect). do i need to put the ESSID for that location into this config file for it to work?

 

It worked for me in my local Costa

Comes up with all the local networks, (two encrypted, one open) and it connects to the one without WEP

Mark

----------

## UberLord

 *sog wrote:*   

> thx for the feedback UberLord. did as requested - shut off encryption (which was only 64 bit, FYI) on the AP - then #'d the key in my wirless file, but on a net.eth1 restart i now get the following:
> 
> ```
> 
>  * Running preup function
> ...

 

Looks like a hardware/kernel problem. Try rebooting.

```
eth1 does not support setting the mode to "managed"
```

That line worries me as you did not get it before....

----------

## UberLord

 *oisch wrote:*   

> I followed your reccomendation and wrote this short postup() function (stole some stuff from your script as I'm not really in shell scripting )
> 
> It works wuite well. Thanks again for your help.
> 
> 

 

No problem - here's a small aleration.

```
postup() {

                local IFACE=${1}

                local IWGETID=`which iwgetid 2>${devnull}`

                local essid=`${IWGETID} -s ${IFACE}`

                if [ "unifunk1" == "${essid}" ]; then

                        /usr/bin/vpnc-connect &>/dev/null

                fi

}

predown() {

                local IFACE=${1}

                local IWGETID=`which iwgetid 2>${devnull}`

                local essid=`${IWGETID} -s ${IFACE}`

                if [ "unifunk1" == "${essid}" ]; then

                        killall vpnc &>/dev/null

                fi

        wireless_down ${1}

        return $?

}
```

The "local" directive means that IWGETID and essid won't overwrite any extnernal vars - not that it really matters here, but it's "Good Practice"

Also = means "assign" and == means "test equal"

Also, you cannot "guarantee" (well, actual you can, but it may change in the future) that the wireless interface is always eth1, so why not just test essid against the current IFACE?

EDIT: Had a superfluos "fi" in the code.

----------

## UberLord

 *xJoni wrote:*   

> hi,
> 
> realy great script - good work, but i also need to run a script after the netup (dhcp) depending on essid (also vpn client).

 

Hi xJoni.

You should be able to use the above few posts to help you out  :Smile: 

----------

## sog

 *Quote:*   

> 
> 
> Looks like a hardware/kernel problem. Try rebooting.
> 
> 

 

done - fixed the "SIOCSIFFLAGS" issue. i now get the following:

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

 * Unmounting network filesystems...                                      [ ok ] * Running predown function

 *   Removing wireless configuration from eth1...                         [ ok ] * Bringing eth1 down...                                                  [ ok ] * Running preup function

 *   Configuring wireless network for eth1

 *   Scanning for access points

 *   eth1 does not support scanning

 *   No preferred access points found

 *   Trying to force preferred incase they are hidden

 *   Connecting to "sog" (WEP disabled)...                                [ ok ] *     eth1 connected to "sog" in managed mode

 *     on channel 10 (WEP disabled)

```

still no joy as far as access. if it helps, here's the only uncommented line in my wireless file:

```

preferred_aps=("sog")                                                                                                                             

```

sorry for all the bother, but i'd obviously love to get wireless working in the machine, particularly since it's my travel laptop. 

any and all help appreciated.

----------

## cookiez

My access point has 4 different keys defined and my I set the third one as the default one. When I was setting up wireless for my Pocket PC, I had to tell it that the key I am giving it is key number 3, otherwise it did not connect. Likewise, when I edit /etc/conf.d/wireless and tell it to use the third key, I could not get an IP address or talk to the network. However, when I set the first key in my access point to be default and gave /etc/conf.d/wireless the hex value of that key, everything worked. Is there a way to specify what key number the key is in /etc/conf.d/wireless? Thanks.

----------

## UberLord

 *sog wrote:*   

> 
> 
> sorry for all the bother, but i'd obviously love to get wireless working in the machine, particularly since it's my travel laptop. 

 

Well, according to your output wireless is working.

Are not getting a DHCP address? Are you not able to ping the AP? What?

C'mon - throw me bone here!

----------

## UberLord

 *cookiez wrote:*   

> My access point has 4 different keys defined and my I set the third one as the default one. When I was setting up wireless for my Pocket PC, I had to tell it that the key I am giving it is key number 3, otherwise it did not connect. Likewise, when I edit /etc/conf.d/wireless and tell it to use the third key, I could not get an IP address or talk to the network. However, when I set the first key in my access point to be default and gave /etc/conf.d/wireless the hex value of that key, everything worked. Is there a way to specify what key number the key is in /etc/conf.d/wireless? Thanks.

 

Well the key_ESSID="foo bar" just maps to 

```
iwconfig ${IFACE} key foo bar
```

 so provided you can do it with one iwconfig command then you should be able to do this  :Smile: 

the below should work

```

key_ESSID="s:key1 key s:key2 key s:key3 key s:key4 key [3]"
```

----------

## Helena

I noticed a problem when I recently upgraded my kernel-sources from 2.6.5 to 2.6.7 (gentoo-dev-sources). It could also be that I messed up something else since I fooled around quite a bit.

Anyway, after a lot of experimentation I discovered that my wireless network card refuses to start whenever the power to the card is on at boot time. This apparently results in a number of Yenta driver complaints about an IRQ not taken care of, and the net.wlan0 service will not start.  :Sad:   However, if the power is off at boot, Yenta just smiles at me as does the net.wlan0 service and I'm up and running.  :Smile: 

Anyone seen similar behaviour?

What's more, is there an explanation or even a solution?  :Confused: 

----------

## sog

 *Quote:*   

> Well, according to your output wireless is working.
> 
> Are not getting a DHCP address? Are you not able to ping the AP? What?
> 
> C'mon - throw me bone here!

 

haha - sorry, fair enough. 

ok, it goes like this. you're correct, according to the output, wireless is working. the little Gnome Wireless Link Monitor applet says the same thing - 100% signal. and it's not just DHCP - that's giving me a few problems, but i bypassed that and hard coded in an IP (which the AP - Netgear FM114P - lets me do).

and i CAN ping the gateway. but that's it. nothing external works. ping, browser, etc. everything comes back bad. 

any further thoughts? a free gmail account to whoever solves this for me  :Wink:  and to UberLord either way for writing the script (let me know if you want one, UL).

----------

## UberLord

 *Helena wrote:*   

> I noticed a problem when I recently upgraded my kernel-sources from 2.6.5 to 2.6.7 (gentoo-dev-sources). It could also be that I messed up something else since I fooled around quite a bit.
> 
> Anyway, after a lot of experimentation I discovered that my wireless network card refuses to start whenever the power to the card is on at boot time. This apparently results in a number of Yenta driver complaints about an IRQ not taken care of, and the net.wlan0 service will not start.   However, if the power is off at boot, Yenta just smiles at me as does the net.wlan0 service and I'm up and running. 
> 
> Anyone seen similar behaviour?
> ...

 

Well, with my lappy using 2.6.6 and 2.6.7 sources with my Draytek Vigor 540 (prism54) card, it does not get started at boot even by pcmcia-cs. So I have to add net.eth1 to the default runlevel - no biggie but it works.

My old SMC (prism) card didn't have this problem. It may be something todo with the uploadind of firmware.

----------

## UberLord

 *sog wrote:*   

> 
> 
> haha - sorry, fair enough. 
> 
> ok, it goes like this. you're correct, according to the output, wireless is working. the little Gnome Wireless Link Monitor applet says the same thing - 100% signal. and it's not just DHCP - that's giving me a few problems, but i bypassed that and hard coded in an IP (which the AP - Netgear FM114P - lets me do).
> ...

 

Sounds like you don't have a valid gateway set.

Check the output of the "route" command and check the default gateway is your gateway IP.

----------

## Eagle_

Hi,

I am new at Gentoo, i am trying to make my wireless working at my laptop T41 (WiFi card). I done what UberLord where discrabing (what i understood from it).

I already had enable the two opption in the kernel, in my module list i have  *Quote:*   

> ath_pci                37860  0
> 
> wlan                   56232  1 ath_pci
> 
> ath_hal               128336  1 ath_pci
> ...

 

i also done  *Quote:*   

> ln -sf /etc/init.d/net.eth0 /etc/init.d/net.ath0

 

in my /etc/conf.d/net, i had only iface_eth0="dhcp" and i added also iface_ath0="dhcp"

i dont know how to change my wireless file (what to add if i need anything)

when i type ifconfig i only get eth0 and lo.

when i type rc-update add ath0 defualt i recieve:

 *Quote:*   

>  * /sbin/rc-update: /etc/init.d/ath0 not found; aborting.

 

if someone have any suggestion i would be more then happy

Eagle

----------

## ryceck

Are u sure u have the right driver for ur wifi card?

What does "iwconfig ath0" say?

One more thing to do for u btw: 

```

cp /etc/init.d/net.eth0 /etc/init.d/net.ath0

```

Then u can add net.ath0 to ur default runlevel

----------

## markfl

Sorry, but don't do the cp above, its better if you symlink them so that an update will catch both. 

Mark

----------

## int2str

Great script! Thanks.

----------

## Eagle_

Hi,

This is my output for lspci:

 *Quote:*   

> 0000:00:00.0 Host bridge: Intel Corp. 82855PM Processor to I/O Controller (rev 03)
> 
> 0000:00:01.0 PCI bridge: Intel Corp. 82855PM Processor to AGP Controller (rev 03)
> 
> 0000:00:1d.0 USB Controller: Intel Corp. 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #1 (rev 01)
> ...

 

is there avekabel drivers for my wireless card?

P.S

like you saw i dane ln -s ... not cp

----------

## bennyc

Hi, thanks for the great script.

I'm using linksys wpc54g with ndiswrapper + wireless-config.

net.wlan0 start seems to be fine; however, it shows:

 *Quote:*   

>  * Running preup function
> 
>  *   Configuring wireless network for wlan0
> 
>  *     wlan0 connected as "" in ad-hoc mode
> ...

 

It supposed to show linksys between the two quotation marks right?

I think it's the problem that made the connection to the ap still inaccessible.

I'd be appreicated if someone can help me out with this.

Thanks

P.S: I'm not using any wep, simply essid + mac address restrictions.

----------

## jdhooghe85

im sorry if you have answered this question before but when i try ebuild wireless-config-0.4.7.ebuild digest it comes back with this error:

!!!aux get(): enuild for 'net-wireless/wireless-config-0.4.7' does not exist at 

:

!!!          /usr/portage/net-wireless/wireless-config/wireless-config-0.4.7.ebuild

doebuild(): aux_get() error; aborting

if you know what is going on it would be helpful

 :Confused: 

----------

## markfl

 *jdhooghe85 wrote:*   

> im sorry if you have answered this question before but when i try ebuild wireless-config-0.4.7.ebuild digest it comes back with this error:
> 
> !!!aux get(): enuild for 'net-wireless/wireless-config-0.4.7' does not exist at 
> 
> :
> ...

 

You need to edit /etc/make.conf and uncomment the line about the portage overlay

I think its OVERLAY="/usr/local/portage/"

or similar

The ebuild must be in /usr/local/portage/net-wireless/wireless-config/

Then ebuild <pathtoebuild> digest

then emerge it

Mark

----------

## MikePikeFL

 *UberLord wrote:*   

> the below should work
> 
> ```
> 
> key_ESSID="s:key1 key s:key2 key s:key3 key s:key4 key [3]"
> ...

 

I tried to get this working in vain for HOURS. Same with just iwconfig... I ended up having to change the wireless key index back to 1, and then go around to all the other wireless devices and change the index...   :Evil or Very Mad: 

I don't get it!!!

----------

## UberLord

 *bennyc wrote:*   

> 
> 
>  *     wlan0 connected as "" in ad-hoc mode
> 
> 

 

Well, if the output of "iwgetid" is blank, then you get a blank string. Check what iwgetid says.

----------

## UberLord

 *MikePikeFL wrote:*   

>  *UberLord wrote:*   the below should work
> 
> ```
> 
> key_ESSID="s:key1 key s:key2 key s:key3 key s:key4 key [3]"
> ...

 

Well, maybe your card does not support more than one key under linux  :Sad: 

And my script just runs the iwconfig command - they are one and the same

----------

## MikePikeFL

 *UberLord wrote:*   

> Well, maybe your card does not support more than one key under linux 
> 
> And my script just runs the iwconfig command - they are one and the same

 

I didn't even think of that. I just figured that since it was supposed to work (and had worked in the past) that it was a trivial thing.

Also, I realize that your script was only calling iwconfg, which I couldn't get to work directly either. So really my problem is either with the prism54 driver or iwconfig.

I was just a little frustrated after checking the forums for a supported card, going and getting it, thinking it was going to be cake since there was a howto and everything... and then 12 hours later discovering the only way to get it working was to change my wap and all the other devices in my house. Blah.

At least it works! Thanks for the pages and pages of advice... I read through almost all 39 pages and tried many, many things you suggested!

----------

## UberLord

I only use 1 key myself - I also have prism54 based hardware. I'll see if I can find out something next week

----------

## richk449

Okay, first of all, thank you.  Everything works great.  

Now for my question: as implied above, I installed everything according to your directions, and it works.  I started to have an apci problem though, which I thought might be related to the wireless stuff (specifically, when my fans should come on, kapcid starts sucking up all the CPU and the laptop becomes unusable).  I have no reason to believe that the acpi problem is related to the wireless stuff right now though (although I have yet to find any other possible explanation).

The issue is this: in the process of trying to figure out what is going on, I removed net.eth0 and net.wlan0 from the default runlevel.  But both wired and wireless networking still work.  As far as I can tell, they are started by hotplug, since removing that stops the networking from working.

So my question is this:  is it supposed to be like this?  should I try and fix it somehow?  do I need your script at all?  

I have seen some discussion in this thread, and one linked to, about hotplug and your ebuild.  I am still unlcear on the details though.

----------

## bennyc

 *UberLord wrote:*   

>  *bennyc wrote:*   
> 
>  *     wlan0 connected as "" in ad-hoc mode
> 
>  
> ...

 

iwgetid shows

 *Quote:*   

> wlan0        ESSID:"linksys"

 

----------

## Emorphis

Hello!

Just wanted to say what a great forum post and what a great group of dedicated individuals, so far it's been making this process a lot easier, but I was wondering if I can get some help.  I have seem to encountered an error and perhaps one of you could point me in the right direction.  I have a Atheros Wifi card setup on my Toshiba Sattelite Laptop.  I installed the madwifi drivers and loaded the ath_pci.ko module and iwconfig detects the wifi card as ath0, I emerged UberLoards Ebuild and configured the conf to allow the nic to scan for an AP, however I'm having an issue when i tries to connect to the AP.   

This is what happens when I run ./net.ath0 start

```

* Running preup function

  *   Configuring wireless network for ath0

  *   Scanning for access points

  *     Found "particle" at 00:0F:66:46:65:1A 

  *   Connecting to "particle" (WEP disabled)...                                                                                                                 

  *   No preferred access points found

  *   Trying to force preferred incase they are hidden

  *   Failed to associate with any preferred access points

  * Couldn't associate with any access points

  * Failed to configure wireless for ath0

  * preup ath0 failed

```

(I disabled WEP to simply see if I can get this to connect first)

iwconfig states the following after I run the script:

```

ath0      IEEE 802.11g  ESSID:"particle"    Mode:Managed      Frequency:2.437GHz  Access Point: FF:FF:FF:FF:FF:FF  

           Bit Rate:1Mb/s   Tx-Power:50 dBm   Sensitivity=0/3  

           Retry:off   RTS thr:off   Fragment thr:off

           Encryption key:off

           Power Management:off

           Link Quality:0/94  Signal level:-95 dBm  Noise level:-95 dBm

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

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

Here is how /etc/conf.d/wireless is setup:

```

#essid_ath0="any"

mode_ath0="managed"

dhcpcd_ath0="-t 5"

preferred_aps=("particle")

```

The reason I have it configured like that is I would like my nic to scan for APs prior to connecting to my AP, just incase if I am not around my AP I can still pick up APs available to me.

I would appreciate any information!

Thank you!

----------

## UberLord

 *bennyc wrote:*   

>  *UberLord wrote:*    *bennyc wrote:*   
> 
>  *     wlan0 connected as "" in ad-hoc mode
> 
>  
> ...

 

specifically 

```
iwgetid -s wlan0
```

----------

## UberLord

 *richk449 wrote:*   

> 
> 
> Now for my question: as implied above, I installed everything according to your directions, and it works.  I started to have an apci problem though, which I thought might be related to the wireless stuff (specifically, when my fans should come on, kapcid starts sucking up all the CPU and the laptop becomes unusable).  I have no reason to believe that the acpi problem is related to the wireless stuff right now though (although I have yet to find any other possible explanation).

 

It's possible - but I'm not really a hardware guy. 2.4.x kernels had very flaky ACPI support - If you're still using one then try moving to a 2.6.x kernel

 *Quote:*   

> 
> 
> The issue is this: in the process of trying to figure out what is going on, I removed net.eth0 and net.wlan0 from the default runlevel.  But both wired and wireless networking still work.  As far as I can tell, they are started by hotplug, since removing that stops the networking from working.
> 
> So my question is this:  is it supposed to be like this?  should I try and fix it somehow?  do I need your script at all? 

 

Yes, it's supposed to be like that. The default action of hotplug is to start/stop NIC's based on a few things. Namely, if hotplug has "to do" something then it starts it. For example, my PC has a wired connection and a wireless connection. Everything is compiled into my kernel except for wireless (madwifi) and hotplug only tries to start the wireless.

I think it's because they are compiled as modules - but I'm not sure.

So yes - it's supposed to be like this, it's not broken and it looks like behaviour by design. And you do need my script still.

----------

## UberLord

 *Emorphis wrote:*   

> 
> 
> The reason I have it configured like that is I would like my nic to scan for APs prior to connecting to my AP, just incase if I am not around my AP I can still pick up APs available to me.
> 
> 

 

Hi

Could you post the output of 

```
ifconfig ath0 up

iwlist ath0 scan
```

----------

## Helena

I just noticed that /etc/conf.d/net has changed considerably with the latest version of baselayout, v1.10. Any tips for migrating settings?

----------

## Emorphis

Uberlord, Sure thing.

When I typed ifconfig ath0 up it does not display anything, but here is what ifconfig -a states for ath0

```

ath0      Link encap:Ethernet  HWaddr 00:90:96:8B:18:7D

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:2214 errors:32692 dropped:0 overruns:0 frame:32685

          TX packets:679 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:199

          RX bytes:190721 (186.2 Kb)  TX bytes:35226 (34.4 Kb)

          Interrupt:22 Memory:df96a000-df97a000

```

And here is what iwlist ath0 scan displays:

```

ath0      Scan completed :

          Cell 01 - Address: 00:0F:66:46:65:1A

                    Mode:Master

                    Encryption key:off

                    Quality:54/94  Signal level:-41 dBm  Noise level:-95 dBm

                    Mode:Master

                    ESSID:"particle"

                    Frequency:2.447GHz

                    Bit Rate:1Mb/s

                    Bit Rate:2Mb/s

                    Bit Rate:5Mb/s

                    Bit Rate:6Mb/s

                    Bit Rate:9Mb/s

                    Bit Rate:11Mb/s

                    Bit Rate:12Mb/s

                    Bit Rate:18Mb/s

                    Bit Rate:24Mb/s

                    Bit Rate:36Mb/s

                    Bit Rate:48Mb/s

                    Bit Rate:54Mb/s

```

I find it a bit strange that the Quality is at 54/94 when the laptop is sitting on the same desk that the router is.

Thanks again!

----------

## UberLord

 *Helena wrote:*   

> I just noticed that /etc/conf.d/net has changed considerably with the latest version of baselayout, v1.10. Any tips for migrating settings?

 

I noticed this too.

I need to update my ebuild a touch though

Word of warning: DHCP "looks" broken in the new baselayout  :Sad: 

It's not actually broken per se, but the script bails out after getting the address so any postup() stuff will not work if you use it.

----------

## Helena

 *UberLord wrote:*   

>  *Helena wrote:*   I just noticed that /etc/conf.d/net has changed considerably with the latest version of baselayout, v1.10. Any tips for migrating settings? 
> 
> I noticed this too.
> 
> I need to update my ebuild a touch though
> ...

 So do I need to use the so-called new style config, i.e.

```
ifconfig_wlan0=...
```

or the old-style? Second since your ebuild had inserted hooks into conf.d/net should I include them again or use the new preup function?  :Confused: 

Oh, well, I may be better off waiting until you've sorted things out  :Cool: 

----------

## UberLord

 *Helena wrote:*   

> So do I need to use the so-called new style config, i.e.
> 
> ```
> ifconfig_wlan0=...
> ```
> ...

 

I've had support for the new config commands for some time now - just now quite right.

They're fulling supported now (damn array handling in bash - grrrrr).

I've got 2 things stopping me releasing this today though  :Sad: 

The ebuild thinks the conf.d/net file has been patched where it hasn't - grrrrr

And there may be an issue using a default key other than 1.

----------

## Emorphis

Thought I would just post this incase it sheads any light on my current situation.  I tried the iwlist ath0 scan once again, however this time it displayed

```

ath0       No scan results

```

This is extremely confusing considering that the script detects my ESSID name and MAC of the router, but fails to connect.  When I initialy try to run the script, and I tried the iwlist ath0 scan and it displayed my network information.  I'm stuck at this point and would love to get this connection up and running, any help is always greatly appreciated

----------

## UberLord

 *Emorphis wrote:*   

> Thought I would just post this incase it sheads any light on my current situation.  I tried the iwlist ath0 scan once again, however this time it displayed
> 
> ```
> 
> ath0       No scan results
> ...

 

That's normal behavior - my script takes down the interface if connection fails. iwlist doesn't work when the interface is down - at least on my hardware

Assuming that you don't have any security (MAC filtering for example) then the below may work

```

ifconfig ath0 up

iwconfig ath0 essid "particle"

dhcpcd ath0

iwconfig -a ath0
```

Please post the results of the last iwconfig if it fails

----------

## Emorphis

UberLord,

I did as you said, but when I execute 'dhcpcd ath0' it sits for about 2mins and then just returns to the prompt, when I use iwconfig -a ath0 it states

```

Error : unrecognised wireless request "ath0"

```

Here is what ath0 states from iwconfig:

```

ath0      IEEE 802.11g  ESSID:"particle"

          Mode:Managed  Frequency:2.432GHz  Access Point: FF:FF:FF:FF:FF:FF

          Bit Rate:1Mb/s   Tx-Power:50 dBm   Sensitivity=0/3

          Retry:off   RTS thr:off   Fragment thr:off

          Encryption key:off

          Power Management:off

          Link Quality:0/94  Signal level:-95 dBm  Noise level:-95 dBm

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

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

```

My Freq is not at 2.432G it's at 2.447G   :Crying or Very sad: 

It seems that the Card is not applying any of the correct information.

----------

## Emorphis

UberLord,

I did as you said, but when I execute 'dhcpcd ath0' it sits for about 2mins and then just returns to the prompt, when I use iwconfig -a ath0 it states

```

Error : unrecognised wireless request "ath0"

```

Here is what ath0 states from iwconfig:

```

ath0      IEEE 802.11g  ESSID:"particle"

          Mode:Managed  Frequency:2.432GHz  Access Point: FF:FF:FF:FF:FF:FF

          Bit Rate:1Mb/s   Tx-Power:50 dBm   Sensitivity=0/3

          Retry:off   RTS thr:off   Fragment thr:off

          Encryption key:off

          Power Management:off

          Link Quality:0/94  Signal level:-95 dBm  Noise level:-95 dBm

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

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

```

My Freq is not at 2.432G it's at 2.447G   :Crying or Very sad: 

It seems that the Card is not applying any of the correct information.

----------

## UberLord

 *Emorphis wrote:*   

> 
> 
> Here is what ath0 states from iwconfig:
> 
> ```
> ...

 

OK, what it means is that for whatever reason, your card cannot associate with the access point. You can tell by the MAC address being loads of FF's

In managed mode, the chanel is set by the AP - so it's no suprise that that's wrong too.

Check all your logs - including the AP log if possible (some AP's can log to an external syslog enabled machine) and try and track down the problem.

----------

## Emorphis

Seems that this Linksys Router I have logs are pretty broad, just states which IP on which port, nor can I change the logging   :Sad: 

The WiFi Nic however does work perfectly fine in WindowsXP.

Any ideas??

----------

## UberLord

NEW EBUILD POSTED

New style ifconfig vars can now be used (they were there before, just broken in my script)

Alternative style iproute vars can be used also

Old style iface vars are still supported - and now do aliases, broadcasts and netmasks too

Harcoded paths to binaries - the old code using "which" is still there just it's commented out

NOTE: Currently cannot detect if /etc/conf.d/net has been patched when >=sys-apps/baselayout-1.10 is installed

NOTE: =sys-apps/baselayout-1.10 is broken for DHCP using ifconfig or iface

https://bugs.gentoo.org/show_bug.cgi?id=55437

----------

## Emorphis

Just wanted to Say Thank You to UberLord for the great script, Finally got mine up and running, it was an issue with the madwifi drivers (recommend to always use Cvs rather than portage, especially when an ebuld is masked)   :Very Happy: 

Much thanks for UberLord for the suggestion.

Have fun!

----------

## UberLord

NEW EBUILD POSTED

broadcast_ESSID, netmask_ESSID and aliase_ESSID now work

Not that anyone was using them anyways - but still

----------

## iKiddo

There's a small mistake in the .ebuild:

```
  * 2. Patch your net config to load wireless:

  *      ebuild /var/db/pkg/wireless-config-0.4.8/wireless-config-0.4.8/wireless-config-0.4.8.ebuild config
```

There's no file /var/db/pkg/wireless-config-0.4.8/wireless-config-0.4.8/wireless-config-0.4.8.ebuild, it should of course read:

/var/db/pkg/net-wireless/wireless-config-0.4.8/wireless-config-0.4.8.ebuild.

----------

## antonlacon

Just wanted to say thanks for having this written. Got tired of changing iwconfig values & bringing up wlan0 by hand every time I rebooted.

----------

## willdev

Sorry for the dumb question,

I am trying to connect to a 3com ap at work and it uses WEP.

I have the essid and the wep key, but I don't know how to enter the wep key in the scripts.  Everything I try in the scripts or using 'iwconfig' fails.

The key was given to me as this, 128 bit: (changed for obvious reasons, but form is same)

3d d5 gg 36 fg 5b f0 12 fe 12 8a 75 d6

How do I enter this in the script and/or using 'iwconfig"?  I am getting "invlaid argument" with everything I try.

Here is what I get:

```

iwconfig eth1 key 3cc5-ff36-gf5b-f012-ef21-8a57-6d

Error for wireless request "Set Encode" (8B2A) :

    invalid argument "3cc5-ff36-gf5b-f012-ef21-8a57-6d".

```

Thanks,

-John

----------

## UberLord

 *willdev wrote:*   

> 
> 
> I have the essid and the wep key, but I don't know how to enter the wep key in the scripts.  Everything I try in the scripts or using 'iwconfig' fails.
> 
> The key was given to me as this, 128 bit: (changed for obvious reasons, but form is same)
> ...

 

Thats an invalid key

The hex you have is a "hex" key - and hex only uses 0-9 and a-f as it's base 16.

You have the letter g in there 3 times - that's what's invalid.

Your key is wrong

----------

## markfl

I think thats just where he's changed the key for security reasons (not posting the correct key on net)

Does the actual key have any G's in it?

----------

## UberLord

 *iKiddo wrote:*   

> There's a small mistake in the .ebuild:
> 
> ```
>   * 2. Patch your net config to load wireless:
> 
> ...

 

Fixed

----------

## UberLord

 *markfl wrote:*   

> I think thats just where he's changed the key for security reasons (not posting the correct key on net)
> 
> Does the actual key have any G's in it?

 

Silly me!

I'm still sure that the key's wrong.

PM me the exact key if you like and I'll tell for sure.

Of course, the chances of me being within 100 meters of your access point to actually use the key is pretty damn slim!

----------

## markfl

or post the key with some kind of scrambling - make sure you use the same chars but in a different order?

Mark

----------

## willdev

How does one enter a hex key for WEP into any of the config files?  Or using iwconfig?

Take this key aa bb cc dd ee ff ff ee dd cc bb aa 1a

What would it look like when in the config file or on the command line in 'iwconfig eth1 key'

Cheers,

-John

----------

## UberLord

 *willdev wrote:*   

> How does one enter a hex key for WEP into any of the config files?  Or using iwconfig?
> 
> Take this key aa bb cc dd ee ff ff ee dd cc bb aa 1a
> 
> What would it look like when in the config file or on the command line in 'iwconfig eth1 key'
> ...

 

In conf.d/wireless

```
key_ESSID="aabbccddeeffffeeddccbBAa1a"

OR

key_ESSID="aabb-ccdd-eeff-ffee-ddcc-bbaa-1a"

```

commands

```
iwconfig eth1 key aabbccddeeffffeeddccbBAa1a

OR

iwconfig eth1 key aabb-ccdd-eeff-ffee-ddcc-bbaa-1a
```

man iwconfig

for more key settings details

----------

## viperlin

 *willdev wrote:*   

> How does one enter a hex key for WEP into any of the config files?  Or using iwconfig?
> 
> Take this key aa bb cc dd ee ff ff ee dd cc bb aa 1a
> 
> What would it look like when in the config file or on the command line in 'iwconfig eth1 key'
> ...

 

errr, 

iwconfig eth1 key aabb-ccdd-eeff-ffee-ddcc-bbaa-1a

Like it says in the example in the config file!

----------

## torkar

Hi all,

first of all excellent scripts!

Now to my problem  :Smile: 

Since I upgraded my baselayout I've had a problem with getting a dhcp address when booting my laptop.

In messages I have this:

```

ipw2100: Associated with 'NETGEAR' at 11Mbps, channel 11

dhcpcd[8862]: dhcpStart: ioctl SIOCGIFHWADDR: No such device

```

And when doing an iwconfig and ifconfig immediately when starting up I have this:

```

tux ~# iwconfig

lo        no wireless extensions.

eql       no wireless extensions.

eth0      IEEE 802.11b  ESSID:"NETGEAR"  Nickname:"ipw2100"

          Mode:Managed  Channel:11  Access Point: XY:XY:XY:XY:XY:XY

          Bit Rate=11Mb/s   Tx-Power=32 dBm

          Retry:on   RTS thr=2304 B   Fragment thr:off

          Encryption key:off

          Power Management:off

          Link Quality=90/100  Signal level=-70 dBm  Noise level=-98 dBm

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

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

eth1      no wireless extensions.

tux ~# ifconfig

lo        Link encap:Local Loopback

          inet addr:127.0.0.1  Mask:255.0.0.0

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:78 errors:0 dropped:0 overruns:0 frame:0

          TX packets:78 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:4092 (3.9 Kb)  TX bytes:4092 (3.9 Kb)

```

Now if a simply do a:

```

dhcpcd -N eth0

```

I get an IP address:

```

tux ~# ifconfig

eth0      Link encap:Ethernet  HWaddr XY:XY:XY:XY:XY:XY

          inet addr:192.168.0.2  Bcast:192.168.0.255  Mask:255.255.255.0

          UP BROADCAST NOTRAILERS MULTICAST  MTU:1500  Metric:1

          RX packets:4 errors:0 dropped:0 overruns:0 frame:0

          TX packets:5 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:834 (834.0 b)  TX bytes:902 (902.0 b)

          Interrupt:5 Base address:0xf000 Memory:e0210000-e0210fff

```

So what's up with the changes in baselayout? In conf.d/net I have at the bottom:

```

source /etc/init.d/wireless.sh

preup() {

        wireless_up ${1}

        return $?

}

predown() {

        wireless_down ${1}

        return $?

}

```

I might add that everything worked great up until I installed baselayout-1.10.*. Presently I have version 1.10.1-r1 and wireless-config-0.4.9.

----------

## dmitrio

I have copied this HOWTO, with permission of UberLord, to gentoo-wiki.com 

http://gentoo-wiki.com/HOWTO_Wireless_Configuration_and_Startup

If you see anything that should be added or changed, feel free to do so. 

Thank you for a great HOWTO.

----------

## UberLord

 *torkar wrote:*   

> Hi all,
> 
> first of all excellent scripts!
> 
> Now to my problem 
> ...

 

I would file a bug report at https://bugs.gentoo.org if I were you

There's already been two problems regarding dhcp that cropped up in baselayout-1.10 which have been fixed in baselayout-1.10.1 so I wouldn't be suprised if there were a few more.

----------

## wads

I had everything working great until 2 days ago, when I did something (still not sure what) that hosed my machine.  In any case, I wiped out my root partition and started anew.  I got Wi-Fi working again using Uberlord's excellent script.

Last time around, I had a hard time getting the connection rate to 54 Mbps; it would sit at 36.  Then one day, it just clicked on.  Anyway, I'm having a similar problem now, but after playing around, it seems like I can't set my connection speed at all from the wireless script.  First, I tried

```
# Setup any other config commands. This is basically the iwconfig argument

# without the iwconfig $iface

iwconfig_ath0="rate 54M"
```

but running 'iwconfig' showed a rate of 36M.  So I changed my wireless file again:

```
# Setup any other config commands. This is basically the iwconfig argument

# without the iwconfig $iface

iwconfig_ath0="rate 11M"
```

And again, I got a rate of 36M.  It seems as if it's just not getting set.  As I understand it, the following things are equivalent:

iwconfig_ath0="rate 11M" (in /etc/conf.d/wireless)

iwconfig ath0 rate 11M (at the command line)

The latter works, but the former doesn't.  And if I run /etc/init.d/net.ath0 restart, the rate goes to 36M again.  What am I missing?

Thanks all,

David

----------

## jdhooghe85

is there somewhere that i can download this script? seeing how i dont have an internet connection yet its kind of hard for me to download the script.

----------

## UberLord

 *jdhooghe85 wrote:*   

> is there somewhere that i can download this script? seeing how i dont have an internet connection yet its kind of hard for me to download the script.

 

??? How can you download without an internet connection??? You can't!!!!

Anyways, there's a link to the ebuild on the 1st page. It's very small - fits on a floppy disk

----------

## UberLord

 *wads wrote:*   

> Last time around, I had a hard time getting the connection rate to 54 Mbps; it would sit at 36.  Then one day, it just clicked on.  Anyway, I'm having a similar problem now, but after playing around, it seems like I can't set my connection speed at all from the wireless script. 

 

I think you're SOL.

Basically, the rate command (iirc) just tells the driver the rate to try - if that fails then drop lower until it works.

Faster rates mean the signal from/to the AP has to be stronger and better quality - lower rates mean it can work with a weaker signal.

A classic example happened just the other day. My boss called me up and asked me to have a look at his lappy as he wasn't transfering files around too fast. The instant I walked through his door his rates went back to normal. Why? Because the door is a barrier between the lappy and the AP and although the signal "works" through the door it does not work at full speed.

----------

## Teardrop

Hi

What's the status on the WPA support? Do you need anyhelp with testing, etc.?

cu Teardrop

----------

## UberLord

 *Teardrop wrote:*   

> Hi
> 
> What's the status on the WPA support? Do you need anyhelp with testing, etc.?
> 
> cu Teardrop

 

After I move house I'll probably start work on it - I just don't have the time to look at WPA just yet :/

If anyone else wants to have a stab in the meantime, feel free to submit patches

----------

## Helena

Roy:

I'm getting confused here, it still won't work with baselayout-1.10-r1. I read your warnings about DHCP detection problems, but it won't even work with static IP addressing! I guess I may be overlooking something. So here's my config. It's a laptop with both a built-in Ethernet card (8139too driver) and a PCMCIA WLAN card (driver is ndiswrapper-based gplus, maybe not the best but it used to work).

I already emerged your very latest script:

```
OdysseusGentoo root # emerge -v wireless-config

Calculating dependencies ...done!

>>> emerge (1 of 1) net-wireless/wireless-config-0.4.9 to /

>>> md5 src_uri ;-) wireless-config-0.4.9.tar.bz2

>>> Unpacking source...

>>> Unpacking wireless-config-0.4.9.tar.bz2 to /var/tmp/portage/wireless-config-0.4.9/work

>>> Source unpacked.

>>> Install wireless-config-0.4.9 into /var/tmp/portage/wireless-config-0.4.9/image/ category net-wireless

man:

prepallstrip:

strip:

>>> Completed installing into /var/tmp/portage/wireless-config-0.4.9/image/

>>> Merging net-wireless/wireless-config-0.4.9 to /

--- /etc/

--- /etc/init.d/

>>> /etc/init.d/wireless.sh

--- /etc/conf.d/

>>> /etc/conf.d/wireless

>>> Safely unmerging already-installed instance...

--- cfgpro obj /etc/init.d/wireless.sh

--- cfgpro dir /etc/init.d

--- cfgpro obj /etc/conf.d/wireless

--- cfgpro dir /etc/conf.d

--- !empty dir /etc

>>> original instance of package unmerged safely.

 * To complete installation, you must

 * 1. Update your configuration files:

 *      etc-update

 * 2. Patch your net config to load wireless:

 *      ebuild /var/db/pkg/net-wireless/wireless-config-0.4.9/wireless-config-0.4.9.ebuild config

 * /etc/conf.d/net already looks like it's been patched

 * or contains a custom preup() function

 *

 * or you are using >=sys-apps/baselayout-1.10

 * 3. Edit the wireless configuration file to match your network

 *      nano /etc/conf.d/wireless

 * Caching service dependencies...

>>> net-wireless/wireless-config-0.4.9 merged.

>>> clean: No packages selected for removal.

>>> Auto-cleaning packages ...

>>> No outdated packages were found on your system.

 * GNU info directory index is up-to-date.

OdysseusGentoo root #
```

so this looks normal.

Here's my etc/conf.d/wireless (relevant lines only):

```

essid_wlan0="HelenaNet"

# mode_wlan0="managed"

mode_wlan0="ad-hoc"

adhoc_essid_wlan0="HelenaNet"

adhoc_channel_wlan0="9"

key_HelenaNet="open xxxxxxxxxx"

# ifconfig_HelenaNet="dhcp"

```

(actual WEP key masked of course). I'm not sure about the mode and ifconfig keys, otherwise I know it worked before.

Finally, my /etc/conf.d/net. This file has changed and grown considerably with the new baselayout. I don't understand most of it, it has elaborate preup and predown functions as well as others I cannot recognize. Anyway, the lines I changed are:

```
ifconfig_eth0=( "dhcp" )

# ifconfig_wlan0=( "dhcp" )

ifconfig_wlan0=( "192.168.1.72 broadcast 192.168.1.255 netmask 255.255.255.0" )

routes_wlan0=( "default gw 192.168.1.1" )

```

Can you point me in the right direction?

Thx,

Andre.

----------

## wads

 *Quote:*   

> Basically, the rate command (iirc) just tells the driver the rate to try - if that fails then drop lower until it works. 
> 
> Faster rates mean the signal from/to the AP has to be stronger and better quality - lower rates mean it can work with a weaker signal. 
> 
> 

 

Yep, you're right.  However, what doesn't make sense is 

1)  I can't deliberately set a lower rate from the script.

2)  I can set the rate to 54M from the command line.

So essentially the problem is that the behavior is incongruous.  It's not the end of the world, I can manually crank it up if I have anything that's bandwidth intensive.

----------

## Samuel

I seem to be having some basic problems. I've read through dozens of pages here, but I think I'm a little too lost to figure out what I have done wrong. I have a D-link dwl-520 (not 520+) with the prism 2.5 chipset. I re-compiled my kernel to include this driver 

```
<*>     Prism 2.5 PCI 802.11b adaptor support (EXPERIMENTAL)
```

I followed the directions in the first post to emerge the ebuild, and that went totally fine. Now, there are two things confusing me. One is that I'm not sure how to configure /etc/conf.d/wireless. It suggests running iwconfig to see what my device is called -- but iwconfig only returns 

```
larry linux # iwconfig

lo        no wireless extensions.

 

eth0      no wireless extensions.

 

dummy0    no wireless extensions.

```

It seems like this would suggest the kernel does not have the right modules loaded... Is there another step to loading the modules? Or, is there another driver I need to install? Any insight would be great -- thanks.

Sam

----------

## Teardrop

how many nics do you have? just the wlan one?  if you have more than one, did you make a symlink to net.eth0? did you emerge the pcmcia-cs? what kernel are you using? the easiest way to find out about your module would be to boot of the live-cd and check what module is used there.

cu Teardrop

PS: i don't think you have to configure /etc/conf.d/wireless to be able to see your card with iwconfig. first get that right afterwards you can configure the stuff.

----------

## Samuel

 *Quote:*   

> how many nics do you have? just the wlan one? if you have more than one, did you make a symlink to net.eth0? did you emerge the pcmcia-cs? what kernel are you using? the easiest way to find out about your module would be to boot of the live-cd and check what module is used there. 

 

I do have two nics (the wireless and an onboard nforce2). had not made a symlink, but now I have and it  hasn't made a difference. I wonder if I'm doing it right? 

```
ln -s net.eth0 net.wlan0
```

.

I did not emerge pcmcia-cs -- do I need that for a pci card? The kernel is 2.6.5. Would the live CD detect the wireless? I thought it did not support wireless.

Also, when I am booting I get this message while it is bringing up eth0 "Wireless extensions not found for eth0"

Thanks,

Sam

----------

## Teardrop

sry. didn't see that it was a pci card. so you definitly don't need the pcmcia-cs  :Wink: 

i dunno if the wlan0 works or if a eth1 is nescassary. i just made a eth1 though.

did you enable all the nescessary stuff in the kernel? to get my nic working i had to compile the main stuff into the kernel (except the drivers) or else i got the a similar output from iwconfig. if you have time you could compile a test kernel with all the drivers as modules and hope that you get the right one.

sry, that i can't be much more specific with the pci stuff, i had a pcmcia card

about the live cd. it's worth a try..  :Wink: 

----------

## Samuel

Well, still no luck. I thought I would post the steps I have taken, and see if anyone can tell me where I went wrong. System is running kernel 2.6.5, I have an nforce2 board with on-board LAN and a DWL-520 Rev. E wireless lan card with the prism 2.5 chipset. 

1) I emerged the ebuild as described in the first post

2) I patched the ebuild and did the other steps described in the ebuilt instructions

3) I recompiled kernel with wireless support (/usr/src/linux/.config has both config_net_radio and config_net_wireless set to yes)

4) I emerged wireless-tools

5) I made the sym link from eth0 to wlan0 and I can see wlan0 in etc/init.d/

6) I emerged linux-wlan-ng and configured that to my AP -- possibly I need more configuration here?

7) I emerged hostap-driver and hostap-utils, though I am at a loss to configure these

8 ) I added wlan0 to rc.conf (iface_wlan0 = "dhcp")

9) I did rc-update add wlan0 default

Now, when I run iwconfig it comes up with nothing. When I do ifconfig or ifconfig -a, it only comes up with eht0 and lo -- does not see wlan0 at all. When I boot, it brings up eth0 but gives a message that no wireless extensions were found. It tries to bring up wlan0 but then says "wlan0 does not exist"... 

When I do lspci or scanpci, it does list the wireless card: 

```
pci bus 0x0001 cardnum 0x06 function 0x00: vendor 0x1260 device 0x3873

 Harris Semiconductor Prism 2.5 Wavelan chipset

```

If anyone can help I would be most appreciative. Let me know if I should start a new thread or post in a different forum.

----------

## Hase

Alright, I can't figure this out. When I try to start my wireless, I get:

 *Quote:*   

> bash-2.05b# /etc/init.d/net.wlan0 start
> 
>  * Running preup function
> 
>  *   Configuring wireless network for wlan0
> ...

 

Telling me it cannot scan. Ifconfig does not list the wireless device. Iwconfig does. I can use iwlist to scan though.

 *Quote:*   

> bash-2.05b# iwlist wlan0 scan
> 
> wlan0     Scan completed :
> 
>           Cell 01 - Address: 00:0D:3A:6E:3F:3D
> ...

 

I can then "ifconfig wlan0 up" to bring it up and then run *Quote:*   

> bash-2.05b# /etc/init.d/net.wlan0 start
> 
>  * Running preup function
> 
>  *   Configuring wireless network for wlan0
> ...

 

To start it. What must I do to get ifconfig to bring wlan0 up before trying to scan with it?

Net.wlan0 is in the rc list as default. Net.wlan0 is a symlink: *Quote:*   

> bash-2.05b# ls -l /etc/init.d/net.wlan0
> 
> lrwxrwxrwx    1 root     root            8 Jul  3 16:53 /etc/init.d/net.wlan0 -> net.eth0
> 
> 

  Should it not be? Thanks for any suggestions or probing questions.

----------

## UberLord

 *Helena wrote:*   

> 
> 
> I'm getting confused here, it still won't work with baselayout-1.10-r1. I read your warnings about DHCP detection problems, but it won't even work with static IP addressing!

 

The DHCP problem was fixed with baselayout-1.10-r1

If DHCP or static isn't working at this point I'd say that the problem is somewhere else

 *Quote:*   

> so this looks normal.
> 
> Here's my etc/conf.d/wireless (relevant lines only):
> 
> ```
> ...

 

Sure

Post the output of /etc/init.d/net.wlan0 restart

Also, check your logs for networking / kernel errors

Thanks!

----------

## UberLord

 *wads wrote:*   

> 
> 
> Yep, you're right.  However, what doesn't make sense is 
> 
> 1)  I can't deliberately set a lower rate from the script.
> ...

 

I'll look into it some more today.

UPDATE - I see what's wrong now - when ESSID it set it appears to drop any existing rate commands.

I'll put a new var in for iwconfig commands after ESSID is up.

Hopefully a new ebuild either today or tomorrow

----------

## UberLord

 *Samuel wrote:*   

> 
> 
> 6) I emerged linux-wlan-ng and configured that to my AP -- possibly I need more configuration here?
> 
> 7) I emerged hostap-driver and hostap-utils, though I am at a loss to configure these
> ...

 

6) linux-wlan-ng does not currently support wireless-tools which is needed by my script. This package has to be removed 100% from your system if you wish to use my stuff. Otherwise, use the supplied linux-wlan-ng config

7) My ebuild configures this for you - /etc/conf.d/wireless although there's a special note in there about hostap-driver

 :Cool:  no, you add that to /etc/conf.d/net

9) That only applied to linux-wlan-ng. everything else will give you an eth1

I would recommend to try and get a working driver that gives you wlan0 or eth1. Then try and get it configured. I think you've now got too much conflicting stuff on your box :/

----------

## UberLord

 *Hase wrote:*   

> What must I do to get ifconfig to bring wlan0 up before trying to scan with it?
> 
> 

 

Actually, my script already brings it up for scanning. However, it may be running too fast for your network card. Luckily, there's an easy fix

```

sleep_scan_eth0="10"

```

The default is 1 (second), try 10. If that works, slowly lower the number until fails - then raise it by 1 until it works all the time.

----------

## UberLord

NEW EBUILD POSTED

Cleaned up some of the code overwriting conf.d/net vars.

iwconfig_eth0 is applied twice - once before scanning and once after successful setup. This is because some drivers like to reset some values after an ESSID has been set.

----------

## Helena

 *UberLord wrote:*   

> Sure
> 
> Post the output of /etc/init.d/net.wlan0 restart
> 
> Also, check your logs for networking / kernel errors
> ...

 First:

```
OdysseusGentoo root # /etc/init.d/net.wlan0 restart

 * Bringing wlan0 down...

 *   Removing inet6 addresses

 *     wlan0 inet6 del fe80::240:f4ff:fe93:4b6a/64                        [ ok ]

 *   Stopping wlan0                                                       [ ok ]

 * Bringing wlan0 up...

 *   wlan0 192.168.1.72                                                   [ ok ]

 *   Adding routes

 *     default gw 192.168.1.1

SIOCADDRT: File exists                                                    [ !! ]

OdysseusGentoo root #
```

This is with the static IP settings; however my wireless network is not recognized:

```
OdysseusGentoo root # iwconfig

lo        no wireless extensions.

irda0     no wireless extensions.

sit0      no wireless extensions.

eth0      no wireless extensions.

wlan0     IEEE 802.11b  ESSID:""

          Mode:Managed  Channel:0  Access Point: FF:FF:FF:FF:FF:FF

          Bit Rate:1Mb/s   Tx-Power:0 dBm   Sensitivity=0/3

          RTS thr:4096 B   Fragment thr:4096 B

          Encryption key:off

          Power Management min timeout:0us  mode:All packets received

          Link Quality:100  Signal level:0  Noise level:0

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

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

OdysseusGentoo root #
```

If I enable DHCP and restart wlan0 it just times out. I can't discover anything specific in the system log:

```
OdysseusGentoo root # dmesg|tail -n 20

bootsplash 3.1.4-2004/02/19: looking for picture.... found (1024x768, 20089 bytes, v3).

bootsplash: status on console 5 changed to on

eth0: no IPv6 routers present

ndiswrapper version 0.6 loaded

ndiswrapper adding gplus.sys

This driver (gplus.sys) is not for your hardware. It's likely to work anyway but have it in mind if you have problem.

PCI: Enabling device 0000:02:00.0 (0000 -> 0002)

PCI: Setting latency timer of device 0000:02:00.0 to 64

ndiswrapper: Buggy ndis driver trying to use unintilized spinlock. Trying to recover...ok.

wlan0: ndiswrapper ethernet device 00:40:f4:93:4b:6a using driver gplus.sys

wlan0: no IPv6 routers present

NVRM: loading NVIDIA Linux x86 NVIDIA Kernel Module  1.0-6106  Wed Jun 23 08:14:01 PDT 2004

Linux agpgart interface v0.100 (c) Dave Jones

atkbd.c: Spurious ACK on isa0060/serio0. Some program, like XFree86, might be trying access hardware directly.

atkbd.c: Spurious ACK on isa0060/serio0. Some program, like XFree86, might be trying access hardware directly.

wlan0: no IPv6 routers present

wlan0: no IPv6 routers present

wlan0: no IPv6 routers present

wlan0: no IPv6 routers present

wlan0: no IPv6 routers present

OdysseusGentoo root #
```

----------

## UberLord

I'm going to wildly guess that /etc/conf.d/net does has not been patched - or the patch has been removed.

----------

## Helena

 *UberLord wrote:*   

> I'm going to wildly guess that /etc/conf.d/net does has not been patched - or the patch has been removed.

 Yes I am also suspecting that one. Unfortunately it's a rather long listing:

```
# /etc/conf.d/net: Global config file for net.* rc-scripts

# $Header: /var/cvsroot/gentoo-src/rc-scripts/etc/conf.d/net,v 1.10 2004/06/28 19:44:46 agriffis Exp $

##############################################################################

#

#                      READ THIS COMMENT FIRST

#

# PLEASE PICK ONE of the configuration methods listed below.  If you

# don't know which to pick, use the top one, NEW-STYLE IFCONFIG.

# The other two possible options are OLD-STYLE IFACE and

# IPROUTE2-STYLE.

#

# If you have multiple sections (for example IFCONFIG and IPROUTE2)

# the network scripts will attempt to make reasonable assumptions

# about what to use, but there is no guarantee on the results, so

# PLEASE just use one set of configuration variables.

#

# At the bottom there is an ADVANCED CONFIGURATION section with some

# additional configuration possibilities

#

##############################################################################

##############################################################################

#   NEW-STYLE IFCONFIG examples

#   ---------------------------

#   This uses /sbin/ifconfig and /sbin/route to set the network up.

#   It is suitable for most home users.

##############################################################################

# To use DHCP on eth0, simply uncomment the following line:

ifconfig_eth0=( "dhcp" )

ifconfig_wlan0=( "dhcp" )

# ifconfig_wlan0=( "192.168.1.72 broadcast 192.168.1.255 netmask 255.255.255.0" )

# routes_wlan0=( "default gw 192.168.1.1" )

# For passing custom options to dhcpcd use something like the following.  This

# example reduces the timeout for retrieving an address from 60 seconds (the

# default) to 10 seconds.  Note that this might be too short for some servers,

# so the default is encouraged unless you know what you're doing.

#dhcpcd_eth0="-t 10"

# For a static configuration, use something like this.  This sets the primary

# eth0 address to 192.168.0.2 and adds two aliases, eth0:1 and eth0:2

#ifconfig_eth0=(

#   "192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0"

#   "192.168.0.3 broadcast 192.168.0.255 netmask 255.255.255.0"

#   "192.168.0.4 broadcast 192.168.0.255 netmask 255.255.255.0"

#)

# This is just like setting the gateway config option in the old-style iface

# config, but allows one to add custom routes.  This should not be needed if you

# are obtaining an address via DHCP since the default route should be set

# automatically.

#routes_eth0=(

#   "default gw 192.168.0.1"

#)

# VLAN support - emerge net-misc/vconfig 

# Please ensure your VLAN IDs are NOT zero-padded

#vlans_eth0="1 2"

#ifconfig_eth0_1=( "dhcp" )

#ifconfig_eth0_2=( "172.16.2.1 broadcast 172.16.3.255 netmask 255.255.254.0" )

##############################################################################

#   OLD-STYLE IFACE examples (deprecated)

#   -------------------------------------

#   This uses /sbin/ifconfig and /sbin/route to set the network up,

#   but is not as flexible as the IFCONFIG method above or the

#   IPROUTE2 method below.

##############################################################################

# To use DHCP on eth0, simply uncomment the following line:

#iface_eth0="dhcp"

# iface_wlan0="dhcp"

# For passing custom options to dhcpcd use something like the following.  This

# example reduces the timeout for retrieving an address from 60 seconds (the

# default) to 10 seconds.  Note that this might be too short for some servers,

# so the default is encouraged unless you know what you're doing.

#dhcpcd_eth0="-t 10"

# To set a static IP address use a line similar to this

#iface_eth0="192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0"

# iface_wlan0="192.168.1.72 broadcast 192.168.1.255 netmask 255.255.255.0"

# For setting the default gateway.  You should not need to do this if you use

# DHCP since the default gateway should be set automatically.

#gateway="eth0/192.168.0.1"

#gateway="wlan0/192.168.1.1"

# For adding aliases to a interface, specify them space-separated in the

# following string

#alias_eth0="192.168.0.3 192.168.0.4"

# To add a custom netmask/broadcast address to created aliases, specify them in

# the same order as the alias_eth0 string.  If you find yourself doing this, you

# might consider switching to the new-style

#broadcast_eth0="192.168.0.255 192.168.0.255"

#netmask_eth0="255.255.255.0 255.255.255.0"

# VLAN support - emerge net-misc/vconfig

# Please ensure your VLAN IDs are NOT zero-padded

#vlans_eth0="1 2"

#iface_eth0_1="dhcp"

#iface_eth0_2="172.16.2.1 broadcast 172.16.3.255 netmask 255.255.254.0"

##############################################################################

#   IPROUTE2-STYLE CONFIGURATION

#   ----------------------------

#   This makes use of the /sbin/ip command to set routes and ip

#   addresses.  This style is very useful if you are building an

#   advanced linux router or using VRRP For more information on how to

#   use the iproute2 command have a look at the ip(8) man page.

#

#   NOTE: You must emerge sys-apps/iproute2 to use this configuration

##############################################################################

# To use DHCP on eth0, simply uncomment the following line:

#ipaddr_eth0=( "dhcp" )

# For passing custom options to dhcpcd use something like the following.  This

# example reduces the timeout for retrieving an address from 60 seconds (the

# default) to 10 seconds.  Note that this might be too short for some servers,

# so the default is encouraged unless you know what you're doing.

#dhcpcd_eth0="-t 10"

# For a static configuration, use something like this.  This sets the primary

# eth0 address to 192.168.0.2 and adds two aliases, eth0:1 and eth0:2.

# You may also pass advanced ip addr commands via this option.

#ipaddr_eth0=(

#   "192.168.0.2/24 brd 192.168.0.255"

#   "192.168.0.3/24 brd 192.168.0.255"

#   "192.168.0.4/24 brd 192.168.0.255"

#)

# The following will set up the default gateway. You can also pass advanced

# route configs via this option.

#iproute_eth0=(

#   "default via 192.168.0.1"

#)

# VLAN support - emerge net-misc/vconfig

# Please ensure your VLAN IDs are NOT zero-padded

#vlans_eth0="1 2"

#ipaddr_eth0_1=( "dhcp" )

#ipaddr_eth0_2=( "172.16.2.1/23 brd 172.16.3.255" )

##############################################################################

#   ADVANCED CONFIGURATION

#   ----------------------

#   The items in this section can be combined with one of the sections

#   above to create a complete network configuration.  None of the

#   items in this section are necessary to configure for most users.

##############################################################################

# Four functions can be defined which will be called surrounding the

# start/stop operations.  The functions are called with the interface

# name first so that one function can control multiple adapters.

#

# The return values for the preup and predown functions should be 0

# (success) to indicate that configuration or deconfiguration of the

# interface can continue.  If preup returns a non-zero value, then

# interface configuration will be aborted.  If predown returns a

# non-zero value, then the interface will not be allowed to continue

# deconfiguration.

#

# The return values for the postup and postdown functions are ignored

# since there's nothing to do if they indicate failure.

#

#preup() {

#   # Test for link on the interface prior to bringing it up.  This

#   # only works on some network adapters and requires the ethtool

#   # package to be installed.

#   if ethtool $1 | grep -q 'Link detected: no'; then

#      ewarn "No link on $1, aborting configuration"

#      return 1

#   fi

#

#   # Remember to return 0 on success

#   return 0

#}

#

#predown() {

#   # Test to make sure the root filesystem is not mounted via NFS.

#   # Interface ($1) is ignored but could also be tested if you know

#   # what interface is providing NFS root.

#   if grep -q ' / nfs' /proc/mounts; then

#      ewarn "Root is NFS mounted, aborting deconfiguration of $1"

#      return 1

#   fi

#

#   # Remember to return 0 on success

#   return 0

#}

#

#postup() {

#   # This function could be used, for example, to register with a

#   # dynamic DNS service.  Another possibility would be to

#   # send/receive mail once the interface is brought up.

#}

#

#postdown() {

#   # This function is mostly here for completeness... I haven't

#   # thought of anything nifty to do with it yet ;-)

#}

# For changing MAC addresses - emerge net-analyzer/macchanger

# - to set a specific MAC address

#mac_eth0="00:11:22:33:44:55"

# - to randomize the last 3 bytes only

#mac_eth0="random-ending"

# - to randomize between the same physical type of connection (eg fibre, copper, wireless) , all vendors

#mac_eth0="random-samekind"

# - to randomize between any physical type of connection (eg fibre, copper, wireless) , all vendors

#mac_eth0="random-anykind"

# - full randomization - WARNING: some MAC addresses generated by this may NOT act as expected

#mac_eth0="random-full"

# custom - passes all parameters directly to net-analyzer/macchanger

#mac_eth0="some custom set of parameters"

# uncomment this function for support for changing MAC addresses

# also uncomment it's invocation in preup() above

preup_macchanger() {

   eval mac_IFACE=\"\$\{mac_${IFACE}\}\"

   if [ -n "${mac_IFACE}" ]; then

      if [[ -x /sbin/macchanger ]]; then

         local macchanger_opts=""

         case "${mac_IFACE}" in

            # specific mac-addr, i wish there were a shorter way to specify this 

            [0-9a-zA-Z][0-9a-zA-Z]:[0-9a-zA-Z][0-9a-zA-Z]:[0-9a-zA-Z][0-9a-zA-Z]:[0-9a-zA-Z][0-9a-zA-Z]:[0-9a-zA-Z][0-9a-zA-Z]:[0-9a-zA-Z][0-9a-zA-Z]) macchanger_opts="${macchanger_opts} --mac=${mac_IFACE}" ;;

            # increment MAC address, default macchanger behavior

            increment) macchanger_opts="${macchanger_opts}" ;;

               # randomize just the ending bytes

               random-ending) macchanger_opts="${macchanger_opts} -e" ;;

               # keep the same kind of physical layer (eg fibre, copper)

               random-samekind) macchanger_opts="${macchanger_opts} -a" ;;

               # randomize to any known vendor of any physical layer type

               random-anykind) macchanger_opts="${macchanger_opts} -A" ;;

               # fully random bytes

               random-full) macchanger_opts="${macchanger_opts} -r" ;;

               # default case is just to pass on all the options

            *) macchanger_opts="${macchanger_opts} ${mac_IFACE}" ;;

         esac

           #echo "/sbin/macchanger ${macchanger_opts} ${IFACE}"

           /sbin/macchanger ${macchanger_opts} ${IFACE} >/dev/null 

         retval=$?

         if [ $retval -gt 0 ]; then

            eerror "Failed to set MAC address"

            return 1

         fi

      else   

         eerror "For changing MAC addresses, emerge net-analyzer/macchanger"

         return 1

      fi

   fi

   return 0 #important

}

# For link bonding/trunking - emerge net-misc/ifenslave

# if you are using any of the slave interfaces, it is important that you remove

# configurations for them and take them down first!

slaves_bond0="eth2"

ipaddr_bond0=( "172.16.2.1/23 brd 172.16.3.255" )

postup_bonding() {

   # return silently if this is not a bonding interface

   if [ -n "${IFACE/bond*/}" ]; then

      return 0

   fi

   eval slaves_IFACE=\"\$\{slaves_${IFACE}\}\"

   if [[ -n "${slaves_IFACE}" ]]; then

      if [[ -x /sbin/ifenslave ]]; then

         # must force the slaves to a particular state before adding them

         for slaveiface in ${slaves_IFACE}; do

            ifconfig ${slaveiface} 0.0.0.0 up

         done

         # now force the master to up

         ifconfig ${IFACE} up

         # finally add in slaves

         /sbin/ifenslave ${IFACE} ${slaves_IFACE}

      else

         eerror "For link aggregation (bonding), emerge net-misc/ifenslave"

         return 1

      fi

   fi

   return 0 #important

}

predown_bonding() {

   # return silently if this is not a bonding interface

   if [ -n "${IFACE/bond*/}" ]; then

      return 0

   fi

   # don't trust the config, get the active list instead

   slaves_IFACE=$(awk '/^Slave Interface:/ { printf $3" " }' /proc/net/bonding/${IFACE})

   if [[ -n "${slaves_IFACE}" ]]; then

      # remove all slaves

      echo /sbin/ifenslave -d ${IFACE} ${slaves_IFACE}

      /sbin/ifenslave -d ${IFACE} ${slaves_IFACE}

      # reset all slaves

      for slaveiface in ${slaves_IFACE}; do

         ifconfig ${slaveiface} 0.0.0.0 down

      done

   fi

   return 0

}

preup_linkdetect() {

   # Test for link on the interface prior to bringing it up.  This

   # only works on some network adapters and requires the ethtool

   # package to be installed.

   if ethtool $1 | grep -q 'Link detected: no'; then

      ewarn "No link on $1, aborting configuration"

      return 1

   fi

}

```

----------

## UberLord

Yup, it's not been patched

```
ebuild /var/db/pkg/net-wireless/wireless-config-0.4.10/wireless-config-0.4.10.ebuild config
```

should sort you out

----------

## Helena

 *UberLord wrote:*   

> Yup, it's not been patched
> 
> ```
> ebuild /var/db/pkg/net-wireless/wireless-config-0.4.10/wireless-config-0.4.10.ebuild config
> ```
> ...

 OK done that, but I thought it was no longer necessary?! I didn't merge the 2 preup and predown functions since one of these is commented so they should't conflict, right?

Anyway, my wireless network is now recognized  :Very Happy:  but I still have trouble starting the interface. I keep getting the "SIOCADDR: File exists" error with static IP and DHCP keeps timing out. I must be forgetting something or making a really dumb mistake  :Confused: 

/UPDATE: I switched off eth0 and now the SIOCADDR error is gone. With static IP everything looks OK however it's not working. I get "Destination host Unreachable" errors. I'll doublecheck my IP addresses...

/UPDATE2: IP addresses OK. If I copy the exact configuration to ifconfig_eth0 it simply works. However with wlan0 it cannot even ping the gateway... It can only ping itself (127.0.0.1)

/UPDATE3: it's working  :Very Happy:  Why, I'm not sure, but I decided to change /etc/conf.d/wireless and switch to managed mode instead of ad-hoc which I've been using up to now and guess what, it works!

----------

## UberLord

 *Helena wrote:*   

> OK done that, but I thought it was no longer necessary?! I didn't merge the 2 preup and predown functions since one of these is commented so they should't conflict, right?

 

Unfortunately, it's necessary to do this each time you update /etc/conf.d/net from a baselayout emerge

 *Quote:*   

> 
> 
> /UPDATE3: it's working  Why, I'm not sure, but I decided to change /etc/conf.d/wireless and switch to managed mode instead of ad-hoc which I've been using up to now and guess what, it works!

 

Now thats plain silly - if you have an Access Point then you use Managed, otherwise you use Ad-Hoc   :Razz: 

At least you're working again  :Smile: 

----------

## Helena

 *UberLord wrote:*   

>  *Helena wrote:*   OK done that, but I thought it was no longer necessary?! I didn't merge the 2 preup and predown functions since one of these is commented so they should't conflict, right? 
> 
> Unfortunately, it's necessary to do this each time you update /etc/conf.d/net from a baselayout emerge
> 
>  *Quote:*   
> ...

 Ok thx and sorry for the confusion  :Embarassed: 

----------

## Hase

 *UberLord wrote:*   

> 
> 
> Actually, my script already brings it up for scanning. However, it may be running too fast for your network card. Luckily, there's an easy fix
> 
> ```
> ...

 

This may be it. I just changed to an older version of ndiswrapper (to 0.5 from 0.6-r1) and it worked. I've only rebooted once since the change in driver. If the error continues, I will try that. Thanks again for such a great help.

----------

## iverson0881

hello uberlord

ive been trying out this wonderful thing called ifplugd and you've mentioned it before in this post before on pg 19 i believe. but I can't seem to get it to work. it'll connect to the AP but won't get the IP. and i'll have to manually go in and type "dhcpcd ath0."  I've tried removing the sleep 5 in my preup function but that doesn't change anything. What am I missing?

/etc/conf.d/net

```

iface_eth0="dhcp"

iface_ath0="dhcp"

###########################################

# Hook wireless into /etc/init.d/net.eth0

# Please note, this lines should be BELOW

# any configuration lines

source /etc/init.d/wireless.sh

preup() {

   wireless_up ${1}

   sleep 5

   return $?

}

predown() {

   wireless_down ${1}

   return $?

}

# End hook

###########################################

```

So when I run /etc/init.d/ifplugd I get

```

root@Gentoo omer # /etc/init.d/ifplugd restart

 * Stopping ifplugd: eth0 ath0                                            [ ok ] 

 * Starting ifplugd: eth0 ath0                                             [ ok ] 

 * Running preup function

 *   Configuring wireless network for ath0

 *   Connecting to "Hameed" ...                                           [ ok ] 

 *   ath0 connected to "Hameed" in managed mode

 *     on channel 06 (WEP enabled)

 * Keeping kernel configuration for ath0

```

I've already done "ifplugd.action ath0 up" and I don't see anything in the ifplugd that would cause that and I think the " Keeping kernel configuration for ath0" is related to your script or something I'm doing that is a little dumb for this purpose.

Thanks. if you need more info let me know.

----------

## UberLord

ifplugd problem page

https://bugs.gentoo.org/show_bug.cgi?id=34484

ifplugd is not perfect - waproamd is too limited yet

----------

## Hase

 *UberLord wrote:*   

> 
> 
> Actually, my script already brings it up for scanning. However, it may be running too fast for your network card. Luckily, there's an easy fix
> 
> ```
> ...

 

This does not sppear to have worked for me. I am also now unable to tell what sequence of events must occur before wlan0 scanning will work. I just sat at the system, immediately after a boot and kept trying to scan (with the aforementioned variable set to "10"), until one time it just did it. I now imagine that this is just a driver error. Any ideas why time alone would change the systems mind about its scanning capability?

----------

## el_Salmon

In setup guide you said:

 *Quote:*   

> emerge it and follow the ebuilds instructions
> 
> ```
> Code:
> 
> ...

 

but I think that ACCEPT_KEYWORDS="~x86" it's a dirty & quick way. It's better: 

```
echo net-wireless/wireless-config ~x86 >> /etc/portage/package.keywords
```

 So portage resolves dependencies better and you don't need writing ACCEPT_KEYWORDS="~x86" in the future to emerge wireless-config ebuild

----------

## UberLord

That's a good idea - I'll update the howto.

----------

## yem

What's the current plan for WPA support in this setup? Waiting for wireless-tools to add WPA support?

Currently I'm guessing most people would use wpa_supplicant. Prism54 is working towards integration with wpa_supplication so it seems that will be the defacto standard.

http://prism54.org/phpwiki/Prism54%20WPA%20support

----------

## UberLord

 *yem wrote:*   

> What's the current plan for WPA support in this setup? Waiting for wireless-tools to add WPA support?

 

Either that or I write a program to talk to the wpa_supplicant daemon.

But I cannot do anything about this for a month or so.

However, I do plan todo something - just not right now.

Patches for WPA are always welcome though  :Smile: 

----------

## Dr. Heywood Floyd

You made my life sooooo much easier.  If I can ever do any coding or whatever for you, just ask.

Heywood

----------

## markfl

 *Dr. Heywood Floyd wrote:*   

> If I can ever do any coding or whatever for you, just ask.

 

 *UberLord wrote:*   

> Patches for WPA are always welcome though

 

Markfl developer relations service at your.... service  :Razz: 

Got any WPA enabled hardware there Heywood? I personally don't but i'm sure those with some would appreciate this.

Markfl

----------

## yem

I'd happily give it a stab, but..

my 3CRWE154G72  is supposed to work with driverloader (which supports wpa_supplicant), so I got a trial key with the intention of running wpa_supplicant and updating wireless-config to support WPA.. unfortunately driverloader refuses to detect the card, even after loading the .sys files in via the web interface.

"No devices found"

Driver: 3c154g72

Vendor: 3Com

Version: 06/25/2004, 3.0.7.2

----------

## Helena

Haven't changed anything (I think), but my WEP key's no longer accepted:

```
OdysseusGentoo root # /etc/init.d/net.wlan0 restart

 * Running preup function

 *   Configuring wireless network for wlan0

 *   wlan0 does not support setting keys

 *   or the parameter "key_HelenaNet" is incorrect

 *   wlan0 does not support setting the key

 *     wlan0 connected as "" in ad-hoc mode

 *     on channel 09 (WEP disabled)

 * Bringing wlan0 up...

 *   wlan0 dhcp                                                                               [ !! ]

OdysseusGentoo root # iwconfig

lo        no wireless extensions.

irda0     no wireless extensions.

sit0      no wireless extensions.

eth0      no wireless extensions.

wlan0     IEEE 802.11b  ESSID:"HelenaNet"

          Mode:Ad-Hoc  Frequency:2.452GHz  Cell: C2:C0:52:FA:D7:35

          Bit Rate:54Mb/s   Tx-Power:24 dBm   Sensitivity=0/3

          RTS thr:4096 B   Fragment thr:4096 B

          Encryption key:off

          Power Management:off

          Link Quality:99  Signal level:0  Noise level:0

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

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

eth1      no wireless extensions.

OdysseusGentoo root #
```

The network is detected but what has changed to WEP key detection in the last week? I even tried including hyphens in the key and using the form "XXXXXXXXXX enc open", but that didn't help. Of course I double-checked the key value with the router and they correspond.

----------

## Hase

My earlier problem with the wireless only able to scan after five minutes pass from the time of boot seems to have gone away with a newer driver. Even though it is no longer an issue for me, I'd like to know why a driver would not work for a certain amount of time and then, of its own accord, start working. I tried several times to boot and did absolutely nothing before trying 

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

 without it working, then rebooted, waited five minutes (while doing nothing at all), tried and it worked.  I then rebooted again just for kicks and tried without delay to find that once again, it did not work. I guess it wasn't anything like the device "warming up", but I am pretty lost as to what it might have been.

Any guesses?

(BTW, it is a Broadcom 802.11G using NDISWrapper, version 0.5 > problem, version 0.7 > works perfectly)

----------

## jarealist

Thanks Uberlord for all the great work.  I have WEP working with both my Netgear WG511 IEEE 802.11b/g PCMCIA Card and my internal Intel ipw2100 IEEE 802.11b (though not at the same time).  Sony Viao V505DX.

Helena wrote:

 *Quote:*   

> wlan0     IEEE 802.11b  ESSID:"HelenaNet"
> 
>           Mode:Ad-Hoc  Frequency:2.452GHz  Cell: C2:C0:52:FA:D7:35
> 
>           Bit Rate:54Mb/s   Tx-Power:24 dBm   Sensitivity=0/3 

 

I'm definitely no wiz with this stuff but shouldn't  *Quote:*   

> IEEE 802.11b

 

be IEEE 802.11b/g or IEEE 802.11g for 54Mb/s?

----------

## allucid

One out of the 5 networks I use doesn't broadcast the ESSID. Is there a way to specify 'if scanning doesn't find a match, then use this ESSID'? I tried setting it as the first entry and it didn't work. :p

----------

## UberLord

 *allucid wrote:*   

> One out of the 5 networks I use doesn't broadcast the ESSID. Is there a way to specify 'if scanning doesn't find a match, then use this ESSID'? I tried setting it as the first entry and it didn't work. :p

 

Sure! You have two options

1) Map MAC address to ESSID (MAC address is always broadcast)

```
essid_001122334455="ESSID"
```

2) Simply add the ESSID to your preferred_aps list

```
preferred_aps=( "ESSID 1" "ESSID 2" )
```

Enjoy  :Smile: 

----------

## banzai

 *Quote:*   

> Haven't changed anything (I think), but my WEP key's no longer accepted:
> 
> ```
> 
> OdysseusGentoo root # /etc/init.d/net.wlan0 restart
> ...

 

I'm having exactly the same problem. Unfortunately I don't know since which emerge this occured. Perhaps updated baselayout? 

I surely didn't change my key... 

Some days ago everything worked like a charm. 

btw: great work uberlord, I would love to see this added to portage

----------

## UberLord

 *banzai wrote:*   

> 
> 
> I'm having exactly the same problem. Unfortunately I don't know since which emerge this occured. Perhaps updated baselayout? 
> 
> I surely didn't change my key... 
> ...

 

I would say that if a WEP key worked before and it doesn't work now then below are the following reasons

1) The WEP key does not match on either the client or the AP

2) The syntax for setting the WEP key has changed in wireless-tools

3) My code is borked - no-one can use WEP

As some people (including me) find that WEP works, I can safely assume that #3 is not the answer  :Wink: 

The command I use to set WEP is

```
 iwconfig $iface key $wepkey
```

So, given the interface eth1 and the key s:foobar, the exact command sent is 

```
iwconfig eth1 key s:foobar
```

I would experiment with the iwconfig command and when you find a key syntax that works, put that in your config and it should start magically working again!

----------

## Helena

 *UberLord wrote:*   

> The command I use to set WEP is
> 
> ```
>  iwconfig $iface key $wepkey
> ```
> ...

 Well I'm trying that just now and I do get some results, however one thing puzzles me. How can I now start the wlan0 interface? Because the standard procedure

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

still doesn't work, even after setting iwconfig parameters.

----------

## UberLord

 *Helena wrote:*   

> How can I now start the wlan0 interface? Because the standard procedure
> 
> ```
> /etc/init.d/net.wlan0 restart
> ```
> ...

 

What doesn't work? could you post the error?

----------

## Helena

 *UberLord wrote:*   

>  *Helena wrote:*   How can I now start the wlan0 interface? Because the standard procedure
> 
> ```
> /etc/init.d/net.wlan0 restart
> ```
> ...

 OK here's what happened, with the actual WEP key masked:

```
OdysseusGentoo root # iwconfig wlan0 essid HelenaNet mode Managed key open XXXXXXXXXX

OdysseusGentoo root # iwconfig

lo        no wireless extensions.

irda0     no wireless extensions.

sit0      no wireless extensions.

eth0      no wireless extensions.

wlan0     IEEE 802.11b  ESSID:"HelenaNet"

          Mode:Managed  Frequency:2.452GHz  Access Point: 00:02:DD:35:6C:01

          Bit Rate:54Mb/s   Tx-Power:0 dBm   Sensitivity=0/3

          RTS thr:4096 B   Fragment thr:4096 B

          Encryption key:XXXX-XXXX-XX  Security mode:open

          Power Management min timeout:0us  mode:All packets received

          Link Quality:100/100  Signal level:-52 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

OdysseusGentoo root # ifconfig

eth0      Link encap:Ethernet  HWaddr 00:40:CA:BB:8F:FC

          inet addr:192.168.1.73  Bcast:192.168.1.255  Mask:255.255.255.0

          inet6 addr: fe80::240:caff:febb:8ffc/64 Scope:Link

          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:292 errors:0 dropped:0 overruns:0 frame:0

          TX packets:228 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:370046 (361.3 Kb)  TX bytes:24078 (23.5 Kb)

          Interrupt:10 Base address:0x3000

lo        Link encap:Local Loopback

          inet addr:127.0.0.1  Mask:255.0.0.0

          inet6 addr: ::1/128 Scope:Host

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:10 errors:0 dropped:0 overruns:0 frame:0

          TX packets:10 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:500 (500.0 b)  TX bytes:500 (500.0 b)

OdysseusGentoo root # /etc/init.d/net.wlan0 restart

 * Running preup function

 *   Configuring wireless network for wlan0

 *   wlan0 does not support setting keys

 *   or the parameter "key_HelenaNet" is incorrect

 *   wlan0 does not support setting the key

 *     wlan0 connected as "" in ad-hoc mode

 *     on channel 09 (WEP disabled)

 * Bringing wlan0 up...

 *   wlan0 dhcp                                                                                                                    [ !! ]

OdysseusGentoo root # iwconfig

lo        no wireless extensions.

irda0     no wireless extensions.

sit0      no wireless extensions.

eth0      no wireless extensions.

wlan0     IEEE 802.11b  ESSID:"HelenaNet"

          Mode:Ad-Hoc  Frequency:2.452GHz  Cell: C2:10:6E:02:2A:88

          Bit Rate:54Mb/s   Tx-Power:24 dBm   Sensitivity=0/3

          RTS thr:4096 B   Fragment thr:4096 B

          Encryption key:off

          Power Management:off

          Link Quality:100  Signal level:0  Noise level:0

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

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

OdysseusGentoo root #
```

In my opinion the last error is predictable, since /etc/conf.d/net is still patched and therefore /etc/conf.d/wireless is consulted... So I was looking for a different way, e.g.

```
ifconfig wlan0 up
```

but that doesn't work either. If I now re-enter the entire iwconfig command it fails, probably for security reasons

```

OdysseusGentoo root # ifconfig wlan0 up

OdysseusGentoo root # ifconfig

eth0      Link encap:Ethernet  HWaddr 00:40:CA:BB:8F:FC

          inet addr:192.168.1.73  Bcast:192.168.1.255  Mask:255.255.255.0

          inet6 addr: fe80::240:caff:febb:8ffc/64 Scope:Link

          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:293 errors:0 dropped:0 overruns:0 frame:0

          TX packets:228 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:370106 (361.4 Kb)  TX bytes:24078 (23.5 Kb)

          Interrupt:10 Base address:0x3000

lo        Link encap:Local Loopback

          inet addr:127.0.0.1  Mask:255.0.0.0

          inet6 addr: ::1/128 Scope:Host

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:10 errors:0 dropped:0 overruns:0 frame:0

          TX packets:10 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:500 (500.0 b)  TX bytes:500 (500.0 b)

wlan0     Link encap:Ethernet  HWaddr 00:40:F4:93:4B:6A

          inet6 addr: fe80::240:f4ff:fe93:4b6a/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:1 errors:0 dropped:0 overruns:0 frame:0

          TX packets:16 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:14 (14.0 b)  TX bytes:5336 (5.2 Kb)

          Interrupt:10 Memory:20820000-20821fff

OdysseusGentoo root # iwconfig wlan0 essid HelenaNet mode Managed key open XXXXXXXXXX

Error for wireless request "Set Encode" (8B2A) :

    SET failed on device wlan0 ; Operation not permitted.

OdysseusGentoo root #
```

----------

## dwalexuk

device does not support bla bla bla

Also in dmesg i can see ieee802_wep:  cannot find arc4 API (arc4 compiled in kernel and also was trying it as module - same result)

----------

## allucid

Ok, I have everything working (almost) perfectly now. This is great. I do have a feature request, though.  :Smile: 

Would it be possible to add a post-associate script option? I have a login script I run after associating with a certain access point that I would like to have run automatically.

----------

## jza

i'm having trouble getting my centrino wireless working.  I downloaded the ipw2100 modules and I am able to load them, however, i have no wireless connections available.

If I do iwconfig or ifconfig, only the 'lo' comes out.

However, if I do the same thing from a debian distribution chrooted to my gentoo root, it shows eth0 and ath0, although none of them have wireless extensions. Doing /etc/init.d/wireless produces no result

and doing /etcinit.d/net.eth0 start tells me eth0 doesn't exist and preup eth0 failed.

I'm pretty new to gentoo so i may be missing something here, i did follow the 'setting up your network' linked here, basically all i have is:

iface_eth0="dhcp" and iface_wlan0="dhcp"

any ssuggestions?

----------

## allucid

for ipw2100:

1) make sure /usr/src/linux is pointing to the correct kernel sources

2) make sure wireless is enabled in your kernel

3) make sure the crypto library, the ARC4 cipher algorithm, and the CRC32 library routines are enabled in your kernel

4) emerge ipw2100

----------

## dwalexuk

 *allucid wrote:*   

> for ipw2100:
> 
> 1) make sure /usr/src/linux is pointing to the correct kernel sources
> 
> 2) make sure wireless is enabled in your kernel
> ...

 

Everything done like this.

WEP is working now , but cannot decrypt correctly.

I am using key a1b2c3d4e5 on access point.

And for iwconfig eth1 enc 6944-8891-3125. Everything seems to be fine until I am trying to get IP. (iwconfig shows link 100%)

dhcpd eth1  - time out. In the dmesg I can see - wrong decryption.

What am I missing? kernel 2.6.5 gentoo r1

----------

## UberLord

 *dwalexuk wrote:*   

> device does not support bla bla bla
> 
> Also in dmesg i can see ieee802_wep:  cannot find arc4 API (arc4 compiled in kernel and also was trying it as module - same result)

 

Please read the 1st page FAQ blah blah blah

(It basically states I don't support drivers at all)

Try taking your query to the network or hardware forums

----------

## UberLord

 *dwalexuk wrote:*   

> 
> 
> WEP is working now , but cannot decrypt correctly.
> 
> I am using key a1b2c3d4e5 on access point.
> ...

 

Keys need to be the SAME at both ends!

Your post shows it's different

----------

## dwalexuk

 *UberLord wrote:*   

> 
> 
> Keys need to be the SAME at both ends!
> 
> Your post shows it's different

 

perl -de0

print hex a1b2c3d4e5

694488913125

I was setting up access point under windows and it asks key in hex format.

But wireless tool asks it in dec, am I wrong?

----------

## UberLord

@Helena - could you try an earlier ebuild? say 0.4.8 or 0.4.9 and see if you have the same problem? (you can use the same /etc/conf.d/wireless even though etc-update will probably say otherwise)

----------

## Helena

 *UberLord wrote:*   

> @Helena - could you try an earlier ebuild? say 0.4.8 or 0.4.9 and see if you have the same problem? (you can use the same /etc/conf.d/wireless even though etc-update will probably say otherwise)

 Sorry, I have 0.4.9. I will first try upgrading to 0.4.10.

----------

## Helena

Well I've tried your ebuild versions 0.4.7 until 0.4.10. No luck. The error is persistent. With every up-/downgrade etc-update modifies /etc/init.d/wireless.sh (which is OK with me). Only the downgrade to 0.4.7 modified /etc/conf.d/wireless. What else can I do?

----------

## UberLord

 *dwalexuk wrote:*   

> 
> 
> I was setting up access point under windows and it asks key in hex format.
> 
> But wireless tool asks it in dec, am I wrong?

 

wireless tool accepts ASCII and hex only - afaik it doesn't like dec

----------

## UberLord

 *allucid wrote:*   

> Ok, I have everything working (almost) perfectly now. This is great. I do have a feature request, though. 
> 
> Would it be possible to add a post-associate script option? I have a login script I run after associating with a certain access point that I would like to have run automatically.

 

You can already do this in the pre-up function in /etc/conf.d/net

https://forums.gentoo.org/viewtopic.php?p=1274868#1274868

----------

## allucid

 *UberLord wrote:*   

>  *allucid wrote:*   Ok, I have everything working (almost) perfectly now. This is great. I do have a feature request, though. 
> 
> Would it be possible to add a post-associate script option? I have a login script I run after associating with a certain access point that I would like to have run automatically. 
> 
> You can already do this in the pre-up function in /etc/conf.d/net
> ...

 

thanks again!

----------

## spacezmonkey

i had changed /etc/conf.d/wireless and when i try the following command.i recievie this error..

```

root@fallenangel wireless-config # /etc/init.d/net.wlan0 start

 * Running preup function

 *   Configuring wireless network for wlan0

 *   Connecting to "Yang" (WEP enabled)...                                [ ok ] *     wlan0 connected to "Yang" in managed mode

 *     on channel  (WEP enabled)

 * Bringing wlan0 up...

 *   wlan0 dhcp   

                                                     [ !! ]

```

```

##############################################################################

# SETTINGS

##############################################################################

# Hard code an ESSID to an interface - leave this unset if you wish the driver

# to scan for available Access Points

# Set to "any" to connect to any ESSID - the driver picks an Access Point

# This needs to be done when the driver doesn't support scanning

# This may work for drivers that don't support scanning but you need automatic

# AP association

# I would only set this as a last resort really - use the preferred_aps

# setting at the bottom of this file

essid_wlan0="Yang"

# Set the mode of the interface (ad-hoc or managed). Managed is default

# If it's ad-hoc you also need to specify the channel below

mode_wlan0="Managed"

# If managed mode fails, drop to ad-hoc mode with the below ESSID?

# If this is set, then remember to configure wireless options such as ifconfig

# for the specified ESSID. Channel can be set (1-14), but defaults to 3 if

# not set.

#

# The below is taken verbatim from the BSD wavelan documentation found at

# http://www.netbsd.org/Documentation/network/wavelan.html

below is my configuration:

# There are 14 channels possible; We are told that channels 1-11 are legal for

# North America, channels 1-13 for most of Europe, channels 10-13 for France,

# and only channel 14 for Japan. If in doubt, please refer to the documentation

# that came with your card or access point. Make sure that the channel you

# select is the same channel your access point (or the other card in an ad-hoc

# network) is on. The default for cards sold in North America and most of Europe

# is 3; the default for cards sold in France is 11, and the default for cards

# sold in Japan is 14.

#adhoc_essid_eth0="WLAN"

#adhoc_channel_eth0="3"

# Setup any other config commands. This is basically the iwconfig argument

# without the iwconfig $iface

iwconfig_wlan0="channel 10"

# Set private driver ioctls. This is basically the iwpriv argument without

# the iwpriv $iface

#iwpriv_eth0=""

# We can define various timeouts here.

#sleep_scan_eth0="1"

#sleep_associate_eth0="5"

# By default a successful association in Managed mode sets the MAC

# address of the AP connected to. However, some drivers (namely

# the ipw2100) don't set an invalid MAC address when association

# fails - so we need to check on link quality which some drivers

# don't report properly either.

# So if you have connection problems try flipping this setting

# Valid options are MAC, quality and all - defaults to MAC

#associate_test_wlan0="MAC"

# Some driver/card combinations need to scan in Ad-Hoc mode

# After scanning, the mode is reset to the one defined above

#scan_mode_eth0="Ad-Hoc"

# Below you can define private ioctls to run before and after scanning

# Format is the same as the iwpriv_eth0 above

# This is needed for the HostAP drivers

#iwpriv_scan_pre_eth0="host_roaming 2"

#iwpriv_scan_post_eth0="host_roaming 0"

# Define a WEP key per ESSID

# You can't use "any" for an ESSID here

key_Yang="XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XX" ( i have masked this in this forum )

# or you can use strings. Passphrase IS NOT supported

# Note - this example also sets the encryption method to open

# which is regarded as more secure than restricted

# Here are some more examples of keys as some users find others work

# and some don't where they should all do the same thing

#key_ESSID="open s:foobar"

#key_ESSID="open 1234-5678-9012"

#key_ESSID="s:foobar enc open"

#key_ESSID="1234-5678-9012 enc open"

# You may want to set muliple keys - here's an example

# It sets 4 keys on the card and instructs to use key 2 by default

#key_ESSID="[1] s:passkey1 key [2] s:passkey2 key [3] s:passkey3 key [4] s:passkey4 key [2]"

# You can also override the interface settings found in /etc/conf.d/net

# per ESSID - which is very handy if you use different networks a lot

ifconfig_Yang=( "dhcp" )

dhcpcd_Yang="-t 5"

inet6_Yang=()

routes_Yang=()

ifconfig_fallback_Yang=()

# iproute-2 style setup

#ipaddr_Yang=( "dhcp" )

#iproute_Yang=()

#ipaddr_fallback_Yang=()

# Setting name/domain server causes /etc/resolv.conf to be overwritten

# Note that if DHCP is used, and you want this to take precedence then

# please put -R in your dhcpcd options

#nameserver_Yang="XXXX"

#domain_Yang="XXXX"

# LEAP users will want to use the preassociate setting to specify

# an authentication script

#preassociate_ESSID="/run/this/script"

# Map a MAC address to an ESSID

# This is used when the Access Point is not broadcasting it's ESSID

# WARNING: This will override the ESSID being broadcast due to some

# Access Points sending an ESSID even when they have been configured

# not too!

# Change 001122334455 to the MAC address and ESSID to the ESSID

# it should map to

#essid_001122334455="ESSID"

# This lists the preferred ESSIDs to connect to in order

# ESSID's can contain any characters here as they must match the broadcast

# ESSID exactly.

# Surround each ESSID with the " character and seperate them with a space

# If the first ESSID isn't found then it moves onto the next

# If this isn't defined then it connects to the first one found

preferred_aps=( "Yang" )

```

btw..i am using linksys usb adapter, do i need to edit this line in net.wlan0

```

# For pcmcia users. note that pcmcia must be added to the same

# runlevel as the net.* script that needs it.

depend() {

        use hotplug usb

}

```

the initial setting is use hotplug pcmcia...but i am using usb adapter so am i correcto to change to use hotplug usb as shown above??

----------

## jza

 *allucid wrote:*   

> for ipw2100:
> 
> 1) make sure /usr/src/linux is pointing to the correct kernel sources
> 
> 2) make sure wireless is enabled in your kernel
> ...

 

The driver works fine as far as i'm concerned, i could even load the module, but no interfaces show up

----------

## allucid

what is the output of 'ifconfig -a'?

it would probably be a good idea if everyone got wireless working with the standard gentoo scripts before trying UberLord's scripts. This is turning into a general wireless support thread.   :Shocked: 

----------

## allucid

 *UberLord wrote:*   

>  *allucid wrote:*   Ok, I have everything working (almost) perfectly now. This is great. I do have a feature request, though. 
> 
> Would it be possible to add a post-associate script option? I have a login script I run after associating with a certain access point that I would like to have run automatically. 
> 
> You can already do this in the pre-up function in /etc/conf.d/net
> ...

 

from that post:

```
postup() {

                local IFACE=${1}

                local IWGETID=`which iwgetid 2>${devnull}`

                local essid=`${IWGETID} -s ${IFACE}`

                if [ "unifunk1" == "${essid}" ]; then

                        /usr/bin/vpnc-connect &>/dev/null

                fi

}

```

when i run the startup script i get this error at the bottom

```
 * Running postup function

/sbin/runscript.sh: line 1: -s: command not found

```

----------

## dwalexuk

 *UberLord wrote:*   

> 
> 
> wireless tool accepts ASCII and hex only - afaik it doesn't like dec

 

It works great now  :Wink:  great script.

I think it will be good idea to add example:

key_ESSID="aa2233bb" because I was trying to use key s:hexcode, and key dec code and of cause it wasn't workin. THnk you very much for support.

----------

## UberLord

 *spacezmonkey wrote:*   

> i had changed /etc/conf.d/wireless and when i try the following command.i recievie this error..
> 
> ```
> 
> root@fallenangel wireless-config # /etc/init.d/net.wlan0 start
> ...

 

That shows that you cannot get a DHCP address. I would guess that the WEP key is entered wrong

 *Quote:*   

> 
> 
> ```
> 
> # For pcmcia users. note that pcmcia must be added to the same
> ...

 

Correct  :Smile: 

----------

## spacezmonkey

i have retyped my wep address and the problem is still there...

is my configuration correct?? or do i need to change anything in /etc/conf.d/net ??

 :Question:  [/quote]

----------

## Reformist

Can we split this massive thread up, and/or stop posting to this one? all of my wireless queries seem to turn up this thread as #1 result, but there's no way I'm looking through 40 pages, or even the latest 20, for the answer. It's just not useful. If you have a question regarding a specific wireless topic, then post it in a separate thread, reference this one if you want to, but keep all of the discussion out of this thread.

----------

## iverson0881

what we really need is the capability of searching posts.  and not only searching an entire forum.

----------

## allucid

 *iverson0881 wrote:*   

> what we really need is the capability of searching posts.  and not only searching an entire forum.

 

you can do that already. just click 'search' at the top left and select 'display results as posts'.

----------

## UberLord

 *spacezmonkey wrote:*   

> i have retyped my wep address and the problem is still there...
> 
> is my configuration correct?? or do i need to change anything in /etc/conf.d/net ??
> 
>  

 [/quote]

Well, try turning off WEP to see if it is the problem or not.

----------

## niknik

the script works great for me when I call it manually with

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

```

however when I add the wireless card to the startup sequence by doing

```
rc-config add net.eth1 default

```

nothing happens! 

My wireless card is initialized by the pcmcia code and 

apparently /etc/init.d/net.eth1 does not get called at all !?

Does anyone know what's wrong and what I can do about it?

thanks

Nik

----------

## UberLord

Check that pcmcia is in the default run-level as well.

----------

## niknik

pcmcia is there ... I can start the card as using iwconfig or by calling

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

everything works as described until i want to have wireless included in the bootup sequence.

when the system comes up i get no output for eth1 ... only the note that eth0 has no wireless extensions (which is ok)

and the connection does not work after startup.

----------

## niknik

hey there,

I just solved my problem: apparently my dhcp settings caused the trouble. I had 

```
dhcpcd_eth1="-NHD -t 10 -h niksbox"
```

I have not pinpointed the actual troublemaker yet. Maybe the timeout was too short.

Anyway, everybody watch out for those dhcp settings.

What is still strange:

I did not get any error messages when things failed and the usual output 

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

gives when called on the command line is nowhere to be seen. Apparently the pcmcia startup routines suppress that output. Is that good? Should I maybe file an error?

Anyway, great script, thanks uberlord!

----------

## UberLord

 *niknik wrote:*   

> Apparently the pcmcia startup routines suppress that output. Is that good? Should I maybe file an error?

 

I think it does that by default - hotplug has a similar behaviour

----------

## roboguy

Helena,

 *Helena wrote:*   

> Well I've tried your ebuild versions 0.4.7 until 0.4.10. No luck. The error is persistent. With every up-/downgrade etc-update modifies /etc/init.d/wireless.sh (which is OK with me). Only the downgrade to 0.4.7 modified /etc/conf.d/wireless. What else can I do?

 

Have you found a solution yet? I seem to have exactly the same symptoms. I have changed nothing to do with my wireless configuation, however it has suddenly stopped working? I think I emerged some updates at the end of last week, but I can't remember what....

Now I get the following if I try /etc/init.d/net.eth1 start

```

 * Running preup function

 *   Configuring wireless network for eth1

 *   Connecting to "PorthosNet" (WEP enabled)...                              [ !! ]

 * Failed to configure wireless for eth1

 * preup eth1 failed

```

It also fails to get an ip address if I try "dhcpcd eth1"

Anyone?

Cheers,

Roboguy

----------

## UberLord

 *roboguy wrote:*   

> 
> 
> ```
> 
>  * Running preup function
> ...

 

It will fail DHCP until you connect properly.

I very much recommend using preferred_aps=( "PorthosNet" ) instead of essid_eth1="PorthosNet" as you get much more output.

----------

## LordKefka

 *Quote:*   

> emerge it and follow the ebuilds instructions
> 
> If you don't run ~arch then you need to add wireless-config to your /etc/portage/package.keywords
> 
> Code:
> ...

 

My arch is ~amd64. I edited package.keywords, but it's still masked when i emerge it??

----------

## roboguy

 *UberLord wrote:*   

> 
> 
> It will fail DHCP until you connect properly.
> 
> I very much recommend using preferred_aps=( "PorthosNet" ) instead of essid_eth1="PorthosNet" as you get much more output.

 

The strange thing is that I haven't changed any of my wireless settings for weeks. I certainly haven't changed the SSID. Just for kicks I logged into the router and checked it and it is definately still set to 'PorthosNet'...

I made the change you recommended above and tried bringing the wireless interface up.

```

porthos conf.d # /etc/init.d/net.eth1 start

 * Running preup function

 *   Configuring wireless network for eth1

 *   Scanning for access points

 *     Found "PorthosNet" at 00:0D:54:F9:7F:DE (WEP required)

 *   Connecting to "PorthosNet" (WEP enabled)...                          [ !! ]

 *   No preferred access points found

 *   Trying to force preferred incase they are hidden

 *   Failed to associate with any preferred access points

 * Couldn't associate with any access points

 * Failed to configure wireless for eth1

 * preup eth1 failed

porthos conf.d # 

```

As you can see, not much success. It seems WEP is definately not working now. I have tested  under windows and everything still works fine, so I can only conclude that something has become borked with WEP under linux...

Grrrr,

Roboguy

----------

## jimnutt

Just out of curiousity, why not define preup() and predown() in wireless.sh, then just check to see if conf.d/net sources /etc/init.d/wireless.sh?

It seems it would be a bit cleaner and would require less work after baselayout screws up conf.d/net

Other than that, great work! I was just about to start writing something similar myself when I found this. I still think the gentoo devs are making a mistake not putting this into portage now, it works better than a lot of things already in portage.

----------

## UberLord

 *LordKefka wrote:*   

> My arch is ~amd64. I edited package.keywords, but it's still masked when i emerge it??

 

~amd64 has been added to the ebuild keywords.

If you re-download the ebuild you should be able to emerge it

----------

## UberLord

 *jimnutt wrote:*   

> Just out of curiousity, why not define preup() and predown() in wireless.sh, then just check to see if conf.d/net sources /etc/init.d/wireless.sh?
> 
> It seems it would be a bit cleaner and would require less work after baselayout screws up conf.d/net
> 
> 

 

I did that at first - but came to the conclusion that it belongs in conf.d/net

 *Quote:*   

> 
> 
> Other than that, great work! I was just about to start writing something similar myself when I found this. I still think the gentoo devs are making a mistake not putting this into portage now, it works better than a lot of things already in portage.

 

I'm talking to the devs about it - some are eager.

However, the way it goes in is under debate.

It's also not helped by timezone as most the the stuff happens in IRC :/

----------

## UberLord

 *roboguy wrote:*   

> 
> 
> As you can see, not much success. It seems WEP is definately not working now. I have tested  under windows and everything still works fine, so I can only conclude that something has become borked with WEP under linux...
> 
> 

 

Try removing WEP. If it works, then your WEP config is wrong with your Gentoo client - if not then it's something else

----------

## jake&elroy

Hi UberLord,

Thanks for the great script! It really should be part of portage, as it is quite elegant and gets the job done without fiddling with the sandbox etc.

Thanks again!

----------

## Helena

 *Helena wrote:*   

> Well I've tried your ebuild versions 0.4.7 until 0.4.10. No luck. The error is persistent. With every up-/downgrade etc-update modifies /etc/init.d/wireless.sh (which is OK with me). Only the downgrade to 0.4.7 modified /etc/conf.d/wireless. What else can I do?

 Well it really took a lot of time and a bit of luck; but I found out it's a kernel/ACPI problem. Downgrading from 2.6.7 to 2.6.5 solved it!

----------

## roboguy

 *UberLord wrote:*   

>  *roboguy wrote:*   
> 
> As you can see, not much success. It seems WEP is definately not working now. I have tested  under windows and everything still works fine, so I can only conclude that something has become borked with WEP under linux...
> 
>  
> ...

 

Stranger and stranger... I removed WEP, and still I couldn't get connected.

```
porthos root # /etc/init.d/net.eth1 restart

 * Running preup function

 *   Configuring wireless network for eth1

 *   Scanning for access points

 *     Found "PorthosNet" at 00:0D:54:F9:7F:DE 

 *   Connecting to "PorthosNet" (WEP disabled)...                          [ !! ]

 *   No preferred access points found

 *   Trying to force preferred incase they are hidden

 *   Failed to associate with any preferred access points

 * Couldn't associate with any access points

 * Failed to configure wireless for eth1

 * preup eth1 failed

porthos root # 

```

It seems it simply can't find the access point perhaps?

I am truely lost so any help would be greatly appreciated. Can anyone tell me what are working versions of wireless tools and baselayout and how I might regress to an older version?

Cheers,

Roboguy.

----------

## CB2206

sry, this has probably been asked before, but i'm to lazy to read all 44 pages of this thread. (there should be an in-thread search possibility  :Smile: )

is there any way with these scripts to specify that a certain key belongs to a certain essid/mac-combination?

the problem is, that i have two wlans in different locations with different keys and macs but with the same essid. so it would be great to be able to say "this essid with this mac use this/these key(s)".

is this possible with the current version?

----------

## niknik

sorry, no idea about your question, BUT, there is an in thread search functionality. Simply go to the search page and click

```
Display results as: 

Posts
```

----------

## UberLord

 *CB2206 wrote:*   

> is there any way with these scripts to specify that a certain key belongs to a certain essid/mac-combination?
> 
> the problem is, that i have two wlans in different locations with different keys and macs but with the same essid. so it would be great to be able to say "this essid with this mac use this/these key(s)".
> 
> is this possible with the current version?

 

No - and I don't plan on putting that functionality in. Would it not make sense to give one AP a different ESSID?

----------

## UberLord

@Roboguy

Try playing around with the following variables in conf.d/wireless

sleep_associate_eth0 (seconds to wait before assocating)

associate_test_eth0 (MAC, quality and all - defaults to MAC)

Helena had a similar problem and found that it was the 2.6.7 kernel causing problems. Although I run the 2.6.7 kernel without any problems myself

----------

## CB2206

 *UberLord wrote:*   

>  *CB2206 wrote:*   is there any way with these scripts to specify that a certain key belongs to a certain essid/mac-combination?
> 
> the problem is, that i have two wlans in different locations with different keys and macs but with the same essid. so it would be great to be able to say "this essid with this mac use this/these key(s)".
> 
> is this possible with the current version? 
> ...

 

well, i do not have access to the configs of these aps. and the do both have the name "wlan". :-/

----------

## UberLord

 *CB2206 wrote:*   

> well, i do not have access to the configs of these aps. and the do both have the name "wlan". :-/

 

Hey - go and kick the owners into giving them decent names   :Razz: 

I'll think about it - no promises though

----------

## crafteh

I've emerged the package, installed my card's drivers, and edited the configs, but when i do "/etc/init.d/net.ath0 start" I don't get the output that everyone else gets. It doesn't look like the preup function gets executed. 

```
bash-2.05b# /etc/init.d/net.ath0 start

 * Bringing ath0 up...

 * Failed to bring ath0 up                                                             [ !! ]
```

```
bash-2.05b# iwconfig

eth0      no wireless extensions.

lo        no wireless extensions.

ath0      IEEE 802.11  ESSID:""

          Mode:Managed  Frequency:5.7GHz  Access Point: FF:FF:FF:FF:FF:FF

          Bit Rate:6Mb/s   Tx-Power:off   Sensitivity=0/3

          Retry:off   RTS thr:off   Fragment thr:off

          Encryption key:off

          Power Management:off

          Link Quality:0/94  Signal level:-95 dBm  Noise level:-95 dBm

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

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

```

```
# /etc/conf.d/wireless:

# Global wireless config file for net.* rc-scripts

##############################################################################

# HINTS

##############################################################################

# Remember to change eth0 to your wireless interface which may be

# eth0, eth1, wlan0, ath0 - you get the idea. If you're not sure

# you can type "iwconfig" at the command prompt and it will tell you which

# interfaces are wireless.

# Say that your wireless interface is ath0 - the line

#      #essid_eth0="any"

# becomes

#      #essid_ath0="any"

#

# Remember to change ESSID to your ESSID.

# Say that your ESSID is My NET - the line

#      #key_ESSID="s:passkey"

# becomes

#      #key_My_NET="s:passkey"

# Notice that the space has changed to an underscore - do the same with all

# characters not in a-z A-Z (english alphabet) 0-9.

#

# Any ESSID's in quotes like essid_eth0="My NET" may need to be escaped

# This means placing the character \ before the character

# \" need to be escaped for example

# So if your ESSID is

#      My "\ NET

# it becomes

#      My \"\\ NET

# for example

#      #essid_eth0="My\"\\NET"

#

# As a final note, most users will just need to set the following options

# key_ESSID1="s:yourkeyhere enc open"

# key_ESSID2="s:yourothrkey enc open"

# preferred_aps=( "ESSID1" "ESSID2" )

#

# Clear? Good. Now configure your wireless network below

#########################################################

##############################################################################

# SETTINGS

##############################################################################

# Hard code an ESSID to an interface - leave this unset if you wish the driver

# to scan for available Access Points

# Set to "any" to connect to any ESSID - the driver picks an Access Point

# This needs to be done when the driver doesn't support scanning

# This may work for drivers that don't support scanning but you need automatic

# AP association

# I would only set this as a last resort really - use the preferred_aps

# setting at the bottom of this file

essid_ath0="any"

# Set the mode of the interface (ad-hoc or managed). Managed is default

# If it's ad-hoc you also need to specify the channel below

mode_ath0="Managed"

# If managed mode fails, drop to ad-hoc mode with the below ESSID?

# If this is set, then remember to configure wireless options such as ifconfig

# for the specified ESSID. Channel can be set (1-14), but defaults to 3 if

# not set.

#

# The below is taken verbatim from the BSD wavelan documentation found at

# http://www.netbsd.org/Documentation/network/wavelan.html

# There are 14 channels possible; We are told that channels 1-11 are legal for

# North America, channels 1-13 for most of Europe, channels 10-13 for France,

# and only channel 14 for Japan. If in doubt, please refer to the documentation

# that came with your card or access point. Make sure that the channel you

# select is the same channel your access point (or the other card in an ad-hoc

# network) is on. The default for cards sold in North America and most of Europe

# is 3; the default for cards sold in France is 11, and the default for cards

# sold in Japan is 14.

adhoc_essid_ath0="WLAN"

adhoc_channel_ath0="3"

# Setup any other config commands. This is basically the iwconfig argument

# without the iwconfig $iface

#iwconfig_eth0=""

# Set private driver ioctls. This is basically the iwpriv argument without

# the iwpriv $iface

#iwpriv_eth0=""

# We can define various timeouts here.

sleep_scan_ath0="1"

sleep_associate_ath0="5"

# By default a successful association in Managed mode sets the MAC

# address of the AP connected to. However, some drivers (namely

# the ipw2100) don't set an invalid MAC address when association

# fails - so we need to check on link quality which some drivers

# don't report properly either.

# So if you have connection problems try flipping this setting

# Valid options are MAC, quality and all - defaults to MAC

associate_test_ath0="MAC"

# Some driver/card combinations need to scan in Ad-Hoc mode

# After scanning, the mode is reset to the one defined above

scan_mode_ath0="Ad-Hoc"

# Below you can define private ioctls to run before and after scanning

# Format is the same as the iwpriv_eth0 above

# This is needed for the HostAP drivers

#ipriv_scan_pre_eth0="host_roaming 2"

#iwpriv_scan_post_eth0="host_roaming 0"

# Define a WEP key per ESSID

# You can't use "any" for an ESSID here

#key_ESSID="1234-1234-1234-1234-1234-1234-56"

# or you can use strings. Passphrase IS NOT supported

# Note - this example also sets the encryption method to open

# which is regarded as more secure than restricted

#key_ESSID="s:foobar enc open"

#key_ESSID="s:foobar enc restricted"

# Here are some more examples of keys as some users find others work

# and some don't where they should all do the same thing

#key_ESSID="open s:foobar"

#key_ESSID="open 1234-5678-9012"

#key_ESSID="s:foobar enc open"

#key_ESSID="1234-5678-9012 enc open"

# You may want to set muliple keys - here's an example

# It sets 4 keys on the card and instructs to use key 2 by default

#key_ESSID="[1] s:passkey1 key [2] s:passkey2 key [3] s:passkey3 key [4] s:passkey4 key [2]"

# You can also override the interface settings found in /etc/conf.d/net

# per ESSID - which is very handy if you use different networks a lot

ifconfig_any=( "dhcp" )

dhcpcd_any="-t 5"

#inet6_any=()

#routes_any=()

#ifconfig_fallback_any=()

# iproute-2 style setup

#ipaddr_ESSID=( "dhcp" )

#iproute_ESSID=()

#ipaddr_fallback_ESSID=()

# Setting name/domain server causes /etc/resolv.conf to be overwritten

# Note that if DHCP is used, and you want this to take precedence then

# please put -R in your dhcpcd options

#nameserver_ESSID="192.168.0.1"

#domain_ESSID="some.domain"

# LEAP users will want to use the preassociate setting to specify

# an authentication script

#preassociate_ESSID="/run/this/script"

# Map a MAC address to an ESSID

# This is used when the Access Point is not broadcasting it's ESSID

# WARNING: This will override the ESSID being broadcast due to some

# Access Points sending an ESSID even when they have been configured

# not too!

# Change 001122334455 to the MAC address and ESSID to the ESSID

# it should map to

#essid_001122334455="ESSID"

# This lists the preferred ESSIDs to connect to in order

# ESSID's can contain any characters here as they must match the broadcast

# ESSID exactly.

# Surround each ESSID with the " character and seperate them with a space

# If the first ESSID isn't found then it moves onto the next

# If this isn't defined then it connects to the first one found

#preferred_aps=( "ESSID 1" "ESSID 2" )

```

----------

## CB2206

 *UberLord wrote:*   

> Hey - go and kick the owners into giving them decent names  
> 
> I'll think about it - no promises though

 

it is often said for not-public wlans to give them a name, with which one is not able to guess whose wlan this is. (kind of security...well, i dont think so but i heard and read this very often)

----------

## UberLord

 *crafteh wrote:*   

> I've emerged the package, installed my card's drivers, and edited the configs, but when i do "/etc/init.d/net.ath0 start" I don't get the output that everyone else gets. It doesn't look like the preup function gets executed. 

 

Ensure that net.ath0 is a symlink to net.eth0

```
rm /etc/init.d/net.ath0

ln -sf /etc/init.d/net.eth0 /etc/init.d/net.ath0
```

Ensure that your /etc/conf.d/net has the patch in - but from your comment about the preup I assume it has....

----------

## UberLord

NEW EBUILD POSTED

No new features or functionality added ..... so why goto version 0.5.0?

Well, it's undergone a major code cleanup - it's much more modular hardly uses "global" variables any more. This makes it much easier to debug and add new features.

For those interested, I just have 3 global arrays and that's to hold the results of a network scan. (Not that anything was really "global" as everthing is still "local" to the main functions).

I think all functionality is supported, but post any problems you have with it here and I'll get them fixed.

I'm away for a few days, so feel free to go back to 0.4.10 if I don't fix em fast enough for you!

----------

## Zebbeman

Hi,

I've been trying for a week now with no luck.

My nic is a Netgear WG311T.

My AP is a Netgear DG834G.

I'm using madwifi-driver for my Atheros chip, and I'm loading wlan, ath_hal and ath_pci. I also got CONFIG_NET_RADIO=y and CONFIG_NET_WIRELESS=y in my kernel (2.6.7).

I got almost there, but couldn't get an IP by DHCP. I found my AP, it said I was connected, but when trying receiving an address I only got [!!]. Today I got connected to my neighbour's AP by mistake, and it worked fine. Only with 11Mbps though, it's a 11b AP. Anyway, I thought I might get rid of the problem by getting the new ebuild (0.5.0), but now everything stopped working. 

```

 * Running preup function

 *   Configuring wireless network for ath0

 *   ath0 does not support setting keys

 *   or the parameter "key_nowire" is incorrect

 * Failed to configure wireless for ath0

 * preup ath0 failed

```

I tried to skip the parameters, that's how I got connected to my neighbour, but then I got this:

```

 * Running preup function

 *   Configuring wireless network for ath0

 *   Scanning for access points

 *     no access points found

 * Couldn't find any access points on ath0

 * Failed to configure wireless for ath0

 * preup ath0 failed

```

I had the MAC of my AP in iwconfig ath0 before, but now it's only FF:FF:FF:FF:FF:FF. I did ran etc-update and ebuild config after updgrade and removed it in /net after (I guess it's only adding preup() once more?).

Can anyone give me a hint of what's happening here?

Edit: I see my AP's mac now, posting iwconfig & ifconfig:

```

iwconfig

ath0      IEEE 802.11  ESSID:"nowire"  

          Mode:Managed  Frequency:2.462GHz  Access Point: $MAC  

          Bit Rate:1Mb/s   Tx-Power:50 dBm   Sensitivity=0/3  

          Retry:off   RTS thr:off   Fragment thr:off

          Encryption key:off

          Power Management:off

          Link Quality:20/94  Signal level:-75 dBm  Noise level:-95 dBm

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

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

ifconfig

ath0      Link encap:Ethernet  HWaddr $MAC  

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:2387 errors:1401 dropped:0 overruns:0 frame:1401

          TX packets:1027 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:199 

          RX bytes:176048 (171.9 Kb)  TX bytes:46355 (45.2 Kb)

          Interrupt:17 Memory:e09c0000-e09d0000 

```

Regards,

Seb

----------

## CB2206

mh, i have partly the same problem with one ap i'm sometimes connecting to. it is recognized, but dhcp does not work. setting ip etc. by hand works and i can use this wlan. with my wlan at home i don't have any problems using dhcp.

is this an incompatibility of the hardware?

wlan card in notebook: dell truemobile 1300 using with ndiswrapper

ap at home: level one card with atheros chipset using madwifi-driver in ap-mode

ap with which dhcp does not work: i think elsa, have to check it again on monday

----------

## UberLord

CB2206, I've been considering your request and it is a valid one - I imagine quite a few public hotspots are called WLAN. I will try and implement something for you  :Smile: 

----------

## UberLord

 *Zebbeman wrote:*   

> Hi,
> 
> I've been trying for a week now with no luck.
> 
> My nic is a Netgear WG311T.
> ...

 

I have the WG311 card as well - however I cannot recommend the mad-wifi driver in portage as it's quite old and does have a few problems. The CVS one is much more reliable. Changing to a CVS build may cure your DHCP problem.

Also, could you post your config file options you have enabled? (ie don't post the entire conf.d/wireless)

----------

## UberLord

NEW EBUILD POSTED

Quite a few bugs fixed - more than I thought!

You can now assign a WEP key to a MAC address

```
mac_key_001122334455="s:foobar enc open"
```

for example

----------

## CB2206

 *UberLord wrote:*   

> NEW EBUILD POSTED
> 
> Quite a few bugs fixed - more than I thought!
> 
> You can now assign a WEP key to a MAC address
> ...

 

woohooo...great. i'll check this out later on! thanx in advanced!

----------

## CB2206

works great. thanks a lot!

one small thing: in the output of net.wlan0 i get an error saying about "invalid argument":

```

 * Running predown function

 *   Removing wireless configuration from wlan0...                                                        [ ok ]

 * Bringing wlan0 down...

 *   Releasing DHCP lease for wlan0                                                                       [ ok ]

 *   Stopping wlan0

RTNETLINK answers: Invalid argument                                                                       [ ok ]

 * Running preup function

 *   Configuring wireless network for wlan0

 *   Scanning for access points

 *     Found "wlan" at 00:11:22:33:44:55 (WEP required)

 *   Connecting to "wlan" (WEP enabled)...                                                                [ ok ]

 *     wlan0 connected to "wlan" in managed mode

 *     on channel 03 (WEP enabled)

 * Bringing wlan0 up...

 *   wlan0 dhcp                                                                                           [ ok ]

 *     wlan0 received address 192.168.0.3

```

and why is wireless-config not implemented in the standard gentoo net scripts?

----------

## UberLord

 *CB2206 wrote:*   

> works great. thanks a lot!
> 
> one small thing: in the output of net.wlan0 i get an error saying about "invalid argument":
> 
> ```
> ...

 

That's because you're using iproute2 instead of net-tools.

The Gentoo net.eth0 script does not handle iproute2 as well as net-tools at this time - try unemerging iproute2 and re-emerging net-tools and this error should go away.

 *Quote:*   

> 
> 
> and why is wireless-config not implemented in the standard gentoo net scripts?

 

It's not yet ........ but should be soon  :Wink: 

----------

## CB2206

 *UberLord wrote:*   

> 
> 
> That's because you're using iproute2 instead of net-tools.
> 
> The Gentoo net.eth0 script does not handle iproute2 as well as net-tools at this time - try unemerging iproute2 and re-emerging net-tools and this error should go away.
> ...

 

ok, thx. message is gone now.

 *UberLord wrote:*   

> It's not yet ........ but should be soon 

 

great.  :Smile: 

----------

## zaai

Hi UberLord, what a great script  :Smile: 

Several people reported problems with WEP. Same here.

I'm pretty sure it isn't the wep key because the key is correct because when I type it manually:

 iwconfig eth1 key 0011-2233-4455-6677-8899-aabb-cc

 dhcpd eth1 

then it works

To be sure it is not a timing issue I set: sleep_associate_eth1="5"

Here are the details:

1. plug in the card

```

# ps -ef

UID        PID  PPID  C STIME TTY          TIME CMD

root      9073     1  0 13:56 ?        00:00:00 [scsi_eh_0]

root     12256     1  0 14:19 ?        00:00:00 /sbin/cardmgr -s /var/run/stab -f

root     13160     4  0 14:37 ?        00:00:00 /bin/sh /sbin/hotplug net

root     13161 13160  2 14:37 ?        00:00:00 /bin/bash /sbin/runscript.sh /etc/init.d/net.eth1 --quiet start

root     13238 13161  0 14:37 ?        00:00:00 /sbin/dhcpcd eth1

```

2. iwconfig:

```

# iwconfig

eth1      IEEE 802.11-DS  ESSID:"Wheel"  Nickname:"Prism  I"

          Mode:Managed  Frequency:2.417GHz  Access Point: 00:09:5B:6B:14:12  

          Bit Rate:11Mb/s   Tx-Power=15 dBm   Sensitivity:1/3  

          Retry min limit:8   RTS thr:off   Fragment thr:off

          Encryption key:off

          Power Management:off

          Link Quality:68/92  Signal level:-46 dBm  Noise level:-149 dBm

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

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

```

The 'wireless' script (listed down below) contains an entry for AP 'Wheel' including encryption key '0011-2233-4455-6677-8899-aabb-cc'

However, iwconfig shows no encryption. 

After a while of doing nothing the essid goes empty as the search for a usable AP continues.

3. ifconfig

```

# ifconfig:

eth1      Link encap:Ethernet  HWaddr 00:04:E2:29:42:F8  

          inet6 addr: fe80::204:e2ff:fe29:42f8/64 Scope:Link

          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:8 errors:3 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:0 (0.0 b)  TX bytes:3592 (3.5 Kb)

          Interrupt:3 Base address:0x100 

lo        Link encap:Local Loopback  

          inet addr:127.0.0.1  Mask:255.0.0.0

          inet6 addr: ::1/128 Scope:Host

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0 

          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

```

Heh does this mean that dhcpd created an entry for eth1 already?

4. last, the manual fix

Now the reason why I think this is a script bug:

```

iwconfig eth1 key 0011-2233-4455-6677-8899-aabb-cc

(I doublechecked to make sure it was exactly as in the script)

dhcpd eth1

ping www.telus.net

```

It works!

So I'm quite sure the script either didn't set the key or that iwconfig didn't accept it at the time. 

5. Below the content of wireless - the WEP key is changed into aabb-aabb-aabb-aabb-aa

As you can see the key is bound to the essid. I've also tried it with the AP MAC but that didn't help either.

```

# /etc/conf.d/wireless:

# Global wireless config file for net.* rc-scripts

##############################################################################

# HINTS

##############################################################################

# Remember to change eth0 to your wireless interface which may be

# eth0, eth1, wlan0, ath0 - you get the idea. If you're not sure

# you can type "iwconfig" at the command prompt and it will tell you which

# interfaces are wireless.

# Say that your wireless interface is ath0 - the line

#      #essid_eth0="any"

# becomes

#      #essid_ath0="any"

#

# Remember to change ESSID to your ESSID.

# Say that your ESSID is My NET - the line

#      #key_ESSID="s:passkey"

# becomes

#      #key_My_NET="s:passkey"

# Notice that the space has changed to an underscore - do the same with all

# characters not in a-z A-Z (english alphabet) 0-9.

#

# Any ESSID's in quotes like essid_eth0="My NET" may need to be escaped

# This means placing the character \ before the character

# \" need to be escaped for example

# So if your ESSID is

#      My "\ NET

# it becomes

#      My \"\\ NET

# for example

#      #essid_eth0="My\"\\NET"

#

# As a final note, most users will just need to set the following options

# key_ESSID1="s:yourkeyhere enc open"

# key_ESSID2="s:yourothrkey enc open"

# preferred_aps=( "ESSID1" "ESSID2" )

#

# Clear? Good. Now configure your wireless network below

#########################################################

##############################################################################

# SETTINGS

##############################################################################

# Hard code an ESSID to an interface - leave this unset if you wish the driver

# to scan for available Access Points

# Set to "any" to connect to any ESSID - the driver picks an Access Point

# This needs to be done when the driver doesn't support scanning

# This may work for drivers that don't support scanning but you need automatic

# AP association

# I would only set this as a last resort really - use the preferred_aps

# setting at the bottom of this file

#essid_eth0="any"

#Wheel_eth1="any"

# Set the mode of the interface (ad-hoc or managed). Managed is default

# If it's ad-hoc you also need to specify the channel below

#mode_eth0="Managed"

mode_eth1="Managed"

# If managed mode fails, drop to ad-hoc mode with the below ESSID?

# If this is set, then remember to configure wireless options such as ifconfig

# for the specified ESSID. Channel can be set (1-14), but defaults to 3 if

# not set.

#

# The below is taken verbatim from the BSD wavelan documentation found at

# http://www.netbsd.org/Documentation/network/wavelan.html

# There are 14 channels possible; We are told that channels 1-11 are legal for

# North America, channels 1-13 for most of Europe, channels 10-13 for France,

# and only channel 14 for Japan. If in doubt, please refer to the documentation

# that came with your card or access point. Make sure that the channel you

# select is the same channel your access point (or the other card in an ad-hoc

# network) is on. The default for cards sold in North America and most of Europe

# is 3; the default for cards sold in France is 11, and the default for cards

# sold in Japan is 14.

#adhoc_essid_eth0="WLAN"

#adhoc_channel_eth0="3"

# Setup any other config commands. This is basically the iwconfig argument

# without the iwconfig $iface

#iwconfig_eth0=""

# Set private driver ioctls. This is basically the iwpriv argument without

# the iwpriv $iface

#iwpriv_eth0=""

# We can define various timeouts here.

#sleep_scan_eth0="1"

#sleep_associate_eth0="5"

#--- HS: 24 July 2004

sleep_associate_eth1="5"

#---

# By default a successful association in Managed mode sets the MAC

# address of the AP connected to. However, some drivers (namely

# the ipw2100) don't set an invalid MAC address when association

# fails - so we need to check on link quality which some drivers

# don't report properly either.

# So if you have connection problems try flipping this setting

# Valid options are MAC, quality and all - defaults to MAC

#associate_test_eth0="MAC"

# Some driver/card combinations need to scan in Ad-Hoc mode

# After scanning, the mode is reset to the one defined above

#scan_mode_eth0="Ad-Hoc"

# Below you can define private ioctls to run before and after scanning

# Format is the same as the iwpriv_eth0 above

# This is needed for the HostAP drivers

#iwpriv_scan_pre_eth0="host_roaming 2"

#iwpriv_scan_post_eth0="host_roaming 0"

# Define a WEP key per ESSID or MAC address (of the AP, not your card)

# You can't use "any" for an ESSID here

#key_ESSID="1234-1234-1234-1234-1234-1234-56"

# or you can use strings. Passphrase IS NOT supported

# Note - this example also sets the encryption method to open

# which is regarded as more secure than restricted

#key_ESSID="s:foobar enc open"

#key_ESSID="s:foobar enc restricted"

# WEP key for the AP with MAC address 001122334455

#mac_key_001122334455="s:foobar"

#[b]key_00095b6b1412="enc open 0011-2233-4455-6677-8899-aabb-cc"[/b]

# Here are some more examples of keys as some users find others work

# and some don't where they should all do the same thing

#key_ESSID="open s:foobar"

#key_ESSID="open 1234-5678-9012"

#key_ESSID="s:foobar enc open"

#key_ESSID="1234-5678-9012 enc open"

# You may want to set muliple keys - here's an example

# It sets 4 keys on the card and instructs to use key 2 by default

#key_ESSID="[1] s:passkey1 key [2] s:passkey2 key [3] s:passkey3 key [4] s:passkey4 key [2]"

#---HS 24 July 2004 

#[b]key_Wheel="0011-2233-4455-6677-8899-aabb-cc"[/b]

[b]key_Wheel="enc open 0011-2233-4455-6677-8899-aabb-cc"[/b]

#---

# You can also override the interface settings found in /etc/conf.d/net

# per ESSID - which is very handy if you use different networks a lot

#ifconfig_ESSID=( "dhcp" )

#dhcpcd_ESSID="-t 5"

#inet6_ESSID=()

#routes_ESSID=()

#ifconfig_fallback_ESSID=()

#--- HS: 24 July 2004

[b]ifconfig_Wheel=( "dhcp" )[/b]

#---

# iproute-2 style setup

#ipaddr_ESSID=( "dhcp" )

#iproute_ESSID=()

#ipaddr_fallback_ESSID=()

# Setting name/domain server causes /etc/resolv.conf to be overwritten

# Note that if DHCP is used, and you want this to take precedence then

# please put -R in your dhcpcd options

#nameserver_ESSID="192.168.0.1"

#domain_ESSID="some.domain"

# LEAP users will want to use the preassociate setting to specify

# an authentication script

#preassociate_ESSID="/run/this/script"

# Map a MAC address to an ESSID

# This is used when the Access Point is not broadcasting it's ESSID

# WARNING: This will override the ESSID being broadcast due to some

# Access Points sending an ESSID even when they have been configured

# not too!

# Change 001122334455 to the MAC address and ESSID to the ESSID

# it should map to

#essid_001122334455="ESSID"

[b]essid_00095b6b1412="Wheel"[/b]

# This lists the preferred ESSIDs to connect to in order

# ESSID's can contain any characters here as they must match the broadcast

# ESSID exactly.

# Surround each ESSID with the " character and seperate them with a space

# If the first ESSID isn't found then it moves onto the next

# If this isn't defined then it connects to the first one found

#preferred_aps=( "ESSID 1" "ESSID 2" )

[b]preferred_aps=( "Wheel" "default" )[/b]

```

----------

## zaai

Hi UberLord, what a great script  :Smile: 

Several people reported problems with WEP. Same here.

I'm pretty sure it isn't the wep key because when I type it manually:

 iwconfig eth1 key 0011-2233-4455-6677-8899-aabb-cc

 dhcpd eth1 

then it works

To be sure it is not a timing issue I set: sleep_associate_eth1="5"

Here are the details (sorry for the long post):

1. plug in the card

```

# ps -ef

UID        PID  PPID  C STIME TTY          TIME CMD

root      9073     1  0 13:56 ?        00:00:00 [scsi_eh_0]

root     12256     1  0 14:19 ?        00:00:00 /sbin/cardmgr -s /var/run/stab -f

root     13160     4  0 14:37 ?        00:00:00 /bin/sh /sbin/hotplug net

root     13161 13160  2 14:37 ?        00:00:00 /bin/bash /sbin/runscript.sh /etc/init.d/net.eth1 --quiet start

root     13238 13161  0 14:37 ?        00:00:00 /sbin/dhcpcd eth1

```

2. iwconfig:

```

# iwconfig

eth1      IEEE 802.11-DS  ESSID:"Wheel"  Nickname:"Prism  I"

          Mode:Managed  Frequency:2.417GHz  Access Point: 00:09:5B:6B:14:12  

          Bit Rate:11Mb/s   Tx-Power=15 dBm   Sensitivity:1/3  

          Retry min limit:8   RTS thr:off   Fragment thr:off

          Encryption key:off

          Power Management:off

          Link Quality:68/92  Signal level:-46 dBm  Noise level:-149 dBm

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

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

```

The 'wireless' script (listed down below) contains an entry for AP 'Wheel' including encryption key '0011-2233-4455-6677-8899-aabb-cc'

However, iwconfig shows no encryption. 

After a while of doing nothing the essid goes empty as the search for a usable AP continues.

3. ifconfig

```

# ifconfig:

eth1      Link encap:Ethernet  HWaddr 00:04:E2:29:42:F8  

          inet6 addr: fe80::204:e2ff:fe29:42f8/64 Scope:Link

          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:8 errors:3 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:0 (0.0 b)  TX bytes:3592 (3.5 Kb)

          Interrupt:3 Base address:0x100 

lo        Link encap:Local Loopback  

          inet addr:127.0.0.1  Mask:255.0.0.0

          inet6 addr: ::1/128 Scope:Host

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0 

          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

```

Heh does this mean that dhcpd created an entry for eth1 already?

4. last, the manual fix

Now the reason why I think this is a script bug:

```

iwconfig eth1 key 0011-2233-4455-6677-8899-aabb-cc

(I doublechecked to make sure it was exactly as in the script)

dhcpd eth1

ping www.telus.net

```

It works!

So I'm quite sure the script either didn't set the key or that iwconfig didn't accept it at the time. 

5. Below the content of wireless - the WEP key is changed into "0011-2233-4455-6677-8899-aabb-cc" for obvious reasons.

As you can see the key is bound to the essid. I've also tried it with the AP MAC but that didn't help either.

 *Quote:*   

> 
> 
> mode_eth1="Managed"
> 
> sleep_associate_eth1="5"
> ...

 Last edited by zaai on Sun Jul 25, 2004 7:57 am; edited 1 time in total

----------

## CB2206

well, this doesnt really have anything to do with wireless-config, but perhaps anyone can help me.

i'm using ndiswrapper for my builtin broadcom wlan card. i load the ndiswrapper modul through /etc/modules.autoload/kernel-2.6 during startup but i do not start net.wlan0, but wlan0 is up after startup. why is this and how can disbale this?

another thing is, that i want to use ifplugd monitoring eth0 for plugged-in cable and to change to wlan when no cable is plugged in and the other way around. i changed /usr/sbin/ifplugd.action to start net.wlan0 on unplugging the cable and to stop it on plugging the cable in again. it does work most the time, but sometimes i cannot ping servers on the internet and cannot visit websites anymore although i can still use icq. does anyone have an idea what could be wrong? nameservers are the same for both because lan and wlan is bridged. both devices are configured using dhcp.

thx a lot and sorry this does not have very much to do with wireless-config, but i think the people watching this thread do have the most knowledge when it comes to wlan.  :Smile: 

----------

## UberLord

@zaai

The key you are entering the key in the config file and the way you are typing it on the command line are different - you have the keyword open at the front. Make the entry identical after the "iwconfig eth1 key" bit you enter and it should then work.

If the script output (which you didn't post) shows WEP being enabled then it has enabled it - or tried too.

If there's an error with the script - this is the line that would be causing it

```
e=$( iwconfig ${iface} key ${key} 2>&1 )
```

Basically it captures the content of stderr when applying your key to the interface.

Now, if WEP wasn't working then I couldn't be typing this to you as my AP requires WEP.

----------

## Zebbeman

 *UberLord wrote:*   

> 
> 
> I have the WG311 card as well - however I cannot recommend the mad-wifi driver in portage as it's quite old and does have a few problems. The CVS one is much more reliable. Changing to a CVS build may cure your DHCP problem.
> 
> 

 

Thanks! I read about someone else having this problem with the DG834G, so I'll try the CVS version now.

 *UberLord wrote:*   

> 
> 
> Also, could you post your config file options you have enabled? (ie don't post the entire conf.d/wireless)

 

I only got:

essid_ath0="nowire"

mode_ath0="Managed"

enabled in wireless. It was when I removed these lines I got connected to my neighbour's instead (with DHCP). I haven't changed anything, so something must have happend when I upgraded to 0.5.0.

----------

## UberLord

Try the shiny new 0.5.1 - it fixes quite a few problems that I missed :/

----------

## Tyger

The shiny new 0.5.1 broke my wlan when I upgraded from 0.4.10.

I have a AP with hidden ESSID. 0.4.10 used preferred_aps to get the correct ESSID and used key_ESSID to set the WEP-key.

0.5.1 tried to connect directly with the AP, identifying it by it's MAC-address. It connected without WEP, and the dhcp-request timed out. Changing key_ESSID = "..." to mac_key_MAC = "..." solved the problem. The MAC is automagically mapped to the correct ESSID.

[CORRECTION]

The MAC is _not_ automagically mapped to the correct ESSID. I had to set

essid_MAC = ESSID

[/CORRECTION]

Cya, Ed

PS: Oh, thank you for wireless-config, oh great Uberlord! I praise you  :Smile: Last edited by Tyger on Mon Jul 26, 2004 8:14 am; edited 1 time in total

----------

## teedog

I'm having problems connecting to a WEP-enabled managed wireless network.

I see the following when net.wlan0 executes:

```

 *     Found 01:23:01:23:01:23 (WEP required)

 *       mapping to "MyESSID"

 *   Connecting to "MyESSID" (WEP enabled)...                      [ ok ]

 *     wlan0 connected to "MyESSID" in managed mode

 *     on channel 06 (WEP disabled)

 * Bringing wlan0 up via DHCP...                                          [ !! ]

```

I have configured /etc/conf.d/wireless with the correct WEP key for the ESSID, MyESSID.  Why would it first try connecting to MyESSID with WEP enabled and then actually connect on channel 06 (the correct channel) with WEP disabled?  Obviously, since WEP is disabled, the DHCP request just times out and connection is never established.

Thanks in advance.

----------

## Zebbeman

Great, the 0.5.1fixed the upgrade problem!

The CVS version of madwifi-driver didn't fix my connecting problem. I still cannot connect to my DG843G AP. I've read things like "the madwifi-driver doesn't cope with DG843G" so I tried to upgrade the firmware as well. I can connect to another AP, so it must be true?

Is there any other driver that works with the Atheros chip?

----------

## LordKefka

I'm trying to edit /etc/conf.d/wireless, and not sure wat to do...

# Remember to change eth0 to your wireless interface which may be

# eth0, eth1, wlan0, ath0 - you get the idea. If you're not sure

# you can type "iwconfig" at the command prompt and it will tell you which

# interfaces are wireless.

iwconfig gives me this, though:

lo        no wireless extensions.

eth0      no wireless extensions.

----------

## UberLord

 *Zebbeman wrote:*   

> Is there any other driver that works with the Atheros chip?

 

You could always try using ndiswrapper and the windows driver

----------

## UberLord

 *Tyger wrote:*   

> The shiny new 0.5.1 broke my wlan when I upgraded from 0.4.10.
> 
> I have a AP with hidden ESSID. 0.4.10 used preferred_aps to get the correct ESSID and used key_ESSID to set the WEP-key.
> 
> 0.5.1 tried to connect directly with the AP, identifying it by it's MAC-address. It connected without WEP, and the dhcp-request timed out. Changing key_ESSID = "..." to mac_key_MAC = "..." solved the problem. The MAC is automagically mapped to the correct ESSID.

 

Could you post the exact output of both scripts please?

(ie a working 0.4.10 and a non-working 0.5.1)

----------

## UberLord

 *LordKefka wrote:*   

> I'm trying to edit /etc/conf.d/wireless, and not sure wat to do...
> 
> # Remember to change eth0 to your wireless interface which may be
> 
> # eth0, eth1, wlan0, ath0 - you get the idea. If you're not sure
> ...

 

You don't have a working wireless driver for your wifi card. Try asking in the Networking forum to help you get one   :Idea: 

----------

## UberLord

 *teedog wrote:*   

> 
> 
> I have configured /etc/conf.d/wireless with the correct WEP key for the ESSID, MyESSID.  Why would it first try connecting to MyESSID with WEP enabled and then actually connect on channel 06 (the correct channel) with WEP disabled?  Obviously, since WEP is disabled, the DHCP request just times out and connection is never established.
> 
> 

 

Now thats a tricky one.

It looks like WEP is being set, but it's not being reported as set even though it is.

Could you try setting a static IP, running the script and then PM me the exact output of iwconfig wlan0 and your WEP settings in conf.d/wireless - thanks!

----------

## teedog

 *UberLord wrote:*   

>  *teedog wrote:*   
> 
> I have configured /etc/conf.d/wireless with the correct WEP key for the ESSID, MyESSID.  Why would it first try connecting to MyESSID with WEP enabled and then actually connect on channel 06 (the correct channel) with WEP disabled?  Obviously, since WEP is disabled, the DHCP request just times out and connection is never established. 
> 
> Now thats a tricky one.
> ...

 

I'll try to do that when I get home.  It seems like the problem Tyger is having is similar to mine.  I have used an older version of wireless-config on the same network with the same setup without problems.

I've noticed another problem.  Ever since I upgraded to v0.5.1 (I skipped a few versions so not sure when the bug appeared), the "preferred_aps" option can no longer handle ESSID's with spaces in them, like "my wireless" for example.  The script seems to think that

```
preferred_aps=( "my wireless" )
```

is actually

```
preferred_aps=( "my" "wireless" )
```

I have tried using "my_wireless" and "mywireless" to no avail.

----------

## Tyger

 *UberLord wrote:*   

> 
> 
> [...]
> 
> Could you post the exact output of both scripts please?
> ...

 

wireless-config-0.4.10

```

* Running preup function

*   Configuring wireless network for wlan0

*   Scanning for access points

*      Found 00:01:E3:06:F7:E9 (WEP required)

*   Trying to force preferred incase they are hidden

*   Connecting to "HomeNet" ...                                                             [ok]

*     wlan0 connected to "HomeNet" in managed mode

*     on channel 10 (WEP enabled)

* Bringing wlan0 up via DHCP...                                                            [ok]

*   wlan0 received address 192.168.100.216

```

wireless-config-0.5.1 with the same configuration

```

* Running preup function

*   Configuring wireless network for wlan0

*   Scanning for access points

*     Found 00:01:E3:06:F7:E9 (WEP required)

*   Connecting to "00:01:E3:06:F7:E9" (WEP disabled)...                     [ok]

*     wlan0 connected to "0001E306F7E9" in managed mode

*     on channel 1 (WEP disabled)

*  Bringing wlan0 up via DHCP...                                                           [!!]

```

Cya, Ed

----------

## UberLord

NEW EBUILD POSTED

Fixes problems with space in ESSID

You can now specify preferred_aps_eth0, blacklisted_aps and blacklisted_eth0

----------

## stingray

hi,

this script is really nice but i got a small problem with it. my setup is an ethernet adapter at eth0 and a wireless adapter at eth1. everytime i run

# /etc/init.d/net.eth0 start

i get the following:

* Running preup function

 *   Wireless extensions not found for eth0

 * Bringing eth0 up (192.168.6.20)...                                     [ ok ]

looks for me like the default gateway doesn't get set. the eth1-script works without problems (sets gateway). i figured out that only the last gateway="ethX/...."-line in /etc/conf.d/net is used.

the important part in the /etc/conf.d/net looks like this:

# For setting the default gateway

#

gateway="eth0/192.168.6.1"

gateway="eth1/192.168.7.1"

am i doing something terribly wrong or is this a bug? :>

thanks for your replies.

----------

## crafteh

Is there any way to set it to connect to the AP with the strongest signal? I'm trying to connect to my schools network and it sees 5-6 access points. The one it connects to though, it gets signal quality of like 10/90, even though I'm right next to it.. then it cuts out. Maybe you could incorporate that into the next build?

----------

## teedog

 *UberLord wrote:*   

> Fixes problems with space in ESSID

 

I confirm that space in ESSID works again.  Thanks!

There is still the strange behavior where the script tries to connect to found Access Points before trying the preferred ESSIDs.  That was not the case in earlier versions.

----------

## Zebbeman

 *UberLord wrote:*   

> You could always try using ndiswrapper and the windows driver

 

Thanks! I'm up and running  :Smile: 

Seb

----------

## UberLord

 *teedog wrote:*   

> There is still the strange behavior where the script tries to connect to found Access Points before trying the preferred ESSIDs.  That was not the case in earlier versions.

 

It will try to connect to any preferred AP's it finds

Then it tries to connect to any AP's found but not in the preferred list

Then it tires to forcably connect to preferred AP's that it didn't find incase they are hidden.

This should have always been the case - even with the 0.4.x scripts and earlier.

If you wish, I can put an option in to force preferred over found

----------

## teedog

 *UberLord wrote:*   

> It will try to connect to any preferred AP's it finds
> 
> Then it tries to connect to any AP's found but not in the preferred list
> 
> Then it tires to forcably connect to preferred AP's that it didn't find incase they are hidden.
> ...

 

That's strange.  I never noticed the script trying to connect to found AP's (5 of them today) not in the preferred list before.  Perhaps a lot of new AP's were installed at my location.  :Razz: 

If you don't mind, I think an option for the following sequence would be nice:

1. Found AP's that are broadcasting the preferred ESSID or have preferred MAC addresses.

2. Force preferred ESSIDs in case they're hidden.

3. Found AP's that are not preferred.

I think this sequence makes sense since connecting to unknown or non-preferred AP's is probably the least desirable if there are any preferred ESSID's or AP's to connect to.

----------

## UberLord

 *stingray wrote:*   

> 
> 
> looks for me like the default gateway doesn't get set. the eth1-script works without problems (sets gateway). i figured out that only the last gateway="ethX/...."-line in /etc/conf.d/net is used.
> 
> the important part in the /etc/conf.d/net looks like this:
> ...

 

You're not doing anything wrong as such - just that only interface can have a gateway and as eth1 is last in the list then it takes precedence.

This is not a bug (and besides, thats Gentoo net.eth0 script, not my wireless)

----------

## UberLord

 *crafteh wrote:*   

> Is there any way to set it to connect to the AP with the strongest signal? I'm trying to connect to my schools network and it sees 5-6 access points. The one it connects to though, it gets signal quality of like 10/90, even though I'm right next to it.. then it cuts out. Maybe you could incorporate that into the next build?

 

I can do that. However, it will only work for Acess Points it finds

----------

## stingray

 *UberLord wrote:*   

>  *stingray wrote:*   
> 
> looks for me like the default gateway doesn't get set. the eth1-script works without problems (sets gateway). i figured out that only the last gateway="ethX/...."-line in /etc/conf.d/net is used.
> 
> the important part in the /etc/conf.d/net looks like this:
> ...

 

hm, i dont get it. anyway, obviously i need to set a default gateway everytime i start an eth-interface. how did you solve this?  :Sad: 

----------

## Tyger

 *stingray wrote:*   

> 
> 
> [...]
> 
> my setup is an ethernet adapter at eth0 and a wireless adapter at eth1. everytime i run
> ...

 

You can have only one default gateway _per system_ (Actually, with /sbin/route you can set as many default gw as you like, but they are non functional). The default gateway does something like: "if no other routing rule matches, use this device"

Type 'ip route' or 'route' to show your routing table (ip is part of iproute2). It should show something like

```

192.168.6.0/24 dev eth0  proto kernel  scope link  src 192.168.6.20

192.168.7.0/24 dev eth1  proto kernel  scope link  src 192.168.7.21

127.0.0.0/8 via 127.0.0.1 dev lo  scope link

default via 192.168.7.1 dev eth1

```

The first two lines are brought up automagically by my kernel/ifconfig tool and state rules to route all packets to address 192.168.6.x via dev eth0 and all packets to 192.168.7.x via dev eth1. Packets to 127.x.x.x are routed to localhost. Any packet left (those to the internet) will be routed via the default gateway.

You can give additional routes using 

```

routes_eth0 = "..."

routes_eth1="..."

```

in /et	c/conf.d/net or routes_ESSID in /etc/conf.d/wireless.

You can test your routes with

```

ip route get <ip-address>

```

This will show the device the request will take.

Have a look at the Networking Howtos at www.tldp.org to learn more about routing.

----------

## ZZamboni

UberLord,

Thanks for the scripts and the ebuild - it works beautifully! I only had to fix a typo in wireless_associate_pre(), as per the following patch:

```

--- wireless.sh.orig    2004-07-27 10:38:29.216451316 +0200

+++ wireless.sh 2004-07-27 10:38:33.353603047 +0200

@@ -258,8 +258,8 @@

        ebegin "  Running an assocation setup script for \"${d}\""

        ${s} || r=$?

-       eend r

-       return r

+       eend $r

+       return $r

 }

 # bool wireless_associate(char *interface, char *essid, char *wep_required)

```

It seems that the built-in mini-PCI Cisco interface on my T30 does not support scanning before LEAP authentication is complete, but I have set the first ESSID in prefered_aps to the one that needs LEAP auth, so it's the default one when the scanning fails.

----------

## UberLord

Thanks for the patch! It's going in the next version.

I'm not sure about how LEAP really works. If it's specific to the card, then you can run your LEAP script before wireless in preup in /etc/conf.d/net

If it's specific to the AP then it needs to be where it is.

Could you let me know as if it's the fomer then I can remove the pre-associate script bit from my code!

----------

## ZZamboni

 *UberLord wrote:*   

> I'm not sure about how LEAP really works.
> 
> ...
> 
> If it's specific to the AP then it needs to be where it is.
> ...

 

It is specific to the AP. In my case, I need LEAP at work, but WEP at home, so the pre-associate script needs to be run after scanning for APs. I think it's OK where it is. In my laptop the scan cannot be performed in the LEAP network (the scan fails), but I have a colleague with a different network card for whom the scan works correctly, and it identifies the network for which LEAP authentication is needed.

As an aside, here's a script I wrote for automatically detecting when a network cable is connected, and switch to the wired or wireless interface accordingly. It uses mii-tool (part of the net-tools package), and it is still a little bit crude, but it works. Now I can finally have a system that automatically configures itself to the network!

```

#!/bin/sh

# Automatically switch from wired to wireless network, by detecting

# if a cable is connected, using mii-tool.

# Usage: set the names of WIRED and WIRELESS accordingly, then run

# the script.

# ZZamboni, Jul 2004

WIRED=eth0

WIRELESS=eth1

PERIOD=2

VERBOSE=1

. /sbin/functions.sh

# silently check if an interface is active

active() {

        /etc/init.d/net.${1} --quiet status

}

# enable and disable interfaces. We use pause instead of stop

# to avoid stopping dependent services

enable() {

        /etc/init.d/net.${1} start

}

disable() {

        /etc/init.d/net.${1} pause

}

# switch from one interface to the other

switch_if() {

        FROM=$1

        TO=$2

        DESC=$3

        if ! active $TO; then

                [[ -n "$VERBOSE" ]] && einfo "Switching to$DESC interface $TO"

                enable $TO

        fi

        if active $FROM; then

                disable $FROM

        fi

}

# main loop

while /bin/true; do

        L=`/sbin/mii-tool ${WIRED}`

        if expr "$L" : ".*no link" >/dev/null; then

                switch_if ${WIRED} ${WIRELESS} " wireless"

        else

                switch_if ${WIRELESS} ${WIRED} " wired"

        fi

        sleep ${PERIOD}

done

```

----------

## UberLord

Would it hurt to run LEAP on non-LEAP capable AP's? ie, would they be picked up and allowed to associate?

----------

## ZZamboni

 *UberLord wrote:*   

> Would it hurt to run LEAP on non-LEAP capable AP's? ie, would they be picked up and allowed to associate?

 

I believe it would not hurt, but the authentication will fail, so if the exit code of the script is checked before proceeding, it would not allow the rest of the set up to proceed.

I'll double-check tonight at home.

----------

## UberLord

 *ZZamboni wrote:*   

>  *UberLord wrote:*   Would it hurt to run LEAP on non-LEAP capable AP's? ie, would they be picked up and allowed to associate? 
> 
> I believe it would not hurt, but the authentication will fail, so if the exit code of the script is checked before proceeding, it would not allow the rest of the set up to proceed.
> 
> I'll double-check tonight at home.

 

That would be cool.

By moving the code into th preup function in conf.d/net you can handle the return yourself, choosing to fail the preup or not. Obviously you would have to insert it berfore the wireless_up line.

That would be of great benefit as I can remove LEAP stuff from my code as I'm not overly happy running an external script. The only reason it was in there was because my origonal work was a direct replacement for net.eth0 instead of a plugin which it is now. If I can remove it then it becomes much cleaner.

----------

## crafteh

 *UberLord wrote:*   

>  *crafteh wrote:*   Is there any way to set it to connect to the AP with the strongest signal? I'm trying to connect to my schools network and it sees 5-6 access points. The one it connects to though, it gets signal quality of like 10/90, even though I'm right next to it.. then it cuts out. Maybe you could incorporate that into the next build? 
> 
> I can do that. However, it will only work for Acess Points it finds

 

That'd be sweet! Would it be very difficult to do? Without that, the wireless doesn't work too well for me D:

----------

## UberLord

 *crafteh wrote:*   

> That'd be sweet! Would it be very difficult to do? Without that, the wireless doesn't work too well for me D:

 

It's already done - it sorts by that quality number reported by iwlist $iface scan

If you want to beta test it, you can blag it from http://rsm.demon.co.uk/~roy/downloads/wireless-config-0.5.3/wireless.sh

However, I need feedback from a few users with other issues before I release a new version. Regardless, a new version with this feature will be released on Friday at the latest.

----------

## teedog

Hi UberLord,

Just wanted to report this small problem with the latest version:

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

 * Running preup function

 *   Configuring wireless network for wlan0

 *   Scanning for access points

 *     Found 01:23:01:23:01:23

 *     Found

 *     Found

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

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

 *   Trying to force preferred incase they are hidden

 *   Connecting to "my wireless" (WEP Disabled)...        [ ok ]

 *     wlan0 connected to "my wireless" in managed mode

 *     on channel 01 (WEP disabled)

 * Bringing wlan0 up via DHCP...                          [ ok ]

 *   wlan0 received address 123.123.123.123
```

Notice the second and third found AP's appear to have no MAC address.  The script also connects to "" because, I presume, those found AP's are not broadcasting their ESSID.  Are there any cases when connecting to "" would work?  Could you add an option to not connect to AP's that are not broadcasting the ESSID?

Also, although 3 AP's are found, it only seems to connect to 2 of them.

The only thing I edited in /etc/conf.d/wireless is "preferred_aps" so I don't think there's anything wrong with my config.

Thanks again.

----------

## UberLord

Thats weird.

Could you try the beta version above (re-download it if you already got it)

and try that. Post the output of it and the contents of

```
ifconfig wlan0 up

iwlist wlan0 scan
```

If you don't want to post mac addys' then please PM me the exact output.

Thanks

----------

## teedog

UberLord, PM with outputs sent.

----------

## stingray

 *Tyger wrote:*   

> Have a look at the Networking Howtos at www.tldp.org to learn more about routing.

 

did i mention that i only use one interface at a time? :> either eth0 (wire) or eth1 (wlan). they access the same router via a different subnet (ethernet/192.168.6.0, wlan/192.168.7.0).  i plan on using ifplugd for this. i guess with this in mind my prior posts about having a different default gw for both interfaces make much more sense.

----------

## teedog

Hi UberLord,

I'm still having problems with WEP using your latest wireless.sh.

If I put

```
key_myessid="1234-1234-1234-1234-1234-1234-56 enc open"
```

in /etc/conf.d/wireless (where 1234 etc is replaced with my key), I get:

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

 * Running preup function

 *   Configuring wireless network for wlan0

 *   Scanning for access points

 *     Found "myessid" at 00:0A:25:47:4D:8G (WEP required)

 *     Found "myessid" at 00:02:73:86:N4:9E (WEP required)

 *   Connecting to "myessid" (WEP enabled)...     [ ok ]

 *     wlan0 connected to "myessid" in managed mode

 *     on channel 06 (WEP disabled)

 * Bringing wlan0 up via DHCP...              [ !! ]
```

If I put

```
key_myessid="1234-1234-1234-1234-1234-1234-56"
```

in /etc/conf.d/wireless (where 1234 etc is replaced with my key), I get:

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

 * Running preup function

 *   Configuring wireless network for wlan0

 *   Scanning for access points

 *     Found "myessid" at 00:0A:25:47:4D:8G (WEP required)

 *     Found "myessid" at 00:02:73:86:N4:9E (WEP required)

 *   Connecting to "myessid" (WEP enabled)...       [ !! ]

 *   Failed to associate with any preferred access points on wlan0

 * Couldn't associate with any access points on wlan0

 * Failed to configure wireless for wlan0

 * preup wlan0 failed
```

Any ideas?

----------

## UberLord

 *stingray wrote:*   

>  *Tyger wrote:*   Have a look at the Networking Howtos at www.tldp.org to learn more about routing. 
> 
> did i mention that i only use one interface at a time? :> either eth0 (wire) or eth1 (wlan). they access the same router via a different subnet (ethernet/192.168.6.0, wlan/192.168.7.0).  i plan on using ifplugd for this. i guess with this in mind my prior posts about having a different default gw for both interfaces make much more sense.

 

Well, you could move one of the gateways to gateway_ESSID so that whichever iface comes up last takes precedence  :Smile: 

----------

## UberLord

 *teedog wrote:*   

> I'm still having problems with WEP using your latest wireless.sh.
> 
> Any ideas?

 

I find it odd that many people have problems with WEP and the new 0.5.x script.

Find an old script that works - the entire 0.4.x series is available from http://rsm.demon.co.uk/~roy/downloads

Then I may be able to fix it.

BTW, WEP has always worked for me - every AP I use has WEP. Not that it does you much good, just pointing out that it does work.

----------

## UberLord

NEW EBUILD POSTED

Fixed problems with removing Access Points found from arrays (thanks ZZamboni)

Fixed an error with the preassociate script routine

Fixed duplicate ESSIDs being found (difference MAC addresses) and trying to connect to the same ESSID numerous times

New features

Access Points found are sorted by quality (highest first)

Blacklists have been implemented (blacklist_aps= blacklist_aps_eth0=)

Unique Access Point - basically if you have two or more wifi cards then this stops them associating with the same Access Point

Blacklists and Unique AP only work with scanning - if you hard code an ESSID (including "ANY") or your card does not support scanning then they will not work.

Many, many thanks to CB2206 and teedog for doing some serious beta testing for me  :Smile: 

----------

## UberLord

NEW EBUILD POSTED

2 in one day! lol

New feature

Master mode is now supported

Bug fixed

iwconfig_eth0 and iwpriv_eth0 are only applied after wireless has been configured but before the report shows

This fixes an error when "rate 54M" was requested and it fails for some reason

Config Change

adhoc_channel_eth0 has been changed to channel_eth0 to reflect it's use for master mode as well

----------

## stingray

 *UberLord wrote:*   

> 
> 
> Well, you could move one of the gateways to gateway_ESSID so that whichever iface comes up last takes precedence 

 

sounds good, but it doesn't seem to work.  :Smile:  i added the line

gateway_myessid="192.168.7.1"

to my /etc/conf.d/wireless but whenever i run the net.eth1 script no gw is set. looks like the gateway_essid-flag is not yet implemented.

----------

## UberLord

 *stingray wrote:*   

>  *UberLord wrote:*   
> 
> Well, you could move one of the gateways to gateway_ESSID so that whichever iface comes up last takes precedence  
> 
> sounds good, but it doesn't seem to work.  i added the line
> ...

 

You're correct!

----------

## UberLord

NEW EBUILD POSTED

Fixed

gateway_ESSID works again

But really guys, that variable has been depreciated. You should be using

```

ifconfig_eth0=( "192.168.0.1 broadcast 192.168.0.255 netmask 255.255.255.0" )

routes_eth0=( "default gw 192.168.0.2" )

```

to get the same thing

Of course, you can change eth0 to ESSID for wireless  :Wink: 

----------

## stingray

thanks a lot UberLord, this really solved my problem.  :Very Happy: 

----------

## UberLord

Just a quick note to say that I've updated the ebuild so that postdown is used instead of the predown function - this is to give DHCP a chance to release it's IP and a few other things.

The actual wireless script has not changed.

----------

## mattjackets

Hi all, I'm new to gentoo so if i missed something obvious just let me know...

I've installed wireless-config on top of my already working wireless setup which involves:

wlan-ng and a prism3 usb nic.

/etc/init.d/wlan is started at "BOOT" runlevel

when I run /etc/init.d/net.wlan0 start I get the following error:

```
 * Running preup function

 *   Configuring wireless network for wlan0

/sbin/runscript.sh: line 759: error: command not found

 * Failed to configure wireless for wlan0
```

after looking into /sbin/runscript.sh i found that there are only 538 lines in the file!!

what's going on here?  and is running '/etc/init.d/net.wlan0 start' the proper way to startup all these fancy wireless settings?

thanks,

+matt

----------

## UberLord

 *mattjackets wrote:*   

> Hi all, I'm new to gentoo so if i missed something obvious just let me know...
> 
> I've installed wireless-config on top of my already working wireless setup which involves:
> 
> wlan-ng and a prism3 usb nic.

 

Sorry mattjackets, but this script does not work with linux-wlan-ng as of yet. I understand the developers are making it so that it works with the wireless-tools package which is what my script uses and which every other driver out there uses.

I also have no plans to make it linux-wlan-ng compatible.

----------

## mattjackets

 *Quote:*   

> Sorry mattjackets, but this script does not work with linux-wlan-ng as of yet. I understand the developers are making it so that it works with the wireless-tools package which is what my script uses and which every other driver out there uses.
> 
> I also have no plans to make it linux-wlan-ng compatible.

 

 :Sad:    that makes me sad...

what is it about wlan-ng that makes you not want to support it?

Basically all I need to do is be able to run a script when the driver detects my network.  If i can get to that point, I can slap something together to suit my needs.  Do you know of any good resources I should look into to reach this goal?

Thanks anyway...your wireless-config looks like a nearly ideal solution to many people's problems...keep up the good work (and p-p-p-please think about supporting wlan-ng in the future:)

+matt

----------

## UberLord

 *mattjackets wrote:*   

> what is it about wlan-ng that makes you not want to support it?

 

Simply because wireless-tools is used by every other wireless driver. And I don't have any hardware myself that can be used by linux-wlan-ng - which makes it kinda hard for me to support it

 *Quote:*   

> 
> 
> Basically all I need to do is be able to run a script when the driver detects my network.  If i can get to that point, I can slap something together to suit my needs.  Do you know of any good resources I should look into to reach this goal?

 

waproamd (in portage) does a similar thing to my script - it's just not as flexable

If you're a programmer - even a beginner - it should be relatively staight forward to port my script to linux-wlan-ng provided linux-wlan-ng supports the features I need

 *Quote:*   

> 
> 
> Thanks anyway...your wireless-config looks like a nearly ideal solution to many people's problems...keep up the good work (and p-p-p-please think about supporting wlan-ng in the future:)
> 
> +matt

 

My script will support linux-wlan-ng when the linux-wlan-ng developers make it compatible with wireless-tools - which they are workin on. Maybe you should ask the linux-wlan-ng developers  :Wink: 

----------

## mikecore

I am trying to get my wirless network card working. 

I have a HP pavilion zv5034us with a Broadcom Corp BCM94306 802.11g card.

I followed the "ndiswrapper guide" to use the windows driver for this card"

I downloaded the driver from HP I am using the bcmwl5a.inf bcmwl5.sys files

I am able to see that my card is up using dmesg. and my LED on my quick

lanuch button for my laptop is now lit. I am also able "iwlist wlan0 scan"

and find my AP.

but I still can't get a IP from my router. when I try "/etc/init.d/net.wlan0"

it fails.

I think my problem now is I just don't know what I'm doing Mean I don't 

know how to bring up my card correctly.

I understand you have a startup scrip for this but your using eth1 for the wirless card and the guide i followed had me set it up for wlan0 

can i still use your scrip as is or do i need to rename something ?

----------

## CB2206

i have the same broadcom card working fine here.

first of all you have to make a symlink from /etc/init.d/net.eth0 to /etc/init.d/net.wlan0. then install wireless-config and edit /etc/conf.d/wireless to your needs. (the description of the possible config options is very good, just read it.)

then "/etc/init.d/net.eth0 start" should do make your card connect to the ap.

when you have problems connecting to one specific access point then try disabling dhcp first and set ip, gateway etc manually with the options in /etc/conf.d/wireless (after you are sure that the rest is set up ok). i have a problem using dhcp with ndiswrapper+broadcom card with one specific ap i'm sometimes connecting to.

hopefully this helps you a little bit.

----------

## DamianHole

I have a similar problem micmac had back on page 27. Every second reboot, dhcp fails to get an IP because dhcpcd is already running. This is the error I receive:

```

 * Running preup function

 *   Configuring wireless network for wlan0

 *   Scanning for access points

 *     Found "blackhole" at XX:XX:XX:XX:XX:XX (WEP required)

 *   Connecting to "blackhole" (WEP enabled)...

 *     wlan0 connected to "blackhole" in managed mode

 *     on channel 06 (WEP enabled)

 * Bringing wlan0 up via DHCP...

****  /sbin/dhcpcd: already running

****  /sbin/dhcpcd: if not then delete /var/run/dhcpcd-wlan0.pid file

```

And the error isn't lying, dhcpcd really is running. And it is exactly every second reboot.

Every time I boot up, a bit higher on my screen, if things work ok, this is what I see:

```

 * Running predown function

 *   Removing wireless configuration from wlan0...

 * Bringing wlan0 down

 *   Stopping wlan0...

```

If things don't work, and I receive the error message as mentioned in the first code block, the line "Stopping wlan0..." doesn't show up in the second code block. But the other three lines do.

btw, that second code block shows up whether or not I have net.wlan0 run at start up.

I'm running on a Dell D600 laptop, and I'm running baselayout-1.9.4-r3 and wireless-config-0.5.5.

Thanks,

Damian.

----------

## affan

I get the message 

```

* Running preup function

 *   Wireless extensions not found for eth0

```

Which is true because my eth0 is the network card, and wlan0 is the wireless card. I want it to use wlan0 for wireless. I have both the ethernet cable as well as the wireless link from my D-Link DI 514 router to my Dell Inspiron 8600 using Dell TrueMobile wireless card (which is basically the broadcom chipset I think?).

 *CB2206 wrote:*   

> 
> 
> first of all you have to make a symlink from /etc/init.d/net.eth0 to /etc/init.d/net.wlan0.
> 
> 

 

Do I really have to do this? I already have an interface wlan0 after I installed wireless-tools (but no file in /etc/init.d/net.wlan0). I can do "iwconfig" and it shows wlan0, so does ifconfig after I do "ifconfig wlan0 up". Anyways I have tried it both ways (creating and deleting the symlink and get the same error message)

 *CB2206 wrote:*   

> 
> 
> then install wireless-config and edit /etc/conf.d/wireless to your needs. (the description of the possible config options is very good, just read it.)
> 
> 

 

The config file tells me to specify the key but I dont have one configured for my router. How do I specify that for my router?

I have specified only the following properties in the /etc/conf.d/wireless file: 

```
mode_wlan0="Managed"

adhoc_essid_wlan0="mywireless"

channel_wlan0="6"

```

BTW it used to work fine before I installed wireless-config but I had to do "ifconfig wlan0 up" and "dhcpcd wlan0" every time. So it means the set up is fine, just some configuration fix is needed. 

Thanks for any clues.

----------

## CB2206

this is what i did to get the truemobile 1300 wlan card (broadcom chipset) on an inspiron 8600 working:

1. install & configure ndiswrapper so that iwconfig shows the card

2. create an init skript for this card using net.eth0:

```

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

```

(change net.wlan0 to your wlan device)

3. install wireless-config exactly how it is told in the first post in this thread (especially follow the instructions which are shown by the ebuild at the end of the emerge process!)

3b. when you have baselayout>= 1.10 installed you have to change the preup and predown functions in /etc/conf.d/net yourself. here are mine:

```

source /etc/init.d/wireless.sh

preup() {

        # Test for link on the interface prior to bringing it up.  This

        # only works on some network adapters and requires the ethtool

        # package to be installed.

#       if ethtool $1 | grep -q 'Link detected: no'; then

#               ewarn "No link on $1, aborting configuration"

#               return 1

#       fi

        wireless_up ${1}

        return $?

        # Remember to return 0 on success

#       return 0

}

predown() {

        # Test to make sure the root filesystem is not mounted via NFS.

        # Interface ($1) is ignored but could also be tested if you know

        # what interface is providing NFS root.

        if grep -q ' / nfs' /proc/mounts; then

                ewarn "Root is NFS mounted, aborting deconfiguration of $1"

                return 1

        fi

        wireless_down ${1}

        return $?

        # Remember to return 0 on success

#       return 0

}

```

4. edit /etc/conf.d/wireless. a simple config could look like this (change YOUR_ESSID to your wlan network name (= essid)):

```

key_YOUR_ESSID="s:foobar enc open"

preferred_aps=( "YOUR_ESSID" )

```

foobar in this case would be your wep key. change this to the one you set in your access point config. (leave "s:" when want to use the hex value of the key)

this is working here without problems. when you have not enabled encryption in your access point then comment out the key line. (but you should really enable encryption using the web-admin-interface of your ap (how this works? rtfm of your ap!  :Wink: )

another thing is, that your card have to support scanning. ndiswrapper does! (at least with the truemobile 1300 card) when your card is not able to scan put

```

essid_DEV="YOUR_ESSID"

```

in /etc/conf.d/wireless. (change DEV to your wlan device; for ndiswrapper this is probably wlan0)

5. set your ip etc in /etc/conf.d/net; for dhcp use this:

```

#new style used in baselayout>=1.10 

ifconfig_DEV=( "dhcp" )

#old style

iface_DEV=( "dhcp" )

```

only choose one method!  :Wink: 

6. execute 

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

 and you should be connected to your wlan. (well, i'm gonna get connected when doing this with this config  :Wink: )

when dhcp does not work:

1. check your wlan settings (essid, key, etc.)

2. try setting your ip manually using ifconfig and then try to ping your ap. when this works: 

check whether you really have activated dhcp server functionality in your ap and set an higher timeout for dhcp in /etc/conf.d/net using dhcpcd_DEV="-t secs" (15 should be ok)

when it isnt working after all and you did everything right, there seems to be some incompatibility between your wlan card and your ap.

----------

## affan

It works now!! Thanks a lot for the great mini how-to... 

I think my mistake was I was doing /etc/init.d/eth0 restart instead of "wlan0" but it may have been something else.... 

Affan

----------

## mikecore

 *CB2206 wrote:*   

> i have the same broadcom card working fine here.
> 
> first of all you have to make a symlink from /etc/init.d/net.eth0 to /etc/init.d/net.wlan0. then install wireless-config and edit /etc/conf.d/wireless to your needs. (the description of the possible config options is very good, just read it.)
> 
> then "/etc/init.d/net.eth0 start" should do make your card connect to the ap.
> ...

 

thanks for the reply I will try that

----------

## maxheadroom

 *DamianHole wrote:*   

> I have a similar problem micmac had back on page 27. Every second reboot, dhcp fails to get an IP because dhcpcd is already running. This is the error I receive:
> 
> ```
> 
>  * Running preup function
> ...

 

Not wanting to make a "me too" post, bur, err, me too  :Wink:  Except for me it happens on every boot. The problem first appeared a while ago after a baselayout upgrade.

If I manually kill dhcpcd and then run rc again (as root) then everything works properly.  It seems like something in the new RC scripts is assigning an IP address to the card through DHCP (or trying to and failing) before net.eth1 is running.

----------

## mikecore

I followed the guide to install the wireless scrip but its still not working

when it starts up this is what i get

/etc/init.d/net.eth0 start

 * Running preup function

 *   Wireless extensions not found for eth0

then if i try to start /etc/init.d/net.wlan0 start i get 

 * Running preup function

 *   Configuring wireless network for wlan0

 *   Scanning for access points

 *     Found "homey" at 00:0F:66:8D:F7:8A

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

 * Couldn't associate with any access points on wlan0

 * Failed to configure wireless for wlan0

 *

----------

## CB2206

are you sure you are not using wep?

are you able to configure your card manually using iwconfig?

----------

## mikecore

I am sure that WEP is not on!

the wierd thing is I can see my AP and I have an IP but I can't Comm through it.

I notice an Dmesg that says Disabling IRQ5 and when I do a iwconfig 

it syas interup 5 is this a problem ?

----------

## brady

Just a tip (which may have already been mentioned, I didn't look):

There is a postdown hook available so you can remove your wireless card modules when your interface is turned off. This is nice, b/c it makes sure the radio is off.

Something like this (in /etc/conf.d/net) should do the trick:

```

postdown() {

        rmmod airport

        rmmod orinoco

        rmmod hermes

}

```

This corresponds to my ibook.

Cheers.

----------

## CB2206

 *mikecore wrote:*   

> I am sure that WEP is not on!
> 
> the wierd thing is I can see my AP and I have an IP but I can't Comm through it.
> 
> I notice an Dmesg that says Disabling IRQ5 and when I do a iwconfig 
> ...

 

mh...sorry, i'm not sure whether this has something to do with it.

what about an firewall blocking traffic?

----------

## nomad-

I wrote a patch for wireless-config's rc scripts to load adn unload the interface's kernel module when the interface is brought up and down. It's useful for saving the battery of your laptop. The interface can be specified in /etc/conf.d/wireless

http://onda.zvuk.net/r51/wireless-config-module-support.diff

To apply, do:

```
cd /etc

wget -qO - http://onda.zvuk.net/r51/wireless-config-module-support.diff | patch -p1

```

Hope that helps  :Smile: 

----------

## UberLord

Nice patch nomad - however I'm not going to put it in .....

Removing network card modules isn't really the job of the wireless script - instead it should be the job of the net.eth0 script or something else as it could easily apply to hardwired NICs as well. Or usb stuff for that matter!

Instead, you could submitt it to bugs.gentoo.org as an addition to /etc/conf.d/net to load/unload NIC modules. The current conf.d/net has loads of example stuff todo with the pre() post() functions and I'm sure your work will fit right in there  :Smile: 

Care to right a patch for WPA support and it will go into my wireless script   :Cool: 

----------

## tursiops

Hi all!

I want to make my wireless onboard work, I strictly have no clue about it. 

I read some of your messages but it seems that you're talking about wireless pcmcia cards only. How can I know what is my wireless onboard so I can install and configure the good driver?

Thanks!

----------

## UberLord

 *mikecore wrote:*   

> I followed the guide to install the wireless scrip but its still not working
> 
> when it starts up this is what i get
> 
> /etc/init.d/net.eth0 start
> ...

 

Try using this setting in /etc/conf.d/wireless

```
associate_test_wlan0="quality"
```

----------

## UberLord

 *tursiops wrote:*   

> Hi all!
> 
> I want to make my wireless onboard work, I strictly have no clue about it. 
> 
> I read some of your messages but it seems that you're talking about wireless pcmcia cards only. How can I know what is my wireless onboard so I can install and configure the good driver?
> ...

 

Use lspci (part of pci-utils iirc) to find out what chipset your wireless has.

If not, try and find it by looking at the hardware specs of your motherboard.

----------

## DamianHole

 *maxheadroom wrote:*   

> Not wanting to make a "me too" post, bur, err, me too  Except for me it happens on every boot. The problem first appeared a while ago after a baselayout upgrade.
> 
> If I manually kill dhcpcd and then run rc again (as root) then everything works properly.  It seems like something in the new RC scripts is assigning an IP address to the card through DHCP (or trying to and failing) before net.eth1 is running.

 

Hey maxheadroom,

I just did a really, really, really dodgy workaround to our problem. Please don't tell anybody about it, I'm very ashamed for doing it.

My preup function in /etc/conf.d/net now looks like this:

```
preup() {

        if [ -f /var/run/dhcpcd-${1}.pid ]; then

                kill `cat /var/run/dhcpcd-${1}.pid`

        fi

        wireless_up ${1}

        return $?

}

```

I've been playing around with the kernel heaps lately, and it was getting annoying, needing to manually kill dhcpcd, and run the init script, after every second reboot.

It works, but it's dodgy ... please don't try this at home folks. I don't know what bad stuff will happen because of this.

Damian.

----------

## UberLord

For those with DHCP problems, check your conf.d/net file.

If the call to wireless_down is in predown(), try renaming it to postdown().

I'm not sure if it will help, but it may do.

----------

## enobis

First let me start by saying "Thank you UberLord for an awesome script!"

I have a NetGear WG511 card and NetGear WG602 Wireless Access Point.  I recently got everything up and running (pretty painless - thanks again), so I started playing around with security settings so that I wasn't using the default.

First thing I did was change the (E)SSID to something other than the default - worked fine, and then disabled the SSID from being broadcasted from the AP.  I then modified /etc/conf.d/wireless so that I had the changed, nonbroadcasted, SSID in the file.  Added the following to the end of the file:

```
preferred_aps=( "MY_NEW_ESSID" )
```

restarted the service for the card and everything was running nicely - no probs...

However, as I started accessing the network I noticed things were slow, very slow.  In fact the bit rate was between 1 and 12 Mbps as reported by iwconfig, with lots of fluctuation, but here's the annoying thing.  When I enable braodcasting of the ESSID on the AP and restart the service iwconfig reports a bit rate of between 36 - 54 Mbps, with very little fluctuation.

The laptop is ~30ft from the AP and not in the direct line of site.  Has anyone else experienced this?  Am I missing a configuration setting in the config file?

Thanks...

----------

## UberLord

 *enobis wrote:*   

> 
> 
> However, as I started accessing the network I noticed things were slow, very slow.  In fact the bit rate was between 1 and 12 Mbps as reported by iwconfig, with lots of fluctuation, but here's the annoying thing.  When I enable braodcasting of the ESSID on the AP and restart the service iwconfig reports a bit rate of between 36 - 54 Mbps, with very little fluctuation.
> 
> The laptop is ~30ft from the AP and not in the direct line of site.  Has anyone else experienced this?  Am I missing a configuration setting in the config file?
> ...

 

The only thing I can think of is to hardcode the ESSID to the MAC address of the AP.

```
essid_001122334455="MY_NEW_ESSID"
```

where 001122334455 is your AP's MAC address.

Failing that, I'm guessing it's a problem with driver/firmware/hardware. It may also be just a "feature" of hiding ESSID. I do notice that people on the DrayTek (wireless router) forums that hide ESSID suffer more from wireless problems than those that don't

----------

## kamagurka

i am heavy trouble having getting this to work, and it's making me mad because it forces me to use win2k whenever i want to move around (which is actually kinda the point why i have this lappy, anyways).

anyway:

i have one of those intel centrino cards and i'm trying to connect to an SMC Barricade g WLAN router. i am not succeeding. it's not because of the encryption (although i'm sure i'll run into problems there, too) because the same happens with security settings turned off altogether.

anyway, here's what happens:

```
└─# /etc/init.d/net.wlan0 start

 * Running preup function

 *   Configuring wireless network for wlan0

 *   Connecting to "SMC" (WEP enabled)...                                                                             [ !! ]

 * Failed to configure wireless for wlan0

 * preup wlan0 failed
```

these are all the parts of /etc/conf.d/wireless i commented out:

```
essid_wlan0="SMC"

key_SMC="s:xxxxxxxxxxxxx enc open"

preferred_aps=( "SMC" )
```

the ESSID (or "SSID", as my router seems to call it) is, for the moment, set to SMC. maybe i'm making a really dumb mistake here, but i'm really not that good at networking; any help is appreciated.

EDIT: anywayy, i think i'm using a certain word a bit too often here. can you spot it?

----------

## jfave

got it working on my promix card.. thanks man! my fix was to reboot... i also downloaded the wireless and wireless.sh files from your site.. dont know if it was a coincidence or not.. laptop lost power, and came up working!

----------

## Freejack00

Can someone point me in the direction of some documentation. Everything I click on leads to this thread. To someone wanting to install (with the changes and differences) reading this makes it reall hard to follow. I got mine up but everytime I reboot I have to manually enter all this.

----------

## markfl

 *Freejack00 wrote:*   

> Can someone point me in the direction of some documentation. Everything I click on leads to this thread. To someone wanting to install (with the changes and differences) reading this makes it reall hard to follow. I got mine up but everytime I reboot I have to manually enter all this.

 

Documentation for what?

I'm presuming you've installed gentoo (if not then use the install guide)

To get your wireless working:

```
emerge wireless-tools
```

Find out which driver your card uses (google for "<model number> linux" will usually help)

Compile this driver into the kernel along with wireless support.

This should get you to the state where you can get the wireless working using iwconfig/ifconfig commands. That is where wireless-config comes in.

Follow the instructions in the first post (its updated each new version) to get it installed. Edit the config file at /etc/conf.d/wireless and make sure that you follow the instructions displayed after the ebuild has finished.

If you need any more specific help then post again.

Mark

----------

## UberLord

 *kamagurka wrote:*   

> 
> 
> i have one of those intel centrino cards and i'm trying to connect to an SMC Barricade g WLAN router. i am not succeeding. it's not because of the encryption (although i'm sure i'll run into problems there, too) because the same happens with security settings turned off altogether.
> 
> 

 

Try using associate_test_wlan0="quality"

----------

## tursiops

I found what my inboard wireless card is:

Intel Corp, Pro / Wireless 2200BG (rev 05)

Now what driver must I use pls?

Thanks!

----------

## Tyger

Have a look at http://ipw2200.sourceforge.net/

Cya

----------

## maxheadroom

 *UberLord wrote:*   

> For those with DHCP problems, check your conf.d/net file.
> 
> If the call to wireless_down is in predown(), try renaming it to postdown().
> 
> I'm not sure if it will help, but it may do.

 

I changed this and it didn't have any effect on the problem.

If it would be helpful, I can give you an ssh login to this box, PM me if you're interested.

----------

## UberLord

 *maxheadroom wrote:*   

> I changed this and it didn't have any effect on the problem.
> 
> If it would be helpful, I can give you an ssh login to this box, PM me if you're interested.

 

Technically, the DHCP problem is with Gentoo's net.eth0 - my wireless is not responsible for correct DHCP operation.

Besides, there's a patch a page or two back that does solve the problem with net.eth0

----------

## kamagurka

 *UberLord wrote:*   

>  *kamagurka wrote:*   
> 
> i have one of those intel centrino cards and i'm trying to connect to an SMC Barricade g WLAN router. i am not succeeding. it's not because of the encryption (although i'm sure i'll run into problems there, too) because the same happens with security settings turned off altogether.
> 
>  
> ...

 

i assume you mean i should put it in /etc/conf.d/wireless. it has no noticeable effect.

is it a problem that i am also hardconnected to the router when i try to get the wlan up?

----------

## vitriol

I'm trying to use wireless-config to get my card up and running without much luck.  :Sad:  My card is detected by iwconfig and I set up my /etc/conf.d/wireless. However, the card simply isn't working....I see no /etc/init.d/net.ath0. I saw the faq pointed to the docs if you don't have an interface in /etc/init.d/ but I still don't understand how to get this working! Do I need to add 

```
iwconfig_ath0=( "dhcp" )
```

To /etc/conf.d/net ? I'm really confused..I tried that and rebooted but it did no good. I still don't have an /etc/init.d/net.ath0. 

```

root@obfuscated ~ # lsmod

Module                  Size  Used by

ath_pci                34748  -

ath_hal               123408  -

wlan                   54312  -

nvidia               4811892  -

```

```

root@obfuscated ~ # iwconfig

lo        no wireless extensions.

eth0      no wireless extensions.

ath0      IEEE 802.11  ESSID:"NETWORK"

          Mode:Managed  Frequency:2.452GHz  Access Point: FF:FF:FF:FF:FF:FF

          Bit Rate:1Mb/s   Tx-Power:off   Sensitivity=0/3

          Retry:off   RTS thr:off   Fragment thr:off

          Encryption key:off

          Power Management:off

          Link Quality=0/94  Signal level=-95 dBm  Noise level=-95 dBm

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

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

```

Here is my /etc/conf.d/wireless:

```

essid_ath0="any"

mode_ath0="Managed"

#adhoc_essid_eth0="WLAN"

channel_ath0="9"

iwconfig_ath0="dhcp"

#iwpriv_eth0=""

#sleep_scan_eth0="1"

#sleep_associate_eth0="5"

key_NETWORK="s:B476D9EFC3 enc open"

#key_ESSID="s:foobar enc restricted"

#ifconfig_ESSID=( "dhcp" )

#dhcpcd_ESSID="-t 5"

#inet6_ESSID=()

#routes_ESSID=()

#ifconfig_fallback_ESSID=()

# iproute-2 style setup

#ipaddr_ESSID=( "dhcp" )

#iproute_ESSID=()

#ipaddr_fallback_ESSID=()

#nameserver_ESSID="192.168.0.1"

#domain_ESSID="some.domain"

```

If whatever I've done wrong is a really dumb mistake, I'm sorry. I'm posting because after about a week I still can't figure this out for myself.

Thanks

----------

## UberLord

 *kamagurka wrote:*   

> 
> 
> i assume you mean i should put it in /etc/conf.d/wireless. it has no noticeable effect.
> 
> is it a problem that i am also hardconnected to the router when i try to get the wlan up?

 

Doubtfull.

Running any security like WPA, MAC filtering, etc on the AP?

----------

## UberLord

 *vitriol wrote:*   

> I'm trying to use wireless-config to get my card up and running without much luck.  My card is detected by iwconfig and I set up my /etc/conf.d/wireless. However, the card simply isn't working....I see no /etc/init.d/net.ath0. I saw the faq pointed to the docs if you don't have an 
> 
> interface in /etc/init.d/ but I still don't understand how to get this working!
> 
> 

 

You need to create this yourself. Luckily, it's simple

```
ln -s /etc/init.d/net.eth0 /etc/init.d/net.ath0
```

 *Quote:*   

> Here is my /etc/conf.d/wireless:

 

Here is a better version for you

```

ifconfig_ath0=( "dhcp" ) # This really belongs in /etc/conf.d/net

key_NETWORK="s:B476D9EFC3 enc open"

preferred_aps=( "NETWORK" )

```

 *Quote:*   

> 
> 
> If whatever I've done wrong is a really dumb mistake, I'm sorry. I'm posting because after about a week I still can't figure this out for myself.
> 
> 

 

Hopefully I've made things a little simpler for you  :Smile: 

----------

## vitriol

Wow! Thanks!! Works great now..well, except for WEP. It works if I disable WEP, but I'm wondering if I have the WEP key in the wrong format or something. 

```

root@obfuscated ~ # /etc/init.d/net.ath0 start

  * Running preup function

 *   Configuring wireless network for ath0

 *   Scanning for access points

 *     Found "network" at 00:0F:B3:37:EF:25 (WEP required)

 *   Trying to force preferred incase they are hidden

 *   Connecting to "NETWORK" (WEP enabled)...                           [ !! ]

 *   Failed to associate with any preferred access points on ath0

 *   WEP key is not set for "network" - not connecting

 * Couldn't associate with any access points on ath0

 * Failed to configure wireless for ath0

 * preup ath0 failed

```

Kind of odd to get an error message like that. I checked and double checked my AP and WEP is enabled.  Checked the key too, and it seems to be correct. Almost have it working!    :Cool: 

----------

## vitriol

Well, guess it was my imagination. I can't connect with or without WEP.

----------

## vitriol

I've just now noticed something strange:

the MAC address that my card sees when trying to start up is 00:0F:B3:37:EF:25

```

root@obfuscated ~ # /etc/init.d/net.ath0 start

 * Running preup function

 *   Configuring wireless network for ath0

 *   Scanning for access points

 *     Found "network" at 00:0F:B3:37:EF:25 (WEP required)

 *   Trying to force preferred incase they are hidden

 *   Connecting to "NETWORK" (WEP enabled)...                           [ !! ]

 *   Failed to associate with any preferred access points on ath0

 * Couldn't associate with any access points on ath0

 * Failed to configure wireless for ath0

 * preup ath0 failed

```

But the actual MAC is 00:0F:B3:37:EF:22. Could this be the cause of my troubles?

----------

## teedog

 *tursiops wrote:*   

> I found what my inboard wireless card is:
> 
> Intel Corp, Pro / Wireless 2200BG (rev 05)
> 
> Now what driver must I use pls?
> ...

 

Unfortunately IPW2200's native linux drivers are not functional yet.  Use Ndiswrapper and the Windows drivers.

http://ndiswrapper.sf.net/

----------

## UberLord

 *vitriol wrote:*   

> Wow! Thanks!! Works great now..well, except for WEP. It works if I disable WEP, but I'm wondering if I have the WEP key in the wrong format or something. 
> 
> ```
> 
> root@obfuscated ~ # /etc/init.d/net.ath0 start
> ...

 

ESSID is case sensitive.

NETWORK != network

The MAC address reported is the wireless MAC of the AP.

So if you have a wireless router, it will have different MAC's for ethernet ports (all of them I think) and the wireless.

----------

## vitriol

 *Quote:*   

> 
> 
> ESSID is case sensitive.
> 
> NETWORK != network
> ...

 

Thank you, I've learned quite a bit from this experience. You were, of course, right. That was the problem....now I'm having a problem that seems to pop up with alot of other wireless users:

```

* Bringing ath0 up...

 *   ath0 dhcp                                                          [ !! ]

```

I've seen in prior posts that other people with this problem were suggested to disable WEP. I did this, but I'm still getting the same results. So is the cvs version of madwifi fixing this problem for others? I made sure WEP was off and that my DHCP server is functioning. Try other channels?

----------

## eisenack

Again thanks to Uberlord for this HowTo.

Unfortunately when one encounters a problem, it has gotten a bit complex finding the answer somewhere in almost 50 pages.

Not last because the "forums.gentoo.org" search function is quite bad (no search for phrases, only for a list of words and it does not show on which of the 50 pages the search result can be found)

Perhaps I find the time to volunteer making a special homepage with all this stuff on it.

NOW MY PROBLEM:

WLAN works WITHOUT WEP, 

but DOESN'T WITH WEP.

("doesn't work" means: everything starts up, but dhcp does not receive anything and a static ip doesn't help either: no pings)

I have an Allnet ALL0192 PCMCIA WLAN card in my PowerBook 17" and I'm using kernel 2.6 (pegasos-dev-sources-2.6.7-r4).

These are my loaded modules (though I don't think this is significant to the problem):

```

# lsmod

Module                  Size  Used by

...

orinoco_cs             10728  1

orinoco                50292  1 orinoco_cs

hermes                 15264  2 orinoco_cs,orinoco

ds                     22788  3 orinoco_cs

yenta_socket           22304  1

pcmcia_core            78872  3 orinoco_cs,ds,yenta_socket

...

```

What I think is very strange, are the /var/log/messages errors:

```
Aug  4 18:50:13 lappi eth1: New link status: Disconnected (0002)

Aug  4 18:50:15 lappi eth1: New link status: Disconnected (0002)

Aug  4 18:50:16 lappi eth1: Error -110 setting multicast list.

Aug  4 18:50:16 lappi eth1: New link status: Connected (0001)

Aug  4 18:50:17 lappi eth1: Error -110 setting multicast list.

Aug  4 18:50:17 lappi eth1: Error -110 setting multicast list.

Aug  4 18:50:17 lappi eth1: New link status: Association Failed (0006)

Aug  4 18:50:19 lappi eth1: New link status: Connected (0001)

Aug  4 18:50:21 lappi dhcpcd[467]: infinite IP address lease time. Exiting

```

These errors occure WITH AND WITHOUT WEP, but as mentioned, everything (DHCP, pinging, surfing  :Smile:  ) works WITHOUT WEP but not WITH.

My questions:

- Why doesn't it work WITH WEP ? And do errors in /var/log/messages have something to do with it ?

- What is the "Error -110 setting multicast list." complaining about ?

- What means "Association Failed (0006)" ? Who is associating ?

Thank you in advance.

Regards, 

Frank

----------

## vitriol

Didn't realize you could get dhcpcd output from /var/log/messages. I've tried 5 different channels and still can't get an address from the dhcp server. Works fine when i'm plugged in with an ethernet cable. It also works perfectly when I boot into my wife's windows xp partition.

```

Aug  4 09:06:41 obfuscated ath0: association failed (reason 1) for 00:0f:b3:37:ef:25

Aug  4 09:06:48 obfuscated ath0: association failed (reason 1) for 00:0f:b3:37:ef:25

Aug  4 09:06:55 obfuscated ath0: association failed (reason 1) for 00:0f:b3:37:ef:25

Aug  4 09:07:02 obfuscated ath0: association failed (reason 1) for 00:0f:b3:37:ef:25

Aug  4 09:07:09 obfuscated ath0: association failed (reason 1) for 00:0f:b3:37:ef:25

Aug  4 09:07:16 obfuscated ath0: association failed (reason 1) for 00:0f:b3:37:ef:25

Aug  4 09:07:23 obfuscated ath0: association failed (reason 1) for 00:0f:b3:37:ef:25

Aug  4 09:07:30 obfuscated ath0: association failed (reason 1) for 00:0f:b3:37:ef:25

Aug  4 09:07:37 obfuscated ath0: association failed (reason 1) for 00:0f:b3:37:ef:25

Aug  4 09:07:39 obfuscated dhcpcd[15909]: timed out waiting for a valid DHCP server response

```

----------

## OkeyMor57

Everything worked fine until I upgraded to baselayout-1.10.2.  I lost wireless connectivity.  I up-graded to wireless-config-0.5.5.ebuild and now I get an error message  *Quote:*   

> etc/init.d/wireless.sh: line 759: error: command not found
> 
>  * Failed to configure wireless for eth0
> 
>  * preup eth0 failed
> ...

 

line 759 call wireless_up() and I cannot seem to find any place where the function is defined.  I am at a loss

----------

## OkeyMor57

I added  *Quote:*   

> iwconfig_eth0="dhcp"

  and that seem to solve the problem.  

I use ifplugd to manage network connections, if I execute 

```
/etc/init.d/ifplugd restart
```

, wireless network fails to start but reports that it is already running.

I need to look into that, for now I am happy I do not have to tie myself to the hub.

----------

## UberLord

I'm getting really tired about why WEP doesn't work - it doesn't work because you haven't configured it correctly. Please read the 1st page FAQ on WEP.

Basically, if you can prove that you can get wep to work on the command line 

```
iwconfig eth0 key s:thiskey

dhcpcd eth0

ping <your gateway ip>
```

and not using this config script then it is a bug - or an error your config - and I will fix it.

@eisenack

I used to get those messages all the time with my old orinoco card. Except for the failed association (which is a WEP problem afaik)

@vitriol

The CVS version is much better than the portage one. It may fix your DHCP problem

----------

## vitriol

 *UberLord wrote:*   

> 
> 
> @vitriol
> 
> The CVS version is much better than the portage one. It may fix your DHCP problem

 

Thanks, that never occured to me  :Smile:  I've read most of the 48 (so far) pages on this thread and it seems like there are alot of duplicate questions...maybe someone could set up a more detailed FAQ covering alot of these questions? I am sorry if anything I've asked has been excessively redundant.

----------

## vitriol

I installed madwifi cvs, but am still stuck at the same dhcp problem. I'm about out of ideas and went through dmesg to see if maybe I could be missing some vital detail.

ath0: association failed (reason 1) for 00:0f:b3:37:ef:25

Not much relevant information there  :Sad: 

wlan: 0.7.3.2 BETA

ath_hal: 0.9.9.13

ath_pci: 0.8.6.1 BETA

ath_pci: 0.8.6.1 BETA

^^^^^ madwifi cvs is installed. I'm lost...completely out of ideas.  I can't stand to not be able to solve a problem like this. argh!

----------

## vitriol

If anyone is seeing the error 

```

ath0: association failed (reason 1)
```

I found a potential fix that may work for some people. http://article.gmane.org/gmane.linux.drivers.madwifi.user/3572

Basically do this:

```
bash% export COPTS="$COPTS -DNO_WME"

```

and recompile madwifi cvs. Did it work for me? No. But I hope it helps someone else.

----------

## UberLord

The only other thing I can think of is that you have some other form of security like MAC filtering or something.

Can you associate and connect on the command line?

```

iwconfig ath0 essid network
```

If iwconfig then reports a MAC address for the AP then you are associated. However, your error may be about loosing association ...

----------

## vitriol

It looks like I can. 

```

root@bluebox ~ # iwconfig ath0 essid network

root@bluebox ~ # iwconfig

lo        no wireless extensions.

eth0      no wireless extensions.

ath0      IEEE 802.11  ESSID:"network"

          Mode:Managed  Frequency:2.452GHz  Access Point: 00:0F:B3:37:EF:25

          Bit Rate:1Mb/s   Tx-Power:50 dBm   Sensitivity=0/3

          Retry:off   RTS thr:off   Fragment thr:off

          Encryption key:off

          Power Management:off

          Link Quality=50/94  Signal level=-45 dBm  Noise level=-95 dBm

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

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

```

I was thinking about turning the DHCP server off today and trying to assign static addresses. Maybe that will work.

----------

## Anarcho

Hi all!!

I'm trying to get my WLAN ad-hoc network to get running.

I use the ndiswrapper to load the driver for my DWL-G520+ (54Mbit/s) and this seems to work.

I use this wireless-config script, really great work btw, to set the wlan0 device.

It gets the IP 192.168.0.1 and a DHCP Server is running on this machine. 

The Client is (at this moment) a Laptop with WinXP (Gentoo is already on this laptop but no driver for the WLAN Card, need to set up ndiswrapper soon).

The DHCP is running fine, the notebook gets a IP from the server. 

But then i cannot ping the server. 

From the server i can ping the laptop, but only if i specify the interface (ping -I wlan0 192.168.0.20)

But i can't use this Wirless connection, 'cause the laptop can't even ping.

Has anybody some hints for me?

Thanks!

Greetz,

Anarcho

----------

## vitriol

I've given up trying to get my wireless card to work.    :Confused:   I tried using static i.ps and turning off the DHCP server. That didn't do any good. I couldn't ping the AP.

Here are my final /etc/conf.d/wireless and /etc/conf.d/net. Do they look correct and everything?

/etc/conf.d/wireless:

```

preferred_aps=( "network" "ACTIONTEC" )

mode_ath0="managed"

preferred_only="yes

```

/etc/conf.d/net:

```

ifconfig_eth0=( "dhcp" )

ifconfig_ath0=( "dhcp" )

###########################################

# Hook wireless into /etc/init.d/net.eth0

# Please note, these lines should appear

# at the END of the file

source /etc/init.d/wireless.sh

preup() {

        wireless_up ${1}

        return $?

}

predown() {

        wireless_down ${1}

        return $?

}

# End hook

###########################################

```

Mac authentication and WEP are all turned off. The card connects perfectly under windows. Maybe I just need to wait until madwifi matures a little bit, even though my card is detected just fine. 

If I could just get past this:

```

ath0: association failed (reason 1) for 00:0f:b3:37:ef:25

```

The card would surely work. It associates with the AP and then loses association because of an inability to communicate with the DHCP server.

----------

## Anarcho

Now, the next day, nothing works....

I noticed that when i run iwconfig wlan0 several times, the interface loses his ESSID (it shows ESSID:off/any) and after a few second gets his original ESSID back.

But the other Card doen't find this ESSID when I use iwlist wlan0 scanning.

And when i set the other card to this ESSID and start scanning it sometimes finds a network but the Cell is completely different.

Edit:

Ok, got them back to the same ESSID and when i assign IPs manualy I can ping from the server to the notebook but not vice versa.

The DHCP is also not working.

Edit2:

Ok, old situtation is arrived.

Linux:

DHCP is working, the server can Ping the Laptop but the laptop can't ping anything.

When I start ping, nothing happens, no error message like timeout.

But Windows doesn't even find the WLAN ESSID....

----------

## Ahri

Firstly, thanks for writing this great script - I only have one minor problem; My WAP is set up for 64bit shared key WEP, but the following doesn't work:

```
key_Foonet="s:0011223344 enc open"
```

 - if I switch off WEP on the WAP then everything works fine but then I'm left with only MAC table filtering and I feel safer with a gesture of encryption. Anyway, that test showed that it's definately the WEP aspect that's not working.

So my question is; what string should I be using? I tried substituting "restricted" for "open" but that made no difference.

Secondly, this forum doesn't seem to support searching adequately for long threads like this, so I was unable to look for other people with the same problem - I read a few pages, but I'm only human!

Edit: changing to using

```
key_Foonet="0011223344 enc restricted"
```

and it's all working fine for me now (I read the next post down and got the impression that 's:' implies an ASCII key, so I stripped it)Last edited by Ahri on Mon Aug 09, 2004 3:06 pm; edited 1 time in total

----------

## eisenack

 *UberLord wrote:*   

> I'm getting really tired about why WEP doesn't work - it doesn't work because you haven't configured it correctly.

 

I'm sorry - but unfortunately you're right.  :Wink: 

I think the problem is not one, caused by your excellent scripts, but a configuration problem, which me and obviously some others are incapable  to solve. But you, as you appear to have a lot of experience with configuring wireless networks on linux, are the man to ask.

Now to the problem:

I wasn't able to get WEP to work with the command line and I followed your advice and read the FAQ. Which said: 'Some drivers don't support both encryption methods, some cards/drivers won't talk to some Access Points... etc.'

The questions:

- How can I decide if my configuration is messed up or if my driver is too crappy?

- Could it be possible, that my driver works with 40bit, but not with 64bit or 128bit or whatever, and how do I see that?

- Could it be possible, that a driver only accepts keys in ASCII (s:xxx) but not in HEX? (Would be a stupid driver, but anyway.)

- Is the bit length configured somewhere, or is it determined by the length of the key?

Some advice for checking the actions step by step would be very helpful.

That also would prevent undifferentiated statements like "WEP works" and "WEP doesn't work".

Thank you for taking the trouble.

----------

## UberLord

 *eisenack wrote:*   

> 
> 
> - How can I decide if my configuration is messed up or if my driver is too crappy?

 

Very hard too tell imo. Not many drivers use the invalid crypt that iwconfig reports

 *Quote:*   

> 
> 
> - Could it be possible, that my driver works with 40bit, but not with 64bit or 128bit or whatever, and how do I see that?

 

Anything is possible ... after using a few wireless drivers and supporting many user problems not many drivers work the same way with wireless-tools.

 *Quote:*   

> 
> 
> - Could it be possible, that a driver only accepts keys in ASCII (s:xxx) but not in HEX? (Would be a stupid driver, but anyway.)
> 
> 

 

That I don't know as I have't looked at the wireless-tools source code. Judging by the output of iwconfig, I would guess that it converts the ASCII key to a hex key and then sends that.

 *Quote:*   

> 
> 
> - Is the bit length configured somewhere, or is it determined by the length of the key?
> 
> 

 

It's set by the length of the key.

----------

## UberLord

 *Anarcho wrote:*   

> 
> 
> The DHCP is running fine, the notebook gets a IP from the server. 
> 
> But then i cannot ping the server. 
> ...

 

Is there a firewall blocking ping or ICMP?

If there is more than one interface active (say eth0) with the same network settings, ping may prefer using that.

----------

## Anarcho

I use iptables but only for masquerading, I start them with the following comand:

```
iptables --table nat --append POSTROUTING --out-interface ppp0 -j MASQUERADE
```

but with the normal lan connection I don't have any problems.

I even trie to ping from the laptop with 

```
ping -I wlan0 192.168.0.1
```

but the same. 

Like I said, the wire-network works perfect. Only the wireless refuses to work. To make it even worse, windows doesn't even find the wlan-essid.

That's not soo bad, but under windows I can be sure that the driver works. 

I use the ndiswrapper under linux on both, server and laptop 'cause both wlan-cards uses the ACX111 Chip....

But DHCP is working, so a basic communication seems to work...

I really run out of ideas ...

----------

## 5xl

Man, I have been working on this all day. I've read about twenty pages in this thread with no one experiencing what I am to this degree. Things I have done:

linked my wlan0 init script (with patch not shown)

```
iface_eth0="dhcp"

iface_wlan0="dhcp"

netmask_eth0="255.255.255.0 255.255.255.0"

netmask_wlan0="255.255.255.0 255.255.255.0"
```

I've emerged wireless-tools and edited my /etc/conf.d/wireless options are as follows: 

```
mode_wlan0="Managed"

channel_wlan0="6"

key_00000="s:0000-0000-0000-0 enc open"

preferred_aps=( "00000" )
```

My card is a broadcom 802.11g and is loaded via ndiswrapper v.8. dmesg shows that it is loaded and has a mac address. However any commands passed to iwconfig have no effect on the configuration.

ex.)

```
#iwconfig wlan0 essid 00000 key s:000000000

#iwconfig

lo        no wireless extensions.

eth0      no wireless extensions.

wlan0     IEEE 802.11g  ESSID:off/any

          Mode:Managed  Frequency:2.437GHz  Access Point: 00:00:00:00:00:00

          Bit Rate:54Mb/s   Tx-Power:24 dBm

          RTS thr:2347 B   Fragment thr:2346 B

          Encryption key:3534-3637-3567-6564-3633-6679-35   Security mode:restricted

          Power Management:off

          Link Quality:100/100  Signal level:-10 dBm  Noise level:-256 dBm

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

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

```

It is almost as if it is ignoring any command I give it. I have unmerged wireless tools and remerged it just for kicks.  Results are the same as before. Here is the result of an attempt to start the script:

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

 * Running preup function

 *   Configuring wireless network for wlan0

 *   Scanning for access points

 *     no access points found

 *   Trying to force preferred incase they are hidden

 *   Connecting to "00000" (WEP enabled)...                                     [ !! ]

 *   Failed to associate with any preferred access points on wlan0

 * Couldn't find any access points on wlan0

 * Failed to configure wireless for wlan0

 * preup wlan0 failed

```

Any ideas fellas?  :Rolling Eyes: 

----------

## Wechner

Hey,

first of all thx for your great work with this script. It really helps a lot.

But I encountered an serious issue: I upgraded from 0.4.7 of your script to version 0.5.5 . This version completely breaks WLAN here. If I boot, I get this:

 *Quote:*   

> * Caching service dependencies
> 
> * Bringing wlan0 down
> 
>   * Running pre-down function ...
> ...

 

Later the connect in the preup fails every time. Downgrading to version 0.4.7 solves this for me, i. e. I get not the described errors.

I cannot say what changes between 0.4.7 and 0.5.5 cause this ...

Regards

----------

## Wechner

Hey,

 *Wechner wrote:*   

> 
> 
>  *Quote:*   * Caching service dependencies
> 
> * Bringing wlan0 down
> ...

 

sry, but what I wrote above was not fully correct. The difference between 0.4.7 and 0.5.5 here is that the preup func of 0.4.7 does not fail after boot but 0.5.5 does almost every time. But 0.4.7 also fails at startup with the described error. What goes wrong?

Regards

----------

## UberLord

 *Wechner wrote:*   

> 
> 
> ```
> * Caching service dependencies
> 
> ...

 

I would say that you have iproute2 installed and that is causing the error. Gentoo's current net.eth0 is at fault here - and you have to trust me on this.

I would advise uninstalling iproute2 and configuring for ifconfig (net-tools) instead.

----------

## UberLord

 *5xl wrote:*   

> 
> 
> ```
> iface_eth0="dhcp"
> 
> ...

 

Please, use the newer ifconfig setup - iface is depreciated

```

ifconfig_eth0=( "dhcp" )

ifconfig_wlan0=( "dhcp" )

```

Also, using DHCP means you don't need netmask lines

 *Quote:*   

> 
> 
> I've emerged wireless-tools and edited my /etc/conf.d/wireless options are as follows: 
> 
> ```
> ...

 

You don't set channel when working in Managed mode.

Managed mode is automatically selected, so there's no real need to set that either.

 *Quote:*   

> 
> 
> ```
> 
> wlan0     IEEE 802.11g  ESSID:off/any
> ...

 

Well, iwconfig is passing something to the card as it has an encryption key set. I would guess that iwconfig doens't like the ESSID of 00000.

Try 11111 instead (you need to change the AP as well)

----------

## Wechner

Thx for your answer. Will try it.

----------

## UberLord

 *Anarcho wrote:*   

> 
> 
> But DHCP is working, so a basic communication seems to work...
> 
> I really run out of ideas ...

 

Could you stop the wired interfaces (at both ends) and remove the cables (just to be sure) and try pinging again? If that fails, try rebooting and pinging.

If that fails then I'm all out of ideas  :Sad: 

----------

## Wechner

Just wanted to unmerge iproute2, but my firewall shorewall depends on it! What shall I do?

----------

## UberLord

 *Wechner wrote:*   

> Just wanted to unmerge iproute2, but my firewall shorewall depends on it! What shall I do?

 

Contact me on Jabber (uberlord@jabber.org) or another IM (buttons on this forum) if you're feeling brave

----------

## hotplainrice

Think this info might be useful to some who are using Intersil Prism 2/2.5/3.

I am using the HostAP driver but I guess it would work with orinoco too.

An hour ago, I was using secondary or station firmware 1.4.1 which worked for wireless-config 4.x series but didn't work for 5.x series. DHCP with this firmware is inconsistent. Recently, I flashed the card with firmware 1.8.0 which worked with 4.x series together with  wireless-config-0.5.5 and I tested it with my neighbours APs and mine, it managed to grab an IP every single time.

The flashing guide for Intersil Prism chips is available at http://linux.junsun.net/intersil-prism/

----------

## UberLord

Now that's really useful feedback. I'm going to add that to the FAQ  :Smile: 

----------

## Wechner

 *UberLord wrote:*   

>  *Wechner wrote:*   Just wanted to unmerge iproute2, but my firewall shorewall depends on it! What shall I do? 
> 
> Contact me on Jabber (uberlord@jabber.org) or another IM (buttons on this forum) if you're feeling brave

 

Sry, but I have not that much time to spend in the internet. May it be possible to write the neccessary steps into an email to me (wechner@users.sourceforge.net)?

Thx in advance

----------

## 5xl

Uberlord:

 *Quote:*   

> Well, iwconfig is passing something to the card as it has an encryption key set. I would guess that iwconfig doens't like the ESSID of 00000.
> 
> Try 11111 instead (you need to change the AP as well)

 

I don't really use 00000 as the essid, it's just an example, my real one is 82113. For that matter, it won't take any essid or any paramer... What else could be making iwconfig not respond? I'm assuming the use of iwconfig is crucial to get this script working...

----------

## GreenPea

Just wanted to thank UberLord for the fantastic work he has done.  His scripts, ndiswrapper and this thread have my HP ZD7000 with a Broadcom 802.11G card working wonderfuly. 

1. Installed ndiswrapper v.8 and followed the INSTALL doc

2. Emerged wireless-config 5.5 and CLOSELY followed the emerge instructions and page 1 of this thread.

3.  Rechecked the proceedure by following the mini-how-to on page 47 by CB2206 (nice job btw, although I did not have to change the preup or predown for it to work.) 

4. Took brady's thought (on pg 47, and thank you for that great tip) one step further.  I took ndiswrapper out of my /etc/modules.autoload.d/kernel-2.6 and put it in the preup sequence so the hooks in my /etc/conf.d/net looks like 

```
 ###########################################

# Hook wireless into /etc/init.d/net.eth0

# Please note, these lines should appear

# at the END of the file

source /etc/init.d/wireless.sh

preup() {

        modprobe ndiswrapper

        wireless_up ${1}

        return $?

}

predown() {

        wireless_down ${1}

        return $?

}

postdown() {

        rmmod ndiswrapper

}

# End hook

###########################################
```

Now my antena stays off until I /etc/init.d/net.wlan0 start  and it turns off when I /etc/init.d/net.wlan0 stop.

I understand this is not for everyone, but it works well for me since I am wired most of the time and want my wireless only when I want it.

I am not a coder so I must beg some help or at least a pointer in the right direction.  Is there a script or config that will start eth0 on start up, and if that works move on with the rest of the start up skipping wlan0, but if it fails, try to start wlan0 using wireless-config?  This would save a lot of hassle of having to go back and rerun ssh, ntpdate etc startup scripts after eth0 fails and I manualy start wlan0.

Any input or pointers are much appreciated.

Thanks again for all the great work and comments you folks have put into this thread, 

GreenPea

----------

## 5xl

New update of my info.

Please help me! I'm getting pretty desparate here...

dmesg:

```
ndiswrapper version 0.8 loaded

ndiswrapper adding bcmwl5.sys

wlan0: ndiswrapper ethernet device 00:90:4b:5b:99:a4 using driver bcmwl5.sys
```

```
#iwconfig wlan0

wlan0     IEEE 802.11g  ESSID:""

          Mode:Managed  Frequency:2.462GHz  Access Point: FF:FF:FF:FF:FF:FF

          Bit Rate:54Mb/s   Tx-Power:24 dBm

          RTS thr:2347 B   Fragment thr:2346 B

          Encryption key:off

          Power Management:off

          Link Quality:100/100  Signal level:-10 dBm  Noise level:-256 dBm

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

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

Any attempt to change this info is ignored (ie changing the essid etc) It's like I never entered a command in the first place. When I try to start the card I get this:

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

 * Running preup function

 *   Configuring wireless network for wlan0

 *   Scanning for access points

 *     no access points found

 *   Trying to force preferred incase they are hidden

 *   Connecting to "82113" (WEP enabled)...                               [ !! ]

 *   Failed to associate with any preferred access points on wlan0

 * Couldn't find any access points on wlan0

 * Failed to configure wireless for wlan0

 * preup wlan0 failed
```

I have tried absolutly everything from changing ndiswrapper versions to changing the inf files i use. My laptop is a hp zx5000 and I have a broadcom 802.11g card. Any help would be greatly appreciated.

----------

## UberLord

 *5xl wrote:*   

> 
> 
> I don't really use 00000 as the essid, it's just an example, my real one is 82113. For that matter, it won't take any essid or any paramer... What else could be making iwconfig not respond? I'm assuming the use of iwconfig is crucial to get this script working...

 

Could you try starting the ESSID with a letter? Obviously you would have to change the AP as well

Have you tried manualling setting ESSID?

```

ifconfig wlan0 up

iwconfig wlan0 essid 82113
```

----------

## UberLord

 *GreenPea wrote:*   

> 
> 
> Now my antena stays off until I /etc/init.d/net.wlan0 start  and it turns off when I /etc/init.d/net.wlan0 stop.
> 
> I understand this is not for everyone, but it works well for me since I am wired most of the time and want my wireless only when I want it.
> ...

 

This should work for you

```

###########################################

# Hook wireless into /etc/init.d/net.eth0

# Please note, these lines should appear

# at the END of the file

source /etc/init.d/wireless.sh

preup() {

        local iface=${1}

        if [[ wlan0 == ${iface} ]]; then

             modprobe ndiswrapper

             wireless_up ${iface}

             return $?

        else

             return 0

        fi

}

postdown() {

        local iface=${1}

        if [[ wlan0 == ${iface} ]]; then

             wireless_down ${iface}

             rmmod ndiswrapper

             return $?

        else

             return 0

        fi

}

# End hook

###########################################
```

----------

## 5xl

```
home root # iwconfig wlan0 essid setsomething

home root # iwconfig wlan0

wlan0     IEEE 802.11g  ESSID:""

          Mode:Managed  Frequency:2.462GHz  Access Point: FF:FF:FF:FF:FF:FF

          Bit Rate:54Mb/s   Tx-Power:24 dBm

          RTS thr:2347 B   Fragment thr:2346 B

          Encryption key:off

          Power Management:off

          Link Quality:100/100  Signal level:-10 dBm  Noise level:-256 dBm

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

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

home root # iwconfig wlan0 essid TRYCAPITAL

home root # iwconfig wlan0

wlan0     IEEE 802.11g  ESSID:""

          Mode:Managed  Frequency:2.462GHz  Access Point: FF:FF:FF:FF:FF:FF

          Bit Rate:54Mb/s   Tx-Power:24 dBm

          RTS thr:2347 B   Fragment thr:2346 B

          Encryption key:off

          Power Management:off

          Link Quality:100/100  Signal level:-10 dBm  Noise level:-256 dBm

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

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

home root # iwconfig wlan0 essid 123456

home root # iwconfig wlan0

wlan0     IEEE 802.11g  ESSID:""

          Mode:Managed  Frequency:2.462GHz  Access Point: FF:FF:FF:FF:FF:FF

          Bit Rate:54Mb/s   Tx-Power:24 dBm

          RTS thr:2347 B   Fragment thr:2346 B

          Encryption key:off

          Power Management:off

          Link Quality:100/100  Signal level:-10 dBm  Noise level:-256 dBm

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

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

home root # iwconfig wlan0 essid "tryquotes"

home root # iwconfig wlan0

wlan0     IEEE 802.11g  ESSID:""

          Mode:Managed  Frequency:2.462GHz  Access Point: FF:FF:FF:FF:FF:FF

          Bit Rate:54Mb/s   Tx-Power:24 dBm

          RTS thr:2347 B   Fragment thr:2346 B

          Encryption key:off

          Power Management:off

          Link Quality:100/100  Signal level:-10 dBm  Noise level:-256 dBm

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

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

home root # iwconfig wlan0 up

Error : unrecognised wireless request "up"

```

weird, isn't it?

----------

## Anarcho

Maybe you should try 

iwconig wlan0 commit 

after you set the essid

----------

## kamagurka

 *UberLord wrote:*   

>  *kamagurka wrote:*   
> 
> i assume you mean i should put it in /etc/conf.d/wireless. it has no noticeable effect.
> 
> is it a problem that i am also hardconnected to the router when i try to get the wlan up? 
> ...

 

nope, i turned all that off; i'm gonna turn it back on when i have this running.

and it still isn't working; i can't get it to work manually either. when i try to set the essid manually, it is as if nothing happened.

```
└─# iwconfig wlan0 essid test  

└─# iwconfig 

lo        no wireless extensions.

eth0      no wireless extensions.

sit0      no wireless extensions.

wlan0     IEEE 802.11b  ESSID:off/any

          Mode:Managed  Frequency:2.462GHz  Access Point: 00:00:00:00:00:00

          Bit Rate:54Mb/s

          RTS thr:1600 B   Fragment thr:2304 B

          Encryption key:off

          Power Management:off

          Link Quality:0/100  Signal level:24/154  Noise level:0/154

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

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

(yes, my ap's essid (or ssid, as barricade likes to call it) is set to "test" right now).

----------

## moramis

Forgive me if this question has been answered, but I couldn't find it in the sample config file nor in the 20-some pages I have read so far of this 50-page topic.

I have the system working perfectly, switching between home and office networks correctly.  What I would like to do in the case of not finding any of my preferred SSIDs is fall back to looking for any SSID and using DHCP.  The only specific fall back mechanism I can see is ad-hoc, and leaving it out entirely doesn't appear to do what I want.

Can this be done?  How do I specify DHCP for non-preferred SSIDs?

----------

## UndercoverParrothead

I've gone through many of the pages on this topic as well and can't seem to find any answers to my problems.

I have an AP that I have to manually specify the nameservers for.  I've set

```
nameserver_NETGEAR="38.9.213.2"

nameserver_NETGEAR="38.9.223.2"
```

and 

```
dhcpcd_NETGEAR="-R"
```

yet I still have to manually edit /etc/resolv.conf to specify the nameservers.  Am I missing something here?

----------

## moramis

-R *prevents* dhcpcd from replacing your resolv.conf.  Get rid of it if you want the DHCP server to set your DNS.

----------

## UndercoverParrothead

That's the thing, for this specific ESSID I *don't* want DHCP setting the nameserver settings, I need to manually specify them.  If I read things right, then I need to specify -R for this to work, no?

Regardless, whether or not I have -R specified, DHCP is still overwriting /etc/resolv.conf.  In one of the two cases, it shouldn't be doing this.

----------

## cult hero

I dunno if I found a problem or what... but... here goes. I have three APs I use regularly (my place, work, friend's place) and wanted to configure APs for them. Seemed easy enough...

Here's my configuration:

```
preferred_aps=("cantina", "shadowninja", "ubernet")

preferred_only="no"

key_cantina="xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xx"

key_shadowninja="xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xx"

key_ubernet="xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xx"
```

Obviously I blotted out keys. Anyway, the end result works, but here's the problem I get:

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

 * Running preup function

 *   Configuring wireless network for eth0

 *   Scanning for access points

 *     Found "cantina" at 00:06:25:98:DC:C6 (WEP required)

 *   Trying to force preferred incase they are hidden

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

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

 *   Connecting to "ubernet" (WEP enabled)...                             [ !! ]

 *   Failed to associate with any preferred access points on eth0

 *   Connecting to "cantina" (WEP enabled)...                             [ ok ]

 *     eth0 connected to "cantina" in managed mode

 *     on channel 7 (WEP enabled)

 * Bringing eth0 up via DHCP...                                           [ ok ]

 *   eth0 received address 192.168.0.109
```

Not only is the script trying to connect without WEP at first, but strangely... on it's FIRST try to my third preferred AP it tries with WEP. Logically I'd think it would try all three without WEP first and THEN try with WEP. (And I'd prefer having it do WEP first.)

While it could be my configuration I figured I might as well post it because it's so strange.

Anyway... I want to say many thanks for this script though. I just flat out rocks.

----------

## GreenPea

UberLord, Thank you very much for the additional code.  I must have a conceptual error somewhere.  I commented out the previous wireless hooks section and pasted your new one in.  

With the following settings, this is what happens durring boot:

just eth0 set to default -> success or fail, system does not try wlan0.

eth0 and wlan0 set to default -> trys to bring up both regardless

This is the process I was hoping for:

(durring boot)-> start eth0 IF DHCP success -> skip trying wlan0 and move on with the rest of the start up  IF eth0 DHCP timout or fails -> try wlan0 (success or fail) move on with boot

Is there something obvious that I missed, or should I have these set some other way?

Thanks again for your help.

GP.

----------

## UberLord

 *moramis wrote:*   

> Forgive me if this question has been answered, but I couldn't find it in the sample config file nor in the 20-some pages I have read so far of this 50-page topic.
> 
> I have the system working perfectly, switching between home and office networks correctly.  What I would like to do in the case of not finding any of my preferred SSIDs is fall back to looking for any SSID and using DHCP.  The only specific fall back mechanism I can see is ad-hoc, and leaving it out entirely doesn't appear to do what I want.
> 
> Can this be done?  How do I specify DHCP for non-preferred SSIDs?

 

This can be done

Set the default config for the interface to DHCP - ifconfig_eth0=( "dhcp" )

Set the config for your preferred ESSIDs - ifconfig_ESSID=( "192.etc etc")

----------

## UberLord

 *UndercoverParrothead wrote:*   

> I've gone through many of the pages on this topic as well and can't seem to find any answers to my problems.
> 
> I have an AP that I have to manually specify the nameservers for.  I've set
> 
> ```
> ...

 

At this time you can only set one nameserver - with your config it will use the last one.

The dhcpcd_NETGEAR option is correct - however, is that the exact ESSID? If it is netgear it will not work as it's lowercase ...

----------

## UberLord

 *cult hero wrote:*   

> Here's my configuration:
> 
> ```
> preferred_aps=("cantina", "shadowninja", "ubernet")
> ```
> ...

 

Don't use comma's  :Wink:  - just spaces

```
preferred_aps=("cantina" "shadowninja" "ubernet")
```

----------

## UberLord

 *GreenPea wrote:*   

> 
> 
> This is the process I was hoping for:
> 
> (durring boot)-> start eth0 IF DHCP success -> skip trying wlan0 and move on with the rest of the start up  IF eth0 DHCP timout or fails -> try wlan0 (success or fail) move on with boot
> ...

 

OK - this is tricky

You will need to put both eth0 and wlan0 in default runlevel for both to start

eth0 will always be tried first (rc goes in alpha order)

So, you need to add some code to preup to case a failure if the iface is wlan0 and eth0 is started

```

local status=$( rc-status default | awk '/net.eth0/ {print $3}' | grep started )

if [[ -n ${status} ]]; then

        eerror "net.eth0 has been started - aborting net.wlan0 startup"

        return 1

fi

```

Put that in your pre-up function and I think you're golden

----------

## UndercoverParrothead

 *UberLord wrote:*   

> 
> 
> At this time you can only set one nameserver - with your config it will use the last one.
> 
> The dhcpcd_NETGEAR option is correct - however, is that the exact ESSID? If it is netgear it will not work as it's lowercase ...

 

I commented out the second nameserver entry - and yes, the ESSID is correct, including the case.

I just restarted the wireless card again:

1) ifconfig eth1 down

2) /etc/init.d/net.eth1 restart

3) cat /etc/resolv.conf:

```
nameserver 192.168.0.1
```

So it's not obeying what I've specified in /etc/conf.d/wireless...

----------

## UberLord

@UndercoverParrothead - I've posted a test version for you

http://rsm.demon.co.uk/~roy/downloads/wireless-config-0.5.10/wireless.sh

See if that works or not

----------

## Madferret

I just installed your ebuild and it works flawlessly    :Very Happy: 

this was exactly what i was looking for

Just wanna say thanks and keep up the good work   :Very Happy:   :Very Happy: 

btw, I'm using the USR5410 pcmcia (802.11g) with 128-bit wep, using the linuxant driver.  I wish I could use the ACX111 drivers but i couldn't get wep working with the native ACX111 drivers or it's not currently supported.

----------

## cult hero

UberLord: Yup. I feel like an ass now. The commas were the problem. Thanks a bunch though. The script works PERFECTLY now. (I guess it did before too since the error was mine.) My mom's using a Gentoo laptop now! Making sure wireless "just worked" was the last thing I needed before switching her! So know that you've helped bring a luddite to Linux.

----------

## UndercoverParrothead

 *UberLord wrote:*   

> @UndercoverParrothead - I've posted a test version for you
> 
> http://rsm.demon.co.uk/~roy/downloads/wireless-config-0.5.10/wireless.sh
> 
> See if that works or not

 

Just to make sure I'm doing things right - I downloaded that version of wireless.sh and replaced the version in /etc/init.d (After making a backup, of course).

And no, it didn't work.  

Drop me an IM at UndrcvrParrothed and maybe we can figure it out if you get the chance.

----------

## ixtow

```

bash-2.05b# cd /usr/local/portage/net-wireless/wireless-config

bash-2.05b# wget http://rsm.demon.co.uk/~roy/downloads/wireless-config-0.5.5.ebuild

--21:19:41--  http://rsm.demon.co.uk/%7Eroy/downloads/wireless-config-0.5.5.ebuild

           => `wireless-config-0.5.5.ebuild'

Resolving rsm.demon.co.uk... 80.177.174.176

Connecting to rsm.demon.co.uk[80.177.174.176]:80... connected.

HTTP request sent, awaiting response... 200 OK

Length: 2,159 [text/plain]

100%[====================================>] 2,159         --.--K/s

21:19:42 (28.00 KB/s) - `wireless-config-0.5.5.ebuild' saved [2159/2159]

bash-2.05b# ebuild wireless-config-0.5.5.ebuild digest

!!! aux_get(): ebuild for 'net-wireless/wireless-config-0.5.5' does not exist at:

!!!            /usr/portage/net-wireless/wireless-config/wireless-config-0.5.5.ebuild

doebuild(): aux_get() error; aborting.

bash-2.05b#

```

Sooo......

```

bash-2.05b# pwd

/usr/local/portage/net-wireless/wireless-config

bash-2.05b# ls -l

total 4

-rw-r--r--  1 root root 2159 Jul 28 10:46 wireless-config-0.5.5.ebuild

bash-2.05b# ebuild wireless-config-0.5.5.ebuild digest

!!! aux_get(): ebuild for 'net-wireless/wireless-config-0.5.5' does not exist at:

!!!            /usr/portage/net-wireless/wireless-config/wireless-config-0.5.5.ebuild

doebuild(): aux_get() error; aborting.

bash-2.05b#

```

Maybe, if I take that "/local" out of it.....

----------

## Ecco

 *ixtow wrote:*   

> 
> 
> ```
> ...
> 
> ...

 

I'll just bet you didn't put

```
PORTDIR_OVERLAY="/usr/local/portage"
```

in your /etc/make.conf?

Try putting "digest" in your FEATURES and then "emerge wireless-config". It should make the digest automatically.

----------

## UberLord

 *UndercoverParrothead wrote:*   

>  *UberLord wrote:*   @UndercoverParrothead - I've posted a test version for you
> 
> http://rsm.demon.co.uk/~roy/downloads/wireless-config-0.5.10/wireless.sh
> 
> See if that works or not 
> ...

 

I've upped a new test version (same URL). It's not changed except for I've added 2 debug lines to show what variables are set by your ESSID and if /etc/resolv.conf gets overwritten by my nameserver script.

----------

## Zidge

Hi Uberlord

I'm trying to set my wireless network up, and I think I'm pretty much done ... though I have some config problems:

here is my AP config (a Belkin 802.11b router)

 *Quote:*   

> 
> 
> SSSID: Ricquet
> 
> Channel: 1
> ...

 

and here is my /etc/conf.d/wireless (without comment)

 *Quote:*   

> 
> 
> essid_wlan0="Ricquet"
> 
> channel_wlan0="1"
> ...

 

I also added some lines in my /etc/conf.d/net

 *Quote:*   

> 
> 
> iface_wlan0="dhcp"
> 
> dhcpcd_wlan0="-h Ricquet -D"
> ...

 

just in case :p

when I do a 

/etc/init.d/net.wlan0 start I then have

 *Quote:*   

> 
> 
>  * Running preup function
> 
>  *   Configuring wireless network for wlan0
> ...

 

What have I wrong ?

----------

## UberLord

 *Zidge wrote:*   

> Hi Uberlord
> 
> I'm trying to set my wireless network up, and I think I'm pretty much done ... though I have some config problems:
> 
> 

 

I've redone your configs for you  :Smile: 

/etc/conf.d/wireless

```

# essid_wlan0="Ricquet"

# Try without the above line - your card may be capable of scanning

key_Ricquet="12-34-56-78-90 enc open"

preferred_aps=( "Ricquet" )

```

/etc/conf.d/net

```

iface_wlan0="dhcp"

dhcpcd_wlan0="-h Ricquet -D"

```

 *Quote:*   

> 
> 
> when I do a 
> 
> /etc/init.d/net.wlan0 start I then have
> ...

 

Well, first off, you rarely have to set ESSID to the iface - but that depends on the driver. I've commented in the config  :Wink: 

Secondly, whats "wireless_key_memory="restricted 1234-5678-90"" referring to?

Thirdly, there are several association mechs available in the config. They are all documented. Try associate_test with the various flags (MAC, quality, all). Maybe you have WEP key or WEP type wrong (some AP's don't like this when associating, some do). Maybe you have MAC filtering turned on at the AP. Lastly, some card/driver/AP combo's just don't associate.

Fourthly if 

```

iwconfig wlan0 essid Ricquet

iwconfig wlan0 key 12-34-56-78-90 enc open

dhcpcd wlan0
```

works for you then let me know so I can try and fix my script.

Thanks!

----------

## Zidge

Hi again,

I have no clue why this doesn't work but it seems my card can't see any network

here is the

/etc/init.d/net.wlan0 output (now that I have changed to what you said)

 *Quote:*   

> 
> 
>  * Running preup function
> 
>  *   Configuring wireless network for wlan0
> ...

 

I hope that's not too bad, I tried 2 or 3 different drivers already, but this on is the only allowing me to up my wlan0 card.

(by the way, the card works and the router too ... with my w2k)

I have no firewall (just disabled it on the router), no mac filtering, and the ESSID is broadcast.

any idea ?

the

 *Quote:*   

> 
> 
> "wireless_key_memory="restricted 1234-5678-90"
> 
> 

 

was just referring to some things I saw reading the thread, just thought it was WEP conf

iwconfig wlan0 essid Ricquet

iwconfig

always gives the sa

me answer:

```

wlan0     IEEE 802.11g  ESSID:""  

Mode:Managed  Frequency:2.462GHz  Access Point: FF:FF:FF:FF:FF:FF

Bit Rate:54Mb/s   Tx-Power:24 dBm   

RTS thr:2347 B   Fragment thr:2346 B   

Encryption key:off

Power Management:off

Link Quality:100/100  Signal level:-10 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

```

----------

## Zidge

wow crap !!!

I just tried a few more drivers (included the one on my cdrom) ...

and it worked, so now I can see networks ... !!! great

here is what the iwlist scanning gives !

 *Quote:*   

> 
> 
> wlan0     Scan completed :
> 
>           Cell 01 - Address: 00:30:BD:CA:92:CA
> ...

 

I still have connection problems (even when I disable WEP encryption)

I got: 

 *Quote:*   

> 
> 
>  *   Trying to force preferred incase they are hidden
> 
>  *   Failed to associate with any preferred access points on wlan0
> ...

 

this sux :S

anyway, thanks for your help :p

----------

## roboguy

Hi all,

I hate to say it but my connectivity problems persist. This is really driving me nuts as my wireless was rock solid for months, then the last few weeks...

So, here's some info, hopefully someone can help me.

I have a 3 com card using the prism54 driver.

I am using kernel 2.6.7 (compiling 2.6.8.1 at the moment, perhaps that will help...)

baselayout 1.10.3

My wireless config file:

```

root@porthos /etc/conf.d # /etc/init.d/net.eth1 restart

 * Running preup function

 *   Configuring wireless network for eth1

 *   Scanning for access points

 *     Found "PorthosNet" at 00:0D:54:F9:7F:DE (WEP required)

 *   Connecting to "PorthosNet" (WEP enabled)...                          [ ok ]

 *     eth1 connected to "" in managed mode

 *     on channel 3 (WEP enabled)

 * Bringing eth1 up...

 *   eth1 dhcp                                                            [ !! ]

root@porthos /etc/conf.d #

```

As you can see, for some reason it says connecting to "PorthosNet", then looses the ESSID in the next line.

My wireless config:

```

# /etc/conf.d/wireless:

# Global wireless config file for net.* rc-scripts

##############################################################################

# HINTS

##############################################################################

# Remember to change eth0 to your wireless interface which may be

# eth0, eth1, wlan0, ath0 - you get the idea. If you're not sure

# you can type "iwconfig" at the command prompt and it will tell you which

# interfaces are wireless.

# Say that your wireless interface is ath0 - the line

#      #essid_eth0="any"

# becomes

#      #essid_ath0="any"

#

# Remember to change ESSID to your ESSID.

# Say that your ESSID is My NET - the line

#      #key_ESSID="s:passkey"

# becomes

#      #key_My_NET="s:passkey"

# Notice that the space has changed to an underscore - do the same with all

# characters not in a-z A-Z (english alphabet) 0-9.

#

# Any ESSID's in quotes like essid_eth0="My NET" may need to be escaped

# This means placing the character \ before the character

# \" need to be escaped for example

# So if your ESSID is

#      My "\ NET

# it becomes

#      My \"\\ NET

# for example

#      #essid_eth0="My\"\\NET"

#

# As a final note, most users will just need to set the following options

# key_ESSID1="s:yourkeyhere enc open"

# key_ESSID2="s:yourothrkey enc open"

# preferred_aps=( "ESSID1" "ESSID2" )

#

# Clear? Good. Now configure your wireless network below

#########################################################

##############################################################################

# SETTINGS

##############################################################################

# Hard code an ESSID to an interface - leave this unset if you wish the driver

# to scan for available Access Points

# Set to "any" to connect to any ESSID - the driver picks an Access Point

# This needs to be done when the driver doesn't support scanning

# This may work for drivers that don't support scanning but you need automatic

# AP association

# I would only set this as a last resort really - use the preferred_aps

# setting at the bottom of this file

# However, using ad-hoc (without scanning for APs) and master mode

# do require the ESSID to be set - do this here

#essid_eth0="any"

# Set the mode of the interface (managed, ad-hoc or master). Managed is default

# If it's ad-hoc or master you also may need to specify the channel below

mode_eth1="Managed"

# If managed mode fails, drop to ad-hoc mode with the below ESSID?

#adhoc_essid_eth0="WLAN"

#Channel can be set (1-14), but defaults to 3 if not set.

#

# The below is taken verbatim from the BSD wavelan documentation found at

# http://www.netbsd.org/Documentation/network/wavelan.html

# There are 14 channels possible; We are told that channels 1-11 are legal for

# North America, channels 1-13 for most of Europe, channels 10-13 for France,

# and only channel 14 for Japan. If in doubt, please refer to the documentation

# that came with your card or access point. Make sure that the channel you

# select is the same channel your access point (or the other card in an ad-hoc

# network) is on. The default for cards sold in North America and most of Europe

# is 3; the default for cards sold in France is 11, and the default for cards

# sold in Japan is 14.

channel_eth1="11"

# Setup any other config commands. This is basically the iwconfig argument

# without the iwconfig $iface

#iwconfig_eth0=""

# Set private driver ioctls. This is basically the iwpriv argument without

# the iwpriv $iface

#iwpriv_eth0=""

# We can define various timeouts here.

sleep_scan_eth0="1"

sleep_associate_eth0="5"

# By default a successful association in Managed mode sets the MAC

# address of the AP connected to. However, some drivers (namely

# the ipw2100) don't set an invalid MAC address when association

# fails - so we need to check on link quality which some drivers

# don't report properly either.

# So if you have connection problems try flipping this setting

# Valid options are MAC, quality and all - defaults to MAC

associate_test_eth1="quality"

# Some driver/card combinations need to scan in Ad-Hoc mode

# After scanning, the mode is reset to the one defined above

#scan_mode_eth0="Ad-Hoc"

# Below you can define private ioctls to run before and after scanning

# Format is the same as the iwpriv_eth0 above

# This is needed for the HostAP drivers

#iwpriv_scan_pre_eth0="host_roaming 2"

#iwpriv_scan_post_eth0="host_roaming 0"

# Define a WEP key per ESSID or MAC address (of the AP, not your card)

# You can't use "any" for an ESSID here

key_PorthosNet="xxxxxxxxxxxxxxxxxxxxxxxxx"

# or you can use strings. Passphrase IS NOT supported

# Note - this example also sets the encryption method to open

# which is regarded as more secure than restricted

# The encryption type (open or restricted) must match the

# encryption type on the Access Point

#key_ESSID="s:foobar enc open"

#key_ESSID="s:foobar enc restricted"

# WEP key for the AP with MAC address 001122334455

#mac_key_001122334455="s:foobar"

# Here are some more examples of keys as some users find others work

# and some don't where they should all do the same thing

#key_ESSID="open s:foobar"

#key_ESSID="open 1234-5678-9012"

#key_ESSID="s:foobar enc open"

#key_ESSID="1234-5678-9012 enc open"

# You may want to set muliple keys - here's an example

# It sets 4 keys on the card and instructs to use key 2 by default

#key_ESSID="[1] s:passkey1 key [2] s:passkey2 key [3] s:passkey3 key [4] s:passkey4 key [2]"

# You can also override the interface settings found in /etc/conf.d/net

# per ESSID - which is very handy if you use different networks a lot

#ifconfig_ESSID=( "dhcp" )

#dhcpcd_ESSID="-t 5"

#inet6_ESSID=()

#routes_ESSID=()

#ifconfig_fallback_ESSID=()

# iproute-2 style setup

#ipaddr_ESSID=( "dhcp" )

#iproute_ESSID=()

#ipaddr_fallback_ESSID=()

# Setting name/domain server causes /etc/resolv.conf to be overwritten

# Note that if DHCP is used, and you want this to take precedence then

# please put -R in your dhcpcd options

#nameserver_ESSID="192.168.0.1"

#domain_ESSID="some.domain"

# You can also set any of the /etc/conf.d/net variables per MAC address

# incase you use Access Points with the same ESSID but need different

# networking configs. Below is an example - of course you use the same

# method with other variables

#mac_ifconfig_001122334455=( "dhcp ")

#mac_dhcpcd_001122334455="-t 10"

# LEAP users will want to use the preassociate setting to specify

# an authentication script

#preassociate_ESSID="/run/this/script"

# Map a MAC address to an ESSID

# This is used when the Access Point is not broadcasting it's ESSID

# WARNING: This will override the ESSID being broadcast due to some

# Access Points sending an ESSID even when they have been configured

# not too!

# Change 001122334455 to the MAC address and ESSID to the ESSID

# it should map to

#essid_001122334455="ESSID"

# This lists the preferred ESSIDs to connect to in order

# ESSID's can contain any characters here as they must match the broadcast

# ESSID exactly.

# Surround each ESSID with the " character and seperate them with a space

# If the first ESSID isn't found then it moves onto the next

# If this isn't defined then it connects to the first one found

preferred_aps=( "PorthosNet" )

# You can also define a preferred_aps list per interface

#preferred_aps_eth0=( "ESSID 3" "ESSID 4" )

# You can also say whether we only connect to preferred APs or not

# Values are "yes" and "no"

# Default is "no"

#preferred_only="no"

#preferred_only_eth0="no"

# You can define blacklisted Access Points in the same way

#blacklist_aps=( "ESSID 1" "ESSID 2" )

#blacklist_aps_eth0=( "ESSID 3" ESSID 4" )

# If you have more than one wireless card, you can say if you want

# to allow each card to associate with the same Access Point or not

# Values are "yes" and "no"

# Default is "yes"

#unique_ap="yes"

#unique_ap_eth0="yes"

# IMPORTANT: preferred_aps, preferred_only, blacklisted_aps and

# unique_ap only work when essid_eth0 is  not set and your card

# is capable of scanning

# NOTE: preferred_aps  list ignores blacklisted_aps - so if you have

# the same ESSID in both, well, you're a bit silly :p

```

Every thing is rock solid in windoze, so... what am I doing wrong?

Cheers,

Roboguy

----------

## UberLord

 *Zidge wrote:*   

> I still have connection problems (even when I disable WEP encryption)

 

Have you tried the associate_test and sleep_associate variables with different values?

If you still have problems, please post the full script output

----------

## UberLord

 *roboguy wrote:*   

> Hi all,
> 
> I hate to say it but my connectivity problems persist. This is really driving me nuts as my wireless was rock solid for months, then the last few weeks...

 

Well what changed? Either something changed or the signal quality/strength has dropped due to interfance from something.

WEP key different? (updated windows and not linux) WEP type changed?

----------

## roboguy

 *UberLord wrote:*   

>  *roboguy wrote:*   Hi all,
> 
> I hate to say it but my connectivity problems persist. This is really driving me nuts as my wireless was rock solid for months, then the last few weeks... 
> 
> Well what changed? Either something changed or the signal quality/strength has dropped due to interfance from something.
> ...

 

The WEP key definately hasn't changed. 

I have considered interferance as two of my neighbours have wireless as well and my wireless interface can see both of these networks. But, if that were the problem wouldn't I be having problems in windows as well?

I tried configuring the interface on the command line this morning using iwconfig, but that didn't seem to work either... ( I may have made a mistake as I was in a big hurry so will try this again this evening.)

I will also try turning WEP off and see if that effects it. How is WEP handled in linux anyway?

Cheers for your help!

Roboguy

----------

## UberLord

 *roboguy wrote:*   

> 
> 
> The WEP key definately hasn't changed. 
> 
> I have considered interferance as two of my neighbours have wireless as well and my wireless interface can see both of these networks. But, if that were the problem wouldn't I be having problems in windows as well?

 

Possible. Ensure that both networks are on different channels. Also, the windows driver may be better at handling networks sharing channels than Linux driver

 *Quote:*   

> 
> 
> I tried configuring the interface on the command line this morning using iwconfig, but that didn't seem to work either... ( I may have made a mistake as I was in a big hurry so will try this again this evening.)

 

Well, thats the thing. If you can't make it work on the command line, I'm cannot fix it in the script

 *Quote:*   

> I will also try turning WEP off and see if that effects it. How is WEP handled in linux anyway?

 

It may help.

WEP is handled by the driver for the card

----------

## roboguy

 *UberLord wrote:*   

> 
> 
> Possible. Ensure that both networks are on different channels. 
> 
> 

 

I haven't tried finding out what channels the neighbouring networks are on. Is there an easy way to do this?

 *UberLord wrote:*   

> 
> 
> Well, thats the thing. If you can't make it work on the command line, I'm cannot fix it in the script
> 
> 

 

Well, I guess I wasn't entirely suggesting that it was a problem with the script (in fact I'm sure it's probably not   :Wink:   ). I am just looking for some advice from people who know alot more about wireless networking than I do!

 *UberLord wrote:*   

> 
> 
>  *Quote:*   I will also try turning WEP off and see if that effects it. How is WEP handled in linux anyway? 
> 
> It may help.
> ...

 

I will give this a go and post results this evening.

Cheers,

Roboguy

----------

## UberLord

 *roboguy wrote:*   

>  *UberLord wrote:*   
> 
> Possible. Ensure that both networks are on different channels. 
> 
>  
> ...

 

```
iwlist eth0 scan
```

Should report the channels - if your card is associated then it will only report what it's associated with.

----------

## ferris5

hi,

i got also a problem, probaly doing something stupid, here is my config.

```

essid_eth1="name_name"

essid_eth1="name_name01"

essid_eth1="name_name02"

preferred_aps=("Redbus Interhouse", "Redbus Interhouse01", "Redbus Interhouse02")

preferred_only=no

key_name_name=""

key_name_name01="xxxxxxxxx"

key_name_name02="xxxxxxxxx"

```

Well the problem is it tries to connect to name_name02 thats somewhere else, after a while its saying:

```

failed to configure wireless for eth1

preup for eth1 failed

```

when i change the config like this:

```

essid_eth1="name name"

#essid_eth1="name_name01"

#essid_eth1="name_name02"

preferred_aps=("Redbus Interhouse", "Redbus Interhouse01", "Redbus Interhouse02")

preferred_only=no

```

the above "name name"  without the _ is no mistype.

what am i doing wrong?

----------

## UberLord

 *ferris5 wrote:*   

> hi,
> 
> i got also a problem, probaly doing something stupid

 How did you guess  :Rolling Eyes:  *Quote:*   

> what am i doing wrong?

 When you specify an ESSID for an interface, that's exactly what it does - no scanning, no preferred lists, just that ESSID.

So, comment all the essid_eth1's out

----------

## roboguy

 *UberLord wrote:*   

>  *roboguy wrote:*    *UberLord wrote:*   
> 
> Possible. Ensure that both networks are on different channels. 
> 
>  
> ...

 

Well, I am on a different net work to the neighbours. I have also changed one line in my wireless config and tonight I managed to connect!

```

key_PorthosNet="xxxxxxxxxxxxxxxxxxxxxxxx"

```

is now

```

key_PorthosNet="xxxxxxxxxxxxxxxxxxxxxxxx enc open"

```

It still remains to be seen whether this will be reliable...

Cheers,

Roboguy

----------

## ixtow

This nifty little bit has been very useful.  It kinda turns me on, in a sick and twisted sort of way.

(that's how I say much thanks to the almighty author)

----------

## Zidge

wow

ok Uberlord, I finally managed to make it work

I don't know what changes were the good ones, anyway, I used

```
 

/usr/bin/loadndisdriver -a

```

and then:

```

iwconfig wlan0 essid Ricquet

dhcpcd wlan0

```

and it went up immediatly !!!!

(sadly, for now, net.wlan0 script doesn't work, I guess wrong config still)

tomorrow I'll try to add a WEP key, but my router interface requires Internet Explorer !!!!!!!!!!!!!!!!!!!!

anyway, thank you for your support !!!

----------

## kamina

So judging from the first post WPA is not supported? Is there another way to connect with WPA as I need it for my accesspoint at work...

----------

## GurliGebis

Does this work with newest baselayout?

----------

## UberLord

 *kamina wrote:*   

> So judging from the first post WPA is not supported? Is there another way to connect with WPA as I need it for my accesspoint at work...

 

You can look into using wpa_supplicant. I'll be trying to integrate that into wireless-config after I get a few other projects off my plate.

If you can get it working, and have the skills, you can always submit a patch for WPA  :Smile: 

----------

## UberLord

 *GurliGebis wrote:*   

> Does this work with newest baselayout?

 

Yes.

----------

## MrStaticVoid

I just got the new baselayout (1.10.4).  Is it normal not to see the output of my net.ath0 script on startup?  I have it set to the default runlevel and it starts, its just that no output is shown.  Strange.

----------

## iverson0881

I have the baselayout you have installed and I see the output. But in 1.9.4-r? sometimes it didn't show the output sometimes it did. I don't know why it behaved so. Didn't really care because it connected properly displaying or not. It shows up though if you look at ur logs and go to ur F12 terminal.

----------

## UberLord

 *Mr. Static Void wrote:*   

> I just got the new baselayout (1.10.4).  Is it normal not to see the output of my net.ath0 script on startup?  I have it set to the default runlevel and it starts, its just that no output is shown.  Strange.

 

Whats happening is that hotplug is starting the card before net.ath0 does. Hotplug starts it silently, so you see no output, but rc-status reports net.ath0 as started.

It's not strange - it's hotplug! If this bothers you, you can always remove the net.agent script in the hotplug folder.

----------

## Onnelinen

I'm having a strange problem... 

My wireless card works perfectly if i set all the options manually.  But I can't get the script to do anything. I have inserted the hack for /etc/conf.d/net, i also edited /etc/conf.d/wireless. 

When I do /etc/init.d/net.eth1 start eth1 is brought up just as if it were a normal network card. The wireless.sh script is probably not even being called. What obvious fact do I fail to see?

----------

## UberLord

I'm assuming that you can see the wireless hook in /etc/conf.d/net right?

If not, the check that you have a recent version of net.eth0

----------

## Onnelinen

 *UberLord wrote:*   

> I'm assuming that you can see the wireless hook in /etc/conf.d/net right?
> 
> If not, the check that you have a recent version of net.eth0

 

yes.. the hook seems fine, and i only just installed gentoo, so i guess my net.eth0 is quite recent.. maybe too recent?

----------

## UberLord

 *Onnelinen wrote:*   

> yes.. the hook seems fine, and i only just installed gentoo, so i guess my net.eth0 is quite recent.. maybe too recent?

 

Doubtfull ....

Do you see anything in the output for wireless?

----------

## kzan

ok...i know i'm doing something completely stupid, but can anyone tell me why I am getting this...

```

root@laptop /etc/init.d # /etc/init.d/net.eth1 start

find: /etc/net.modules.d/: No such file or directory

 * Loading networking scripts...

 *   modules:                                                                                 [ ok ]

 * Running preup function

 *   Configuring wireless network for eth1

 *   Scanning for access points

 *     Found "OFFICE" at 00:0F:3D:61:FF:2A (WEP required)

 *     Found "wlan3" at 00:20:A6:4F:4B:35 

 *     Found "wlan4" at 00:0D:88:3E:94:D5 (WEP required)

 *     Found "wlan5" at 00:20:A6:50:9F:0B 

 *   Connecting to "OFFICE" (WEP enabled)...                                               [ ok ]

 *     eth1 connected to "OFFICE" in managed mode

 *     on channel 3 (WEP enabled)

 * configuration has not been set!

```

I have tried everything I can think of without a solution...

----------

## kamina

 *UberLord wrote:*   

> 
> 
> Q. I'm seeing Wireless extensions not found for $interface - but it's a wireless device!
> 
> A. You need to enable wireless-extensions in your kernel.
> ...

 

I have this excact problem. I started to edit .config file, but I don't have any line for CONFIG_NET_WIRELESS in the whole file. I found CONFIG_NET_RADIO and enabled that though... Should it work like this, do I add that line in there myself (and does it matter where?), or what should I do?

edit: I have the 2.6.7-gentoo-r11kernel.

----------

## kzan

yep...it was as dump as I thought...i forgot to copy the net.modules.d folder to /etc/.  Sorry about that...

 :Shocked: 

----------

## Onnelinen

 *UberLord wrote:*   

> 
> 
> Do you see anything in the output for wireless?

 

Sorry for the late reply... been away for a while. What do you mean by the output for wireless? You mean the output i should get from /etc/init.d/net.wlan0 start ? There I do not get any wireless specific information... The hook in /etc/conf.d/net i am sure i have. My card works with the hostap_pci drivers. I can use iwconfig as i should.. I am actually surfing using my wireless card, so the problem is not hardware-related. What else should be present to use the script apart from the hook and net.wlan0? (my net.wlan0 is a copy of net.eth0)

----------

## bungernut

I really apprecieate the script and thanks for all the work. I have a question though. What do you do after the HOW-To to get things working? For example I believe that i have the device physically working 

iwconfig

```
 root@lappy bung # iwconfig eth1

eth1      IEEE 802.11b/g  ESSID:"RebelForce"  

          Mode:Managed  Channel:6  Access Point: 00:C0:49:D8:EC:7C  

          Bit Rate:36Mb/s   Tx-Power=31 dBm   Sensitivity=20/200  

          Retry min limit:8   RTS thr:2347 B   Fragment thr:2346 B   

          Encryption key:off

          Link Quality:188/0  Signal level:-68 dBm  Noise level:-53 dBm

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

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

```

ifconfig

```
 eth0      Link encap:Ethernet  HWaddr 00:08:74:E4:0A:1A  

          inet addr:192.168.0.5  Bcast:192.168.0.255  Mask:255.255.255.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:1051 errors:0 dropped:0 overruns:0 frame:0

          TX packets:609 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:914232 (892.8 Kb)  TX bytes:60928 (59.5 Kb)

          Interrupt:11 Base address:0xec80 

eth1      Link encap:Ethernet  HWaddr 00:05:5D:FA:69:BC  

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:172 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:20694 (20.2 Kb)  TX bytes:0 (0.0 b)

          Interrupt:11 

...

```

Notice how IP is not set on eth1 BTW???  :Question: 

But now how do i use it now? it seems odd that no one else has had similar questions, i have to be missing something simple  :Embarassed:  . If i ping, linux uses the eth0 port, even while unplugged.

Simillarrly what is the hook doing in /etc/conf.d/net exactly? redirecting wireless to eth0 or just using the script?

Some people have net.eth1 scripts in /etc/init.d/ whereas I do not, how did this happen? Seeing how I dident acquire a net.eth1 script how would i get the wireless to automatically start up?

I am using a DWL-G650 PCMCIA card in a DELL INSPIRON 8200.

Thanks in advance for learning my confused self...

/etc/conf.d/net

```
 iface_eth0="192.168.0.5 broadcast 192.168.0.255 netmask 255.255.255.0"

iface_eth1="192.168.0.6 broadcast 192.168.0.255 netmask 255.255.255.0"

gateway="eth0/192.168.0.1"

source /etc/init.d/wireless.sh

preup() {

        wireless_up ${1}

        return $?

}

predown() {

        wireless_down ${1}

        return $?

} 
```

/etc/conf.d/wireless

```

essid_eth1="RebelForce"

mode_eth1="Managed"

channel_eth1="6"

sleep_scan_eth1="1"

sleep_associate_eth1="5"

```

EDIT

After submitting this and doing a 

```
 ifconfig eth1 192.168.0.7 netmask 255.255.255.0 up
```

 i can now do a ping -I eth1 192.168.0.1 and get pings. But now how do i get the whole linux box to start using eth1 when it looses eth0?

----------

## gmccague

I'm bored with crappy instructions...

What are the proper steps to install this script? I get a "Specific key requires an operator (net-wireless/wireless-config-0.5.5)"

How about putting what we are supposed to be typing to execute each step of this tip? Some examples?

What about adding some code snippets of examples for PORTOVER what the freaking variable is?

I love this distro and hate it at the same time. I'm not sure it is worth the effort.

----------

## UberLord

 *kzan wrote:*   

> ok...i know i'm doing something completely stupid, but can anyone tell me why I am getting this...
> 
> ```
> 
> root@laptop /etc/init.d # /etc/init.d/net.eth1 start
> ...

 

I know that you found the solution, but it's only fair to point out that the net-scripts package is still in early days and is completely un-supported by me at this stage. Unless you get me on IM that is...

----------

## UberLord

 *Onnelinen wrote:*   

>  *UberLord wrote:*   
> 
> Do you see anything in the output for wireless? 
> 
> Sorry for the late reply... been away for a while. What do you mean by the output for wireless? You mean the output i should get from /etc/init.d/net.wlan0 start ? There I do not get any wireless specific information... The hook in /etc/conf.d/net i am sure i have. My card works with the hostap_pci drivers. I can use iwconfig as i should.. I am actually surfing using my wireless card, so the problem is not hardware-related. What else should be present to use the script apart from the hook and net.wlan0? (my net.wlan0 is a copy of net.eth0)

 

That's the problem I think - net.wlan0 should be a symlink to net.eth0 instead of a direct copy.

----------

## UberLord

 *bungernut wrote:*   

> 
> 
> After submitting this and doing a 
> 
> ```
> ...

 

The actual problem is that both NICs are using the same network, and I'm not sure how apps use NICs when both "do the same". AFAIK it's the first one that comes up.

As to using eth1 when eth0 is down, I suggest looking into the ifplugd package for eth0. You may have problems using it with eth1 - if so, set eth1 to start at default and write some code in the preup to check if eth1 is being started and cause a fail (return1) if eth0 is running. I think I posted code (untested) which does this a page or two back.

----------

## UberLord

 *gmccague wrote:*   

> I'm bored with crappy instructions...

 

Most people can follow mine - write some better ones if you can.

 *Quote:*   

> 
> 
> What are the proper steps to install this script? I get a "Specific key requires an operator (net-wireless/wireless-config-0.5.5)"

 

I gave proper steps in the 1st post on this page. I think your error is because you put -0.5.5 in /etc/portage/package.keywords[/quote]

 *Quote:*   

> 
> 
> How about putting what we are supposed to be typing to execute each step of this tip? Some examples?

 

I thought I did ........

Yep, just double checked.

 *Quote:*   

> 
> 
> What about adding some code snippets of examples for PORTOVER what the freaking variable is?

 

PORTDIR_OVERLAY is a variable that specifies a portage overlay directory - so you can put ebuilds like this in which do not get affected when you do an emerge sync.

Thats a Gentoo variable - why don't you read some of their docs?

 *Quote:*   

> 
> 
> I love this distro and hate it at the same time. I'm not sure it is worth the effort.

 

I took the effort to write this script. I'm a developer not a documentator. I write code for a day job because I do it well. My company employs other people to write documentation because I don't document that well.

I wrote this script in my spare time, off my own back and try to support it to the best of my ability. If you don't like that then you can shove it my friend.

----------

## MrSandman666

Praise the Lord! Praise the UberLord for sendung us this script!

Great work! Was actually much easier to set up and to handle than I expected!

Is there any chance we'll see this in portage any time soon?

----------

## GreenPea

 *UberLord wrote:*   

>  *GreenPea wrote:*   
> 
> Now my antena stays off until I /etc/init.d/net.wlan0 start  and it turns off when I /etc/init.d/net.wlan0 stop.
> 
> I understand this is not for everyone, but it works well for me since I am wired most of the time and want my wireless only when I want it.
> ...

 

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

> 
> 
> This is the process I was hoping for:
> 
> (durring boot)-> start eth0 IF DHCP success -> skip trying wlan0 and move on with the rest of the start up  IF eth0 DHCP timout or fails -> try wlan0 (success or fail) move on with boot
> ...

 

OK - this is tricky

You will need to put both eth0 and wlan0 in default runlevel for both to start

eth0 will always be tried first (rc goes in alpha order)

So, you need to add some code to preup to case a failure if the iface is wlan0 and eth0 is started

```

local status=$( rc-status default | awk '/net.eth0/ {print $3}' | grep started )

if [[ -n ${status} ]]; then

        eerror "net.eth0 has been started - aborting net.wlan0 startup"

        return 1

fi

```

I really appreciate you help with this btw.  I am fairly convinced that these two pieces of code need to be tied together for this to work as hoped for?    I have tried putting them together with no success, hence why I state previously, I am not a coder....   :Embarassed:   May I ask your indulgence one more time?

Thanks

GP

----------

## Avantopia

When I log into Gnome now that I have my pcmcia wireless 802.11b orinoco card up and running the splash screen freezes. I can't get past the splash screen. If I log into Gnome and THEN run my wifi everything is fine. What would cause this? I can't seem to pin point the issue. It seems to have something to do with the gnome-smproxy application and my pcmcia setup.

----------

## imesg

Can I do this:

perffered_aps=( "my-essid" "any" )

If so, how can I get my wlan device to use dhcp if it falls back to "any"?

The IP for "my-essid" is static.

If I can not do this how can I scan for "my-essid" first and set a static IP and fall back to "any" and use dhcp if "my-essid" is not available?

Thanks,

Gene

----------

## UberLord

 *MrSandman666 wrote:*   

> Is there any chance we'll see this in portage any time soon?

 

Yes it will end up in portage. When I cannot say as wireless is part of something much bigger  :Wink: 

Hopefully Soon   :Smile: 

----------

## UberLord

 *Avantopia wrote:*   

> When I log into Gnome now that I have my pcmcia wireless 802.11b orinoco card up and running the splash screen freezes. I can't get past the splash screen. If I log into Gnome and THEN run my wifi everything is fine. What would cause this? I can't seem to pin point the issue. It seems to have something to do with the gnome-smproxy application and my pcmcia setup.

 

I'd say it's something "network" related rather than "wireless" related.

AFAIK the fix is to set your hostname.domainname against 127.0.0.1 in /etc/hosts

----------

## UberLord

 *imesg wrote:*   

> Can I do this:
> 
> perffered_aps=( "my-essid" "any" )

 

No. You can do preferred_aps=( "my-essid" )

Then set a static ip for my-essid

```
ifconfig_my_essid="192.168.0.1 broadcast 192.168.0.255 netmask 255.255.255.0" )
```

Here's the clever bit - you set the iface for dhcp by default

```
ifconfig_eth0=( "dhcp" )
```

You may be thinking WTF at this point, but here's how it works.

All variables in conf.d/net are loaded before the net.eth0 actually runs. So when the wireless script runs it can overwrite (in memory, not the disk) any variables already set.

So what we've done here it configure a default of DHCP, but when it connects to my-essid then it sets a static IP.

You can use the same trick with all variables found in /etc/conf.d/net  :Smile: 

----------

## UberLord

 *GreenPea wrote:*   

> 
> 
> I really appreciate you help with this btw.  I am fairly convinced that these two pieces of code need to be tied together for this to work as hoped for?    I have tried putting them together with no success, hence why I state previously, I am not a coder....    May I ask your indulgence one more time?
> 
> 

 

```

###########################################

# Hook wireless into /etc/init.d/net.eth0

# Please note, these lines should appear

# at the END of the file

source /etc/init.d/wireless.sh

preup() {

        local iface=${1}

        if [[ wlan0 == ${iface} ]]; then

                local status=$( /etc/init.d/net.eth0 status | grep started )

                if [[ -n ${status} ]]; then

                        eerror "net.eth0 has been started - aborting net.wlan0 startup"

                        return 1

                fi

                modprobe ndiswrapper

                wireless_up ${iface}

                return $?

        fi

        return 0

}

postdown() {

        local iface=${1}

        if [[ wlan0 == ${iface} ]]; then

             wireless_down ${iface}

             rmmod ndiswrapper

             return $?

        else

             return 0

        fi

}

# End hook

###########################################

```

There you go  :Smile: 

----------

## imesg

Thanks, uberlord for the help and the script.

 *UberLord wrote:*   

>  *imesg wrote:*   Can I do this:
> 
> perffered_aps=( "my-essid" "any" ) 
> 
> No. You can do preferred_aps=( "my-essid" )
> ...

 

I also had to set the default gw in /etc/conf.d/wireless, so for reference for anyone else that might want to do it this way, I had to do this also:

```
 routes_my-essid=( "default gw my-gateway" )
```

Where 'routes_my-essid' is really 'routes_ESSID'.

 *Quote:*   

> 
> 
> Here's the clever bit - you set the iface for dhcp by default
> 
> ```
> ...

 

----------

## GreenPea

BINGO!!!  UberLord you are my personal hero for the week! It all works as advertised.  With the PreUP additions you wrote all I do is boot.  eth0 is checked and if it does not get an address, wlan0 comes up.  If wlan0 does not come up, the antenna stays off saving power.  

It is people like you that make running Linux more useful than running Windoze.  Thank you very much.

----------

## ToddWest

Ive tried to fix this on my own but I just cant figure out whats going on. I installed ndiswrapper with my IPW2200 and I can start it perfectly on my own:

```
iwconfig wlan0 mode Managed

iwconfig wlan0 key XXXXXXXXXXXXXXXXXXXXXXXXXX

iwconfig wlan0 essid myessid

dhcpcd wlan0
```

But I dont want to have to start it manually every time I reboot. So I tried using this script but Im stuck and cant figure out how to fix it. If I run /etc/init.d/net.wlan0 start it says this:

```
 * Running preup function

 *   Configuring wireless network for wlan0

 *   Scanning for access points

 *     Found XX:XX:XX:XX:XX:XX (WEP required)

 *   Trying to force preferred incase they are hidden

 *   Connecting to "myessid" (WEP enabled)...                          [ ok ]

 *     wlan0 connected to "myessid" in managed mode

 *     on channel 06 (WEP disabled)

 * Bringing wlan0 up via DHCP...

```

My AP is running WEP 128-bit. I dont understand why its saying (WEP disabled) when Im setting the key and everything in my /etc/conf.d/wireless file. Here is my wireless config file:

```
# /etc/conf.d/wireless:

# Global wireless config file for net.* rc-scripts

##############################################################################

# HINTS

##############################################################################

# Remember to change eth0 to your wireless interface which may be

# eth0, eth1, wlan0, ath0 - you get the idea. If you're not sure

# you can type "iwconfig" at the command prompt and it will tell you which

# interfaces are wireless.

# Say that your wireless interface is ath0 - the line

#      #essid_eth0="any"

# becomes

#      #essid_ath0="any"

#

# Remember to change ESSID to your ESSID.

# Say that your ESSID is My NET - the line

#      #key_ESSID="s:passkey"

# becomes

#      #key_My_NET="s:passkey"

# Notice that the space has changed to an underscore - do the same with all

# characters not in a-z A-Z (english alphabet) 0-9.

#

# Any ESSID's in quotes like essid_eth0="My NET" may need to be escaped

# This means placing the character \ before the character

# \" need to be escaped for example

# So if your ESSID is

#      My "\ NET

# it becomes

#      My \"\\ NET

# for example

#      #essid_eth0="My\"\\NET"

#

# As a final note, most users will just need to set the following options

# key_ESSID1="s:yourkeyhere enc open"

# key_ESSID2="s:yourothrkey enc open"

# preferred_aps=( "ESSID1" "ESSID2" )

#

# Clear? Good. Now configure your wireless network below

#########################################################

##############################################################################

# SETTINGS

##############################################################################

# Hard code an ESSID to an interface - leave this unset if you wish the driver

# to scan for available Access Points

# Set to "any" to connect to any ESSID - the driver picks an Access Point

# This needs to be done when the driver doesn't support scanning

# This may work for drivers that don't support scanning but you need automatic

# AP association

# I would only set this as a last resort really - use the preferred_aps

# setting at the bottom of this file

# However, using ad-hoc (without scanning for APs) and master mode

# do require the ESSID to be set - do this here

#essid_wlan0="myessid"

# Set the mode of the interface (managed, ad-hoc or master). Managed is default

# If it's ad-hoc or master you also may need to specify the channel below

#mode_wlan0="Managed"

# If managed mode fails, drop to ad-hoc mode with the below ESSID?

#adhoc_essid_eth0="myessid"

#Channel can be set (1-14), but defaults to 3 if not set.

#

# The below is taken verbatim from the BSD wavelan documentation found at

# http://www.netbsd.org/Documentation/network/wavelan.html

# There are 14 channels possible; We are told that channels 1-11 are legal for

# North America, channels 1-13 for most of Europe, channels 10-13 for France,

# and only channel 14 for Japan. If in doubt, please refer to the documentation

# that came with your card or access point. Make sure that the channel you

# select is the same channel your access point (or the other card in an ad-hoc

# network) is on. The default for cards sold in North America and most of Europe

# is 3; the default for cards sold in France is 11, and the default for cards

# sold in Japan is 14.

channel_wlan0="6"

# Setup any other config commands. This is basically the iwconfig argument

# without the iwconfig $iface

#iwconfig_eth0=""

# Set private driver ioctls. This is basically the iwpriv argument without

# the iwpriv $iface

#iwpriv_eth0=""

# We can define various timeouts here.

#sleep_scan_eth0="1"

#sleep_associate_eth0="5"

# By default a successful association in Managed mode sets the MAC

# address of the AP connected to. However, some drivers (namely

# the ipw2100) don't set an invalid MAC address when association

# fails - so we need to check on link quality which some drivers

# don't report properly either.

# So if you have connection problems try flipping this setting

# Valid options are MAC, quality and all - defaults to MAC

#associate_test_eth0="quality"

# Some driver/card combinations need to scan in Ad-Hoc mode

# After scanning, the mode is reset to the one defined above

#scan_mode_eth0="Ad-Hoc"

# Below you can define private ioctls to run before and after scanning

# Format is the same as the iwpriv_eth0 above

# This is needed for the HostAP drivers

#iwpriv_scan_pre_eth0="host_roaming 2"

#iwpriv_scan_post_eth0="host_roaming 0"

# Define a WEP key per ESSID or MAC address (of the AP, not your card)

# You can't use "any" for an ESSID here

key_myessid="XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XX"

# or you can use strings. Passphrase IS NOT supported

# Note - this example also sets the encryption method to open

# which is regarded as more secure than restricted

# The encryption type (open or restricted) must match the

# encryption type on the Access Point

#key_ESSID="s:foobar enc open"

#key_ESSID="s:foobar enc restricted"

# WEP key for the AP with MAC address 001122334455

#mac_key_001122334455="s:foobar"

# Here are some more examples of keys as some users find others work

# and some don't where they should all do the same thing

#key_ESSID="open s:foobar"

#key_myessid="open XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XX"

#key_ESSID="s:foobar enc open"

#key_ESSID="1234-5678-9012 enc open"

# You may want to set muliple keys - here's an example

# It sets 4 keys on the card and instructs to use key 2 by default

#key_ESSID="[1] s:passkey1 key [2] s:passkey2 key [3] s:passkey3 key [4] s:passkey4 key [2]"

# You can also override the interface settings found in /etc/conf.d/net

# per ESSID - which is very handy if you use different networks a lot

#ifconfig_ESSID=( "dhcp" )

#dhcpcd_ESSID="-t 5"

#inet6_ESSID=()

#routes_ESSID=()

#ifconfig_fallback_ESSID=()

# iproute-2 style setup

#ipaddr_ESSID=( "dhcp" )

#iproute_ESSID=()

#ipaddr_fallback_ESSID=()

# Setting name/domain server causes /etc/resolv.conf to be overwritten

# Note that if DHCP is used, and you want this to take precedence then

# please put -R in your dhcpcd options

#nameserver_ESSID="192.168.0.1"

#domain_ESSID="some.domain"

# You can also set any of the /etc/conf.d/net variables per MAC address

# incase you use Access Points with the same ESSID but need different

# networking configs. Below is an example - of course you use the same

# method with other variables

#mac_ifconfig_001122334455=( "dhcp ")

#mac_dhcpcd_001122334455="-t 10"

# LEAP users will want to use the preassociate setting to specify

# an authentication script

#preassociate_ESSID="/run/this/script"

# Map a MAC address to an ESSID

# This is used when the Access Point is not broadcasting it's ESSID

# WARNING: This will override the ESSID being broadcast due to some

# Access Points sending an ESSID even when they have been configured

# not too!

# Change 001122334455 to the MAC address and ESSID to the ESSID

# it should map to

#essid_001122334455="ESSID"

# This lists the preferred ESSIDs to connect to in order

# ESSID's can contain any characters here as they must match the broadcast

# ESSID exactly.

# Surround each ESSID with the " character and seperate them with a space

# If the first ESSID isn't found then it moves onto the next

# If this isn't defined then it connects to the first one found

#preferred_aps=( "ESSID 1" "ESSID 2" )

# You can also define a preferred_aps list per interface

#preferred_aps_eth0=( "ESSID 3" "ESSID 4" )

preferred_aps=( "myessid" )

# You can also say whether we only connect to preferred APs or not

# Values are "yes" and "no"

# Default is "no"

#preferred_only="no"

#preferred_only_eth0="no"

# You can define blacklisted Access Points in the same way

#blacklist_aps=( "ESSID 1" "ESSID 2" )

#blacklist_aps_eth0=( "ESSID 3" ESSID 4" )

# If you have more than one wireless card, you can say if you want

# to allow each card to associate with the same Access Point or not

# Values are "yes" and "no"

# Default is "yes"

#unique_ap="yes"

#unique_ap_eth0="yes"

# IMPORTANT: preferred_aps, preferred_only, blacklisted_aps and

# unique_ap only work when essid_eth0 is  not set and your card

# is capable of scanning

# NOTE: preferred_aps  list ignores blacklisted_aps - so if you have

# the same ESSID in both, well, you're a bit silly :p

```

Some more info about my setup:

gentoo-dev-sources 2.6.8-r2

Pentium M 1.60Ghz w/ Centrino

IPW2200 with WEP 128-bit

0.10 ndiswrapper

Thanks.

----------

## Michen

Hi,

I've got your script working easily with DLINK 650+ and AP DLINK 624+.

I can ping and the connection goes infinitely.

When I start transferring files the connection suddenly dies after about 1 second.

What could it be?

----------

## Avantopia

 *Quote:*   

> PostPosted: Wed Aug 25, 2004 3:44 am    Post subject: Re: WIFI freezes GNOME  	Reply with quote
> 
> Avantopia wrote:
> 
> When I log into Gnome now that I have my pcmcia wireless 802.11b orinoco card up and running the splash screen freezes. I can't get past the splash screen. If I log into Gnome and THEN run my wifi everything is fine. What would cause this? I can't seem to pin point the issue. It seems to have something to do with the gnome-smproxy application and my pcmcia setup.
> ...

 

This did not fix the issue unfortunately. I think it may have to do with the fact that I have 2 iface entries in my net config file and and during the pcmcia setup at boot cardmgr complains about eth2 already being setup. I am unsure how to debug this networking issue. Any ideas where to start if /etc/hosts isn't the cause? thanks for the help.

----------

## Cheesepie

Uberlord, just wanted to say thanks for an awesome script!

I couldn't get WEP working at first, but then I removed the "s:" from the WEP key and it worked. Now I'm sitting on the curb at the corner using the gentoo forums on my laptop  :Mad: 

Quick question though, what does the default "s:" in the WEP key do?

----------

## imesg

 *Quote:*   

> Quick question though, what does the default "s:" in the WEP key do?

 

A hexidecimal number follows.

----------

## ragnarr

Hi Uberlord, I just installed gentoo last sunday.  I have a wireless lynksis PCI card using prism II / orinoco (not sure which one of those is the driver and which one is the chipset).  

Anyhow, Ive been searching for something to help me get my network up, this discussion board here looks like it will be very helpfull, however it is very LONGG!!!,   Im basically going to start from the beginning,  I'll try to keep track of all the posts here, but I will definatly have some questions for you ( I will try not to post a repeated question but if I do just point me to where you answered it please).

No questions at the moment though, Im at work today but tomorro night Im going to give this a shot and I will probably have some specific questions then, I appreciate your help on this, thanks.

----------

## snekiepete

Sorry if this has been covered in this thread, but how do I get rid of the "no such device" errors when I boot with the card not plugged in. pcmcia does not start my card automatically so I have net.eth1 start right after pcmcia. I used to boot with out this message, but after a new install it started this. I am using  the prism54 drivers and the card works great, it's just an ugly boot.

----------

## nife

I have the same problem that someone else was having.  I see no wireless specific info comming up.  basically it looks like none of the wireless sutff is being run since I am connecting to ap with no encryption. 

/etc/conf.d/net

```

*SNIP* 

###########################################

# Hook wireless into /etc/init.d/net.eth0

# Please note, these lines should appear

# at the END of the file

source /etc/init.d/wireless.sh

preup() {

        wireless_up ${1}

        return $?

}

predown() {

        wireless_down ${1}

        return $?

}

# End hook

###########################################

*SNIP*

```

/etc/conf.d/wireless

```

essid_ath0="any"

# Set the mode of the interface (managed, ad-hoc or master). Managed is default

# If it's ad-hoc or master you also may need to specify the channel below

mode_eth0="Managed"

key_Wireless="*REMOVED* enc open"

key_REMOVED="*REMOVED* enc open"

preferred_aps=( "Wireless" "*REMOVED*")

```

ls -al /etc/init.d/

```

*SNIP*

lrwxrwxrwx  1 root root     8 Aug 25 11:26 net.ath0 -> net.eth0

-rwxr-xr-x  1 root root  4963 Jul 20 23:04 net.eth0

*SNIP*

```

modprobe -l

```
Module                  Size  Used by

ath_pci                54820  0 

wlan                  114368  2 ath_pci

ath_hal               125648  2 ath_pci

snd_via82xx            28036  0 

snd_ac97_codec         68484  1 snd_via82xx

snd_mpu401_uart         7552  1 snd_via82xx

snd_rawmidi            24932  1 snd_mpu401_uart

via_rhine              20872  0 

```

ifconfig

```

ath0      Link encap:Ethernet  HWaddr 00:0F:3D:CA:79:92  

          inet addr:192.168.0.5  Bcast:192.168.0.255  Mask:255.255.255.0

          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:2944 errors:106 dropped:0 overruns:0 frame:106

          TX packets:1174 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:199 

          RX bytes:2045125 (1.9 Mb)  TX bytes:198022 (193.3 Kb)

          Interrupt:11 Memory:ce9e0000-ce9f0000

```

iwconfig

```

ath0      IEEE 802.11g  ESSID:"Wireless"  

          Mode:Managed  Frequency:2.447GHz  Access Point: 00:09:5B:48:99:9A  

          Bit Rate:11Mb/s   Tx-Power:50 dBm   Sensitivity=0/3  

          Retry:off   RTS thr:off   Fragment thr:off

          Encryption key:off

          Power Management:off

          Link Quality:35/94  Signal level:-60 dBm  Noise level:-95 dBm

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

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

```

.config

```

*SNIP*CONFIG_NET_RADIO=y

#

# Obsolete Wireless cards support (pre-802.11)

#

CONFIG_STRIP=m

CONFIG_ARLAN=m

CONFIG_WAVELAN=m

CONFIG_PCMCIA_WAVELAN=m

CONFIG_PCMCIA_NETWAVE=m

#

# Wireless 802.11 Frequency Hopping cards support

#

CONFIG_PCMCIA_RAYCS=m

#

# Wireless 802.11b ISA/PCI cards support

#

CONFIG_AIRO=m

CONFIG_HERMES=m

CONFIG_PLX_HERMES=m

CONFIG_TMD_HERMES=m

CONFIG_PCI_HERMES=m

CONFIG_ATMEL=m

CONFIG_PCI_ATMEL=m

#

# Wireless 802.11b Pcmcia/Cardbus cards support

#

CONFIG_PCMCIA_HERMES=m

CONFIG_AIRO_CS=m

CONFIG_PCMCIA_ATMEL=m

CONFIG_PCMCIA_WL3501=m

#

# Prism GT/Duette 802.11(a/b/g) PCI/Cardbus support

#

CONFIG_PRISM54=m

CONFIG_NET_WIRELESS=y

*SNIP*

```

Basically I am stumped.  The hooks are there.  The hardware works, the settings seem right.

EDIT:  I saw that there was a problem with my /etc/conf.d/wireless that I had an eth0 instead of ath0 when setting the mode.  That has been fixed and still the same problem persists.... DA*N

----------

## nife

Linux NifeLap 2.6.7-ck5 #17 Tue Aug 17 23:30:27 EST 2004 i686 mobile AMD Athlon(tm) XP-M 2200+ AuthenticAMD GNU/Linux

Thats the kernel btw

----------

## nife

YAY so I solved it myself.  I had a really old version of /etc/init.d/net.eth0 

I hate etc-config! just saying I do I really really do

----------

## Cheesepie

 *imesg wrote:*   

>  *Quote:*   Quick question though, what does the default "s:" in the WEP key do? 
> 
> A hexidecimal number follows.

 

If thats the case, why does my key not work when I include the "s:" (it works when I remove it; I am using 128 bit

----------

## oMega505

Hi, I just installed gentoo for the first time and Im having a bit of problems with the wireless card

I am curerntly using an intel 2200 BG, the corresponding ipw2200 drivers have been installed and are up and running (autoloaded and they show up when i lsmod) 

Anyways, I followed the steps in this guide but when I try to start the eth1 (my wireless card) this comes up.

```

bash-2.05b# /etc/init.d/net.eth1 restart

 * Running preup function

 *   Configuring wireless network for eth1

/sbin/runscript.sh: line 759: error: command not found

 * Failed to configure wireless for eth1

 * preup eth1 failed

```

also, when I emerge the wireless config the second step gives me some warnings

```
 

* /etc/conf.d/net already looks like it's been patched

 * or contains a custom preup() function

 *

 * or you are using >=sys-apps/baselayout-1.10

```

I have already configured the /etc/conf.d/wireless file to match my network

Thanks! :S

----------

## nife

 *oMega505 wrote:*   

> Hi, I just installed gentoo for the first time and Im having a bit of problems with the wireless card
> 
> I am curerntly using an intel 2200 BG, the corresponding ipw2200 drivers have been installed and are up and running (autoloaded and they show up when i lsmod) 
> 
> Anyways, I followed the steps in this guide but when I try to start the eth1 (my wireless card) this comes up.
> ...

 

Make sure that eth1 is the correct interface.  Usually wireless interfaces are either ath0-9 or wlan0-9 eth0-9 are usually reserved for wired connections.  do an iwconfig and what shows up will show you what you need to see.

----------

## nife

Ok I am having a weird problem.  Whenever I try to use the wireless-config script I am never able to associate with an AP.  Basically what happens is it try all of the AP's and none of them work.  however if I remove the hook and try running

iwconfig enc 000000000000000 open

/etc/init.d/net.ath0 restart it will work.

obviously thats not the encryption key, but whatever you get the idea.

What could be happening to stop my wireless card from associating with an AP.  It tries to force the association.  The encription keys are the same.  And even trying to connect to an un-encrypted Ap fails.  What setting am I missing ?  Using MadWiFi drivers on a D-Link DWL-G650

here is the result of dmesg so you will know 

```

ath_hal: module license 'Proprietary' taints kernel.

ath_hal: 0.9.9.13

wlan: 0.8.2.4-WPA (EXPERIMENTAL)

ath_pci: no version for "ieee80211_ioctl_siwrate" found: kernel tainted.

ath_pci: 0.9.2.2-WPA (EXPERIMENTAL)

PCI: Enabling device 0000:02:00.0 (0000 -> 0002)

ath0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps

ath0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps

ath0: mac 5.9 phy 4.3 5ghz radio 4.6

ath0: 802.11 address: 00:0f:3d:ca:79:92

ath0: Use hw queue 0 for WME_AC_BE traffic

ath0: Use hw queue 1 for WME_AC_BK traffic

ath0: Use hw queue 2 for WME_AC_VI traffic

ath0: Use hw queue 3 for WME_AC_VO traffic

ath0: Atheros 5212: mem=0x10800000, irq=11

```

anyway, even though its nt working right now due I'm sure to another mistake I've made.  I do want to thank everyone who has devoloped this script.

----------

## oMega505

Strangely enough, eth1 is the correct interface, it shows up when i iwconfig...

BTW, i got my wireless card working, but each time i want to use it i have to log on to root and " iwconfig eth1 essid "name" key 12123 && dhcpcd eth1 "

at least i got it working, any way to do this automatically?

thanks!

----------

## TiE10

i followed your script, and after a while of trying to figure out how to set up the conf.d/wireless thing, i came up with this:

```

mode_eth1="managed"          

essid_eth1="DLINK-HOME"  # DLINK-HOME is my router's name

scan_mode_eth1="adhoc"      # Router isn't adhoc, but i had to specify a channel and only              way to do that was in adhoc mode...

adhoc_channel_eth1="6"

sleep_scan_eth1="2"

sleep_associate_eth1="5"

key_DLINK_HOME="s:000FB5349C enc open"     # enc open after the key to specify the encryption as open

preffered_aps=( "DLINK-HOME" "linksys" )

```

it seemed to work, it was the farthest i had got, i got WEP enabled and everything. only it seems to have a problem receiving an IP address as this is the result:

```

tie10@phoenix4188 tie10 $ startwlan

 * Running preup function

 *   Configuring wireless network for eth1

 *   Connecting to "DLINK-HOME" (WEP enabled)...                          [ ok ]

 *     eth1 connected to "DLINKHOME" in managed mode

 *     on channel 06 (WEP enabled)

 * Bringing eth1 up via DHCP...                                           [ !! ]                                                 

```

i'm not sure if this will help anyone help me, but this is my iwconfig:

```

eth1      IEEE 802.11-DS  ESSID:"DLINK-HOME"  Nickname:"HERMES I"

          Mode:Managed  Frequency:2.437GHz  Access Point: 00:0D:88:9F:E9:55  

          Bit Rate:11Mb/s   Tx-Power=15 dBm   Sensitivity:1/3  

          Retry limit:4   RTS thr:off   Fragment thr:off

          Encryption key:3030-3046-4235-3334-3943-0000-00

          Power Management:off

```

what is going wrong...?

----------

## TiE10

 *Quote:*   

> 
> 
> BTW, i got my wireless card working, but each time i want to use it i have to log on to root and " iwconfig eth1 essid "name" key 12123 && dhcpcd eth1 " 
> 
> 

 

if you edit your /etc/conf.d/net and add

```

iface_eth1="dhcp"

```

somewhere in there, i'm pretty sure it should automatically set your eth1 to dhcp...

and your key should be set in the /conf.d/wireless

not completely sure yet.. but I think that's right.

----------

## Zyne

everything is working perfectly here, but I seem to have one little "warning" that I'ld like to get rid of if possible... :p

```

Warning: Driver for device wlan0 has been compiled with version 17

of Wireless Extension, while this program is using version 16.

Some things may be broken...

```

Is there any way to fix this?

lspci gives me:

```

0000:01:09.0 Network controller: Broadcom Corporation BCM4306 802.11b/g Wireless LAN Controller (rev 03)

```

```
 # ndiswrapper -l

Installed ndis drivers:

bcmwl5  hardware present
```

[edit]

well... Fixed it for now... 

Just re-emerging the wireless-tools fixed all my problems  :Very Happy: Last edited by Zyne on Tue Aug 31, 2004 7:34 am; edited 1 time in total

----------

## TiE10

I just realzied how to make my card scan, but, alas, it doesn't work:

```

tie10@phoenix4188 tie10 $ startwlan

 * Running preup function

 *   Configuring wireless network for eth1

 *   Scanning for access points

 * eth1 does not support scanning!

 * You need to configure an ESSID in /etc/conf.d/wireless

 *     essid_eth1="ESSID"

 *     (set to "any" to pick the strongest available access point)

 * or configure preferred_aps to force a list of access points

 * or configure defaulting to Ad-Hoc when Managed fails

 * Failed to configure wireless for eth1

 * preup eth1 failed

```

All I did to my con.d/wireless was take out the essid_eth1= "DLINK-HOME" to make it try to scan. I'm pretty sure its a problem with my own computer. The reason I ask is because I know my card can scan, as it did scan in windows xp, but I'm not sure how to make it work in linux...

----------

## BloodyNewbie

Hi all,

I followed all your explanations but still I get stuck with problems, where I shouldnt:

First question: ath_hal, ath_pci, wlan ... you talk of them constantly as modules, why that? can't I integrate them in my kernel with "y" instead of "m" ?

And there my problem begins:

```
iwconfig ath0

"no such device"

```

I wanted ath0 as my wireless device, but it's not that it has no wireless extensions(there CONFIG_NET_WIRELESS set to "y" in the kernel config would be the solution afaik), no, it doesn't even exist!

But I do have it, made with:

```
ln -s net.eth0 net.ath0

```

But I have more questions  :Smile:   -->

modprobe wlan (and ath_hal and ath_pci) gives me

```
FATAL: Module xx not found.

```

Which entries are these in the kernel config?

And why do I have to set them as modules, anyway?

As you already might be thinking:

```

lsmod

```

shows no modules(I don't really like 'em)

If you know an answer to any of the above questions, I would highly appreciate to hear it  :Smile: 

SEE the steps, I followed:

http://www.masi.li/own/gentoo/Gentoo_auf_T40p.pdf

AND of course this thread here  :Smile: 

c ya and thanks

Patrick

PS: I re-emerged wireless-tools as well after the newest kernel update(2.6.8-r1)

----------

## joejag

Great scripts, though the server is currently down.

Is there a mirror anywhere?  I don't mind hosting them on my domain as a mirror as these are vital to anyone trying to get wireless working on gentoo.

Could someone else please upload the tar.gz please.

Thanks,

Joe.

----------

## boobytrapped

 *joejag wrote:*   

> Great scripts, though the server is currently down.
> 
> Is there a mirror anywhere?  I don't mind hosting them on my domain as a mirror as these are vital to anyone trying to get wireless working on gentoo.
> 
> Could someone else please upload the tar.gz please.
> ...

 

Indeed. The server with the ebuild is down - does anyone have a mirror I can download the file from?

----------

## joejag

Yeah, I have the ebuild from my other computer but not the tar.gz.  Is there a reason why these files and ebuild aren't part of the main portage tree?  As far as I can tell they are critical for wi-fi and having the files on just one homepage is madness!

Also I just noticed my new WG311 card is being recongised as a:

```
0000:02:08.0 Network controller: Texas Instruments ACX 111 54Mbps Wireless Interface
```

Does this still work with the Prisim54 driver?  I've seen a few posts that say it does/doesn't

Thanks,

Joe.

----------

## mdognrdog

I've  been using this thing for the whole summer, and just went back to school today.  I added the information for the school's AP, did a

'/etc/init.d/net.ath0 restart'

and was off and running.  But when I came home, it kept trying to associate with the named AP at school, then dying.  

As soon as I commented out the lines that mentioned the school AP, my home AP worked, too.

Am I mistaken in thinking that every time I run /etc/init.d/net.ath0, the script should try to run through my list of APs in sequence until it finds one?

----------

## UberLord

 *ToddWest wrote:*   

> Ive tried to fix this on my own but I just cant figure out whats going on. I installed ndiswrapper with my IPW2200 and I can start it perfectly on my own:
> 
> ```
> iwconfig wlan0 mode Managed
> 
> ...

 

Looks like you're hiding the ESSID.

You need to map the AP's MAC address (which you have blacked out with XX:XX) to the correct ESSID.

Then it should start working

----------

## UberLord

 *Michen wrote:*   

> Hi,
> 
> I've got your script working easily with DLINK 650+ and AP DLINK 624+.
> 
> I can ping and the connection goes infinitely.
> ...

 

Could be anything really. I would guess that the problem is with interferance with the wireless signal or you're too far from the AP.

----------

## UberLord

 *Cheesepie wrote:*   

> Uberlord, just wanted to say thanks for an awesome script!
> 
> I couldn't get WEP working at first, but then I removed the "s:" from the WEP key and it worked. Now I'm sitting on the curb at the corner using the gentoo forums on my laptop 
> 
> Quick question though, what does the default "s:" in the WEP key do?

 

s: means that it's an ASCII key instead of a HEX key.

key_ESSID="s:ABCD"

key_ESSID="6566-6768"

The above two settings are exactly the same.

----------

## UberLord

 *snekiepete wrote:*   

> Sorry if this has been covered in this thread, but how do I get rid of the "no such device" errors when I boot with the card not plugged in. pcmcia does not start my card automatically so I have net.eth1 start right after pcmcia. I used to boot with out this message, but after a new install it started this. I am using  the prism54 drivers and the card works great, it's just an ugly boot.

 

I also have a Prism54 pcmcia card and have the same issue. I would guess it's either a hotplug or pcmcia-cs problem.

One solution would be to use a bootsplash package  :Wink: 

----------

## UberLord

 *TiE10 wrote:*   

> i followed your script, and after a while of trying to figure out how to set up the conf.d/wireless thing, i came up with this:
> 
> ```
> 
> mode_eth1="managed"          
> ...

 

Here's a revised config that should work

```

essid_eth1="DLINK-HOME"  # DLINK-HOME is my router's name

sleep_associate_eth1="5"

key_DLINK_HOME="s:000FB5349C enc open"     # enc open after the key to specify the encryption as open

```

Hermes chipsets cannot scan by default (afaik), so many options such as preferred_aps will not work unless you get a scanning patch for the default kernel driver.

With managed mode, you should not have to specify a channel.

----------

## TiE10

ah. thx, everythign is working fine now. one more question though.. anyone know how I would go about getting a scanning patch for my kernel that would work for me?

thx again, and your script is great

----------

## UberLord

 *BloodyNewbie wrote:*   

> 
> 
> First question: ath_hal, ath_pci, wlan ... you talk of them constantly as modules, why that? can't I integrate them in my kernel with "y" instead of "m" ?

 

You can use either really.

I prefer to load everything into my kernel directly as my hardware is fairy static.

Third party kernel modules (such as the madwifi driver) are normally built as modules as integrating the source into your kernel tree and rebuilding the kernel is normally harder than having them as seperate modules.

However, they are still "modules" or "drivers" whether they are built directly into the kernel or not.

 *Quote:*   

> 
> 
> And there my problem begins:
> 
> ```
> ...

 

Aha!

Have you emerged the madwifi driver? You need the madwifi driver to get your device to work - it's not included in any kernel tree atm...

----------

## UberLord

 *TiE10 wrote:*   

> ah. thx, everythign is working fine now. one more question though.. anyone know how I would go about getting a scanning patch for my kernel that would work for me?
> 
> thx again, and your script is great

 

http://www.tzi.de/~plasmahh/orinoco.html

I'm not sure that it works on the 2.6.8 kernels though ...

I'm sure it does work on 2.6.3 kernel as I used to have an orinoco card at this time - but not anymore.

----------

## UberLord

 *joejag wrote:*   

> Great scripts, though the server is currently down.
> 
> Is there a mirror anywhere?  I don't mind hosting them on my domain as a mirror as these are vital to anyone trying to get wireless working on gentoo.
> 
> Could someone else please upload the tar.gz please.
> ...

 

Sorry - I'm currently moving server.

Now I just need to get my ADSL line working at my new home  :Smile: 

Temp mirror

http://www.rsm.demon.co.uk/wireless-config-0.5.5.ebuild

http://www.rsm.demon.co.uk/wireless-config-0.5.5.tar.bz2

----------

## UberLord

 *joejag wrote:*   

> Yeah, I have the ebuild from my other computer but not the tar.gz.  Is there a reason why these files and ebuild aren't part of the main portage tree?  As far as I can tell they are critical for wi-fi and having the files on just one homepage is madness!

 

It's not in portage as my ebuild really sucks (the ebuild, not the wireless script  :Wink:  )

However, my wireless script will be in portage in another form soon - I'm working with some Gentoo guys on this  :Smile: 

 *Quote:*   

> 
> 
> Also I just noticed my new WG311 card is being recongised as a:
> 
> ```
> ...

 

No, you need the acx100 driver.

----------

## UberLord

 *mdognrdog wrote:*   

> 
> 
> Am I mistaken in thinking that every time I run /etc/init.d/net.ath0, the script should try to run through my list of APs in sequence until it finds one?

 

Set the preferred_aps variable in /etc/conf.d/wireless to define which order you should connect in

Don't set essit_eth0="" - comment it out.

----------

## mdognrdog

Now I think I get it  :Idea:  ; you get a choice between the "preferred_aps" mode, and the "hardwired ESSID" mode.  Oh boy, I can't wait to head in to school and test.   :Very Happy: 

----------

## mdognrdog

This isn't really a wireless question, but you've put a lot of thought into this mult-homing wireless problem:

Is it possible to get the networking init script to run automatically when the computer wakes up from a suspend?  It would be nice, though hardly essential, to have my computer look around for an AP every time I open the lid.

----------

## snekiepete

 *UberLord wrote:*   

>  *snekiepete wrote:*   Sorry if this has been covered in this thread, but how do I get rid of the "no such device" errors when I boot with the card not plugged in. pcmcia does not start my card automatically so I have net.eth1 start right after pcmcia. I used to boot with out this message, but after a new install it started this. I am using  the prism54 drivers and the card works great, it's just an ugly boot. 
> 
> I also have a Prism54 pcmcia card and have the same issue. I would guess it's either a hotplug or pcmcia-cs problem.
> 
> One solution would be to use a bootsplash package 

 

Ok thanks Uberlord, great stuff by the way!!!!

----------

## UberLord

 *snekiepete wrote:*   

>  *UberLord wrote:*    *snekiepete wrote:*   Sorry if this has been covered in this thread, but how do I get rid of the "no such device" errors when I boot with the card not plugged in. pcmcia does not start my card automatically so I have net.eth1 start right after pcmcia. I used to boot with out this message, but after a new install it started this. I am using  the prism54 drivers and the card works great, it's just an ugly boot. 
> 
> I also have a Prism54 pcmcia card and have the same issue. I would guess it's either a hotplug or pcmcia-cs problem.
> 
> One solution would be to use a bootsplash package  
> ...

 

The reason why I said that is that my previous pcmcia card (prism II based) didn't have this problem - hence it's not a problem with my wireless stuff.

Just in case I wasn't clear ....

----------

## UberLord

 *mdognrdog wrote:*   

> This isn't really a wireless question, but you've put a lot of thought into this mult-homing wireless problem:
> 
> Is it possible to get the networking init script to run automatically when the computer wakes up from a suspend?  It would be nice, though hardly essential, to have my computer look around for an AP every time I open the lid.

 

There are tools todo this job for you - ifplugd may work and it's in portage. waproamd can also do this (it's by the same author as ifplugd) but it has it's own wireless setup making mine redundant and it's no way near as flexible as mine.

/me shrugs

I do have a small program though that monitors link quality and restarts the interface if it drops to zero. I haven't touched the source in ages (more pressing matters) and it probably has bugs, but if you're interested I can send you the source - you'll have to compile it yourself though. However, I don't have the time right now to support it.

----------

## dbasinge

 *ToddWest wrote:*   

> Ive tried to fix this on my own but I just cant figure out whats going on. I installed ndiswrapper with my IPW2200 and I can start it perfectly on my own:
> 
> 

 

Have you tried the native ipw2200 driver, work great for me.

Mike

----------

## Sargon

Could someone put the ebuild and .bz2 file host somewhere? Both the initial URL nor the temporary one seem to work for me at the moment...

Thanks!

Sargon

----------

## UberLord

 *Sargon wrote:*   

> Could someone put the ebuild and .bz2 file host somewhere? Both the initial URL nor the temporary one seem to work for me at the moment...
> 
> 

 

Sorry - my ISP has some weird system when moving ADSL when I moved house.

New temp URLs

http://rsm1.demon.co.uk/~roy/downloads/wireless-config-0.5.5.ebuild

http://rsm1.demon.co.uk/~roy/downloads/wireless-config-0.5.5.tar.bz2

I've updated 1st post in this thread with the new temp links

Hopefully I get my hostname changed over the next few days ...

----------

## Sargon

 *UberLord wrote:*   

> New temp URLs
> 
> http://rsm1.demon.co.uk/~roy/downloads/wireless-config-0.5.5.ebuild
> 
> http://rsm1.demon.co.uk/~roy/downloads/wireless-config-0.5.5.tar.bz2

 

Thanks! The package is simple to configure and works like a charm here. Hope it becomes an "official" gentoo package soon, in this or another form.

Sargon

----------

## UberLord

 *Sargon wrote:*   

> Thanks! The package is simple to configure and works like a charm here. Hope it becomes an "official" gentoo package soon, in this or another form.

 

Definitely another form  :Wink: 

----------

## inode77

I just don't get it...... Manually with simple one-line iwconfig command all works fine but with cool UberLord script no luck so far....

Hopefully somebody can help and point to were my mistake is.

Here is some info and sort of log about my situation:

```

> ap:

Netgear WG614R v1 b/g wireless router

std: 802.11b

acces mode: open

essid: ABC

key 1: 1234-1234-1234-1234-1234-1234-12

no essid broadcast

mac filtered

mac in list: 00:11:22:33:44:55

> laptop:

IBM Thinkpad T40p

Gentoo 2004.2, 2.6.7-r4 kernel header NPTL, 2.6.8-gentoo-r3 kernel

Atheros a/b wireless card from IBM

> lspci:

0000:02:02.0 Ethernet controller: Atheros Communications, Inc. AR5211 802.11ab NIC (rev 01)

Subsystem: Unknown device 17ab:8310

Flags: bus master, medium devsel, latency 168, IRQ 11

Memory at c0210000 (32-bit, non-prefetchable)

Capabilities: [44] Power Management version 2

> dmesg:

wlan: 0.8.4.2 (EXPERIMENTAL)

ath_hal: 0.9.11.6

ath_pci: no version for "ieee80211_ioctl_siwrate" found: kernel tainted.

ath_pci: 0.9.4.0 (EXPERIMENTAL)

ath0: 11a rates: 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps

ath0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps

ath0: mac 4.2 phy 3.0 5ghz radio 1.7 2ghz radio 2.3

ath0: 802.11 address: 00:11:22:33:44:55

ath0: Use hw queue 0 for WME_AC_BE traffic

ath0: Use hw queue 0 for WME_AC_BK traffic

ath0: Use hw queue 0 for WME_AC_VI traffic

ath0: Use hw queue 0 for WME_AC_VO traffic

ath0: Atheros 5211: mem=0xc0210000, irq=11

> old bootscript:

#!/bin/bash

/sbin/modprobe ath_pci

/usr/sbin/iwconfig ath0 essid ABC key open 1234-1234-1234-1234-1234-1234-12

/etc/init.d/net.ath0 start

> iwconfig -v:

iwconfig  Version 26

        Compatible with Wireless Extension v16 or earlier,

        Currently compiled with Wireless Extension v16.

Kernel  Currently compiled with Wireless Extension v16.

ath0    Recommend Wireless Extension v13 or later,

        Currently compiled with Wireless Extension v16.

> iwconfig:

ath0      IEEE 802.11b  ESSID:"ABC"                                                                                                              

          Mode:Managed  Frequency:2.462GHz  Access Point: 55:44:33:22:11:00                                                                      

          Bit Rate:11Mb/s   Tx-Power:50 dBm   Sensitivity=0/3

          Retry:off   RTS thr:off   Fragment thr:off

          Encryption key:1234-1234-1234-1234-1234-1324-12   Security mode:open

          Power Management:off

          Link Quality:38/94  Signal level:-57 dBm  Noise level:-95 dBm

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

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

>ifconfig:

ath0      Link encap:Ethernet  HWaddr 00:11:22:33:44:55

          inet addr:192.168.1.153  Bcast:192.168.1.255  Mask:255.255.255.0

          inet6 addr: fe80::205:4fff:ffff:fff/64 Scope:Link

          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:74 errors:6 dropped:0 overruns:0 frame:6

          TX packets:22 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:199

          RX bytes:7855 (7.6 Kb)  TX bytes:3142 (3.0 Kb)

          Interrupt:11 Memory:e0cca000-e0cda000

>iwlist ath0 scan:

ath0      Scan completed :

          Cell 01 - Address: 55:44:33:22:11:00

                    ESSID:"ABC"

                    Mode:Master

                    Frequency:2.462GHz

                    Quality:37/94  Signal level:-58 dBm  Noise level:-95 dBm

                    Encryption key:on

                    Bit Rate:1Mb/s

                    Bit Rate:2Mb/s

                    Bit Rate:5Mb/s

                    Bit Rate:11Mb/s

                    Extra:bcn_int=100

> iwpriv -all ath0:

ath0      Available read-only private ioctl :

Interface doesn't accept private ioctl...

getoptie (8BE9): Invalid argument

Interface doesn't accept private ioctl...

getkey (89F3): Invalid argument

<mapping sub-ioctl get_turbo to cmd 0x8BE1-1>

ath0      get_turbo:0

<mapping sub-ioctl get_mode to cmd 0x8BE1-2>

ath0      get_mode:2

<mapping sub-ioctl get_authmode to cmd 0x8BE1-3>

ath0      get_authmode:1

<mapping sub-ioctl get_protmode to cmd 0x8BE1-4>

ath0      get_protmode:1

<mapping sub-ioctl get_mcastcipher to cmd 0x8BE1-5>

ath0      get_mcastcipher:1

<mapping sub-ioctl get_mcastkeylen to cmd 0x8BE1-6>

ath0      get_mcastkeylen:16

<mapping sub-ioctl get_uciphers to cmd 0x8BE1-7>

ath0      get_uciphers:15

<mapping sub-ioctl get_ucastcipher to cmd 0x8BE1-8>

ath0      get_ucastcipher:0

<mapping sub-ioctl get_ucastkeylen to cmd 0x8BE1-9>

ath0      get_ucastkeylen:13

<mapping sub-ioctl get_roaming to cmd 0x8BE1-12>

ath0      get_roaming:1

<mapping sub-ioctl get_privacy to cmd 0x8BE1-13>

ath0      get_privacy:1

<mapping sub-ioctl get_countermeasu to cmd 0x8BE1-14>

ath0      get_countermeasu:0

<mapping sub-ioctl get_dropunencryp

 to cmd 0x8BE1-15>

 ath0      get_dropunencryp

 :0

 <mapping sub-ioctl get_wpa to cmd 0x8BE1-10>

 ath0      get_wpa:0

 <mapping sub-ioctl get_driver_caps to cmd 0x8BE1-16>

 ath0      get_driver_caps:124165

 <mapping sub-ioctl get_wme to cmd 0x8BE1-18>

 ath0      get_wme:0

 <mapping sub-ioctl get_hide_ssid to cmd 0x8BE1-19>

 ath0      get_hide_ssid:0

 <mapping sub-ioctl get_ap_bridge to cmd 0x8BE1-20>

 ath0      get_ap_bridge:1

> ping:

PING www.heise.de (193.99.144.71) 56(84) bytes of data.

64 bytes from www.heise.de (193.99.144.71): icmp_seq=1 ttl=243 time=24.4 ms

--- www.heise.de ping statistics ---

1 packets transmitted, 1 received, 0% packet loss, time 0ms

rtt min/avg/max/mdev = 24.428/24.428/24.428/0.000 ms

>>> Works fine manual with old script! <<<

> UberLord wireless script:

sleep_scan_ath0="1"

sleep_associate_ath0="5"

key_ABC="1234-1234-1234-1234-1234-1234-12"

> /etc/init.d/net.ath0 start:

* Running preup function

*   Configuring wireless network for ath0

*   Scanning for access points

* ath0 does not support scanning!

* You need to configure an ESSID in /etc/conf.d/wireless

*     essid_ath0="ESSID"

*     (set to "any" to pick the strongest available access point)

* or configure preferred_aps to force a list of access points

* or configure defaulting to Ad-Hoc when Managed fails

* Failed to configure wireless for ath0

* preup ath0 failed

> Uberlord wireless script:

sleep_scan_ath0="1"

sleep_associate_ath0="5"

key_ABC="1234-1234-1234-1234-1234-1234-12"

essid_ath0="any"

> /etc/init.d/net.ath0 start:

* Running preup function

*   Configuring wireless network for ath0

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

*   Scanning for access points

*     Found 55:44:33:22:11:00 (WEP required)

* Couldn't find any access points on ath0

* Failed to configure wireless for ath0

* preup ath0 failed

```

THX for trying to help!

----------

## UberLord

 *inode77 wrote:*   

> I just don't get it...... Manually with simple one-line iwconfig command all works fine but with cool UberLord script no luck so far....
> 
> Hopefully somebody can help and point to were my mistake is.
> 
> 

 

You're hiding your ESSID - as such, you need to map the AP's MAC address to it's ESSID

```
mac_essid_55:44:33:22:11:00="ABC"
```

Obviously you've changed the ESSID and MAC though....

What I don't understand is why your card doesn't support scanning as all athereos based devices I have supported it from a very early stage

----------

## inode77

 *Quote:*   

> 
> 
> You're hiding your ESSID - as such, you need to map the AP's MAC addres to it's ESSID 

 

Ok I added like your example a line to bind the essid to the mac address.

I rebuilt the modules (madwifi driver) once more to be sure to have uptodate drivers. (26.08.2004)

```

> UberLord wireless script

mac_essid_55:44:33:22:11="ABC"

> modules loaded && and interface start

root@stingray:init.d # /etc/init.d/net.ath0 start

/sbin/runscript.sh: line 123: mac_essid_55:44:33:22:11="ABC": command not found

 * Running preup function

 *   Configuring wireless network for ath0

 *   Scanning for access points

 * ath0 does not support scanning!

 * You need to configure an ESSID in /etc/conf.d/wireless

 *     essid_ath0="ESSID"

 *     (set to "any" to pick the strongest available access point)

 * or configure preferred_aps to force a list of access points

 * or configure defaulting to Ad-Hoc when Managed fails

 * Failed to configure wireless for ath0

 * preup ath0 failed

> iwlist ath0 scanning

ath0      Interface doesn't support scanning : Invalid argument

manual loading of essid and wep key && dhcpcd ath0

> iwlist ath0 scan

ath0      Scan completed :

          Cell 01 - Address: 55:44:33:22:11:00

                    ESSID:"ABC"

                    Mode:Master

                    Frequency:2.462GHz

                    Quality:23/94  Signal level:-72 dBm  Noise level:-95 dBm

                    Encryption key:on

                    Bit Rate:1Mb/s

                    Bit Rate:2Mb/s

                    Bit Rate:5Mb/s

                    Bit Rate:11Mb/s

                    Extra:bcn_int=100

```

I definitifly don't get it anymore before having a connection the interface returns "can not scan" and after successfull connection scanning is possible without a problem ?!?

And the script still seems to have some problems.

Thx for your help UberLord => I go for a short hopefully troublefree nap!

----------

## mottie

Stumbled across this howto with google (searched for wireless gentoo howto).  Was initially cursing your name as I came across http://wiki.gentoo-portage.com/HOWTO_Wireless_Configuration_and_Startup which is nothing but broken links.  Searched in despair for net-wireless/wireless-config-0.4.9.ebuild but was unable to find anything.

After finding this page I was able to get my wireless card (ipw2100) working within a few minutes.  Thanks for all your work and effort.  Much appreciated.

Would highly suggest updating the wiki, as it is the #1 answer on google :)

mottie

----------

## UberLord

 *inode77 wrote:*   

> 
> 
> > modules loaded && and interface start
> 
> root@stingray:init.d # /etc/init.d/net.ath0 start
> ...

 

My fault - remove the : from the line

mac_essid_5544332211="ABC"

Still, I would try remerging the madwifi driver as it should be able to scan

----------

## UberLord

 *mottie wrote:*   

> Stumbled across this howto with google (searched for wireless gentoo howto).  Was initially cursing your name as I came across http://wiki.gentoo-portage.com/HOWTO_Wireless_Configuration_and_Startup which is nothing but broken links.  Searched in despair for net-wireless/wireless-config-0.4.9.ebuild but was unable to find anything.
> 
> After finding this page I was able to get my wireless card (ipw2100) working within a few minutes.  Thanks for all your work and effort.  Much appreciated.
> 
> Would highly suggest updating the wiki, as it is the #1 answer on google 
> ...

 

Sorry about that - I'm unsure about how to update the wiki (lack of knowledge on my part).

----------

## epohs

i'm having trouble getting my Linksys WMP54GS wireless network card to recognize my WRT54GS router.

I've used ndiswrapper to get the drivers installed, and i think that part worked ok.  However,  i'm still not finding the network.  I'm very much a noob, so i'm not sure exactly what tools i have at my disposal, so i'll post beaucoup information in the hopes that some of it is helpful.   :Very Happy: 

iwconfig:

```
wlan0     IEEE 802.11g  ESSID:off/any

          Mode:Managed  Frequency:2.462GHz  Access Point: 00:00:00:00:00:00

          Bit Rate:54Mb/s   Tx-Power:24 dBm

          RTS thr:2347 B   Fragment thr:2346 B

          Encryption key:off

          Power Management:off

          Link Quality:100/100  Signal level:-10 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

```

ifconfig:

```
wlan0     Link encap:Ethernet  HWaddr 00:0F:66:70:41:0B

          inet addr:192.168.1.1  Bcast:192.168.1.6  Mask:255.255.255.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

          Interrupt:10 Memory:db000000-db001fff

```

dmesg | grep wlan0:

```
wlan0: ndiswrapper ethernet device 00:0f:66:70:41:0b using driver bcmwl5.sys

ndiswrapper device wlan0 supports WPA with AES/CCMP and TKIP ciphers

```

lspci -v:

```
0000:00:09.0 Network controller: Broadcom Corporation: Unknown device 4320 (rev 03)

        Subsystem: Linksys: Unknown device 0015

        Flags: fast devsel, IRQ 10

        [virtual] Memory at db000000 (32-bit, non-prefetchable) [disabled]

```

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

```
 * Running preup function

 *   Configuring wireless network for wlan0

 *   Scanning for access points

 *     no access points found

 * Couldn't find any access points on wlan0

 * Failed to configure wireless for wlan0

 * preup wlan0 failed
```

the AP seems to be broadcasting perfectly, as my XP box upstairs sees it just fine.

i'm running gentoo 2004.2, and the 2.6.7 kernel.

I would really appreciate any help you can offer.

Thanks again

----------

## BloodyNewbie

Hi all,

My Problem: I can't connect to my AP, but I can scan it.

using:

	-gentoo 2.6.8.1

	-wireless-tools emerged

	-wireless-config emerged and your ebuild 0.5.5

	-madwifi-driver NOT emerged but

	-madwifi-cvs emerged and ebuild 0.3 on it(src: http://gentoo.cipheralgo.org/ ) because of compile problems in 2.6.8.1

	-PCI Card is IBM a/b 168c:0012 (rev1)

kernelconfig

```

CONFIG_NET_WIRELESS=y

CONFIG_NET_RADIO=y

all drivers=m

```

lsmod

```

wlan

ath_hal

ath_pci

```

/etc/conf.d/net:

```

iface_ath0="dhcp"

source /etc/init.d/wireless.sh

preup() {

        wireless_up ${1}

        return $?

}

predown() {

        wireless_down ${1}

        return $?

}

```

/etc/conf.d/wireless:

```

essid_ath0="any"

mode_ath0="managed"

```

now the procedure:

ifconfig ath0 up

works

iwconfig ath0

```

ath0      IEEE 802.11  ESSID:""

          Mode:Managed  Frequency:5.6GHz  Access Point: FF:FF:FF:FF:FF:FF

          Bit Rate:6Mb/s   Tx-Power:50 dBm   Sensitivity=0/3

          Retry:off   RTS thr:off   Fragment thr:off

          Encryption key:off

          Power Management:off

          Link Quality:58/94  Signal level:-37 dBm  Noise level:-95 dBm

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

          Tx excessive retries:1266  Invalid misc:1266   Missed beacon:5

```

I can change the ESSID to the AP-ESSID with iwconfig ath0 essid apName but that doesn't change the Access Point Adress (FF:FF...)

iwlist ath0 scan

shows me the AP's around, works

now the funny part:

/etc/init.d/net.ath0 start

```

 * Running preup function

 *   Configuring wireless network for ath0

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

 *   Scanning for access points

 * ath0 does not support scanning!

 * You need to configure an ESSID in /etc/conf.d/wireless

 *     essid_ath0="ESSID"

 *     (set to "any" to pick the strongest available access point)

 * or configure preferred_aps to force a list of access points

 * or configure defaulting to Ad-Hoc when Managed fails

 * Failed to configure wireless for ath0

 * preup ath0 failed

```

As you can see, the procedure of starting this device made ifconfig ath0 down! I do have to put it up manually again afterwards with ifconfig ath0 up.

Now, if I change the essid_ath0 to my AP-name, it comes the following:

/etc/init.d/net.ath0 start

```

 * Running preup function

 *   Configuring wireless network for ath0

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

 * Failed to configure wireless for ath0

 * preup ath0 failed

```

Well, at the moment, I'm pretty desperate, it looks like the madwifi driver messes something up, but I don't know what it is.

I would appreciate any help, I could get. Thx a lot

----------

## UberLord

@BloodyNewbie - the madwifi driver is perfectly capable of scanning. I use this driver myself. However, I use the current portage one in ~x86 alongside gentoo-dev-sources. Once you get scanning to work - and remove essid_ath0="any" then it should start working.

----------

## markfl

When you say it will be in portage in another form what do you mean?

USE="wireless" emerge baselayout?

Mark

----------

## UberLord

@epohs - my script appears to be working flawlessly.

However, your chipset/driver/ndiswrapper are not. There was a user a few pages back who used the broadcom drivers that came on the CD instead of the newest ones and it started working.

Try mixing ndiswrapper and broadcom driver versions around.

----------

## UberLord

 *markfl wrote:*   

> When you say it will be in portage in another form what do you mean?
> 
> USE="wireless" emerge baselayout?

 

No.

Let's just say that the gentoo net scripts are getting a major overhaul  :Wink: 

Everything in place, I just need a Gentoo dev to give it the thumbs up ....

----------

## BloodyNewbie

@Uberlord: Now I put away the line essid_ath0="any" and receive:

```

/etc/init.d/net.ath0 start

 * Running preup function

 *   Configuring wireless network for ath0

 *   Scanning for access points

 * ath0 does not support scanning!

 * You need to configure an ESSID in /etc/conf.d/wireless

 *     essid_ath0="ESSID"

```

I also use ~x86 architecture.

I tried it with the madwifi-driver as well, no success, it always kicks out ath0 by somehow making ifconfig ath0 down !!

You can read it above:

```

 * ath0 does not support scanning!

```

I certainly AM very confused atm  :Sad: 

----------

## UberLord

 *BloodyNewbie wrote:*   

> 
> 
> I also use ~x86 architecture.
> 
> I tried it with the madwifi-driver as well, no success, it always kicks out ath0 by somehow making ifconfig ath0 down !!
> ...

 

What does 

```
iwlist ath0 scan
```

 return?

If it fails ensure that you have wireless extensions built into the kernel - if not, rebuild kernel, install it, reboot, re-emerge wireless-tools and then madwifi-driver

See 1st post in this thread about how to enable wireless extensions in the kernel

----------

## BloodyNewbie

@Uberlord: I didn't say, madwifi couldn't scan! It can, I wrote that. Now I put away the line essid_ath0="any" and receive:

```

/etc/init.d/net.ath0 start

 * Running preup function

 *   Configuring wireless network for ath0

 *   Scanning for access points

 * ath0 does not support scanning!

 * You need to configure an ESSID in /etc/conf.d/wireless

 *     essid_ath0="ESSID"

```

I also use ~x86 architecture.

I tried it with the madwifi-driver in portage as well, no success, it always kicks out ath0 by somehow making ifconfig ath0 down !!

You can read it above:

```

 * ath0 does not support scanning!

```

I certainly AM very confused atm  :Sad: 

here a dmesg output:

```

wlan: 0.8.4.2 (EXPERIMENTAL)

ath_hal: module license 'Proprietary' taints kernel.

ath_hal: 0.9.11.6

ath_pci: 0.9.4.0 (EXPERIMENTAL)

PCI: Found IRQ 11 for device 0000:02:02.0

PCI: Sharing IRQ 11 with 0000:00:1d.2

PCI: Sharing IRQ 11 with 0000:00:1f.1

ath0: 11a rates: 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps

ath0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps

ath0: mac 4.2 phy 3.0 5ghz radio 1.7 2ghz radio 2.3

ath0: 802.11 address: 00:05:4e:41:f1:35

ath0: Use hw queue 0 for WME_AC_BE traffic

ath0: Use hw queue 0 for WME_AC_BK traffic

ath0: Use hw queue 0 for WME_AC_VI traffic

ath0: Use hw queue 0 for WME_AC_VO traffic

ath0: Atheros 5211: mem=0xc0210000, irq=11

```

----------

## UberLord

 *BloodyNewbie wrote:*   

> @Uberlord: I didn't say, madwifi couldn't scan! It can, I wrote that. 

 

So whats the exact and full output of 

```
iwlist ath0 scan
```

----------

## BloodyNewbie

```

# iwlist ath0 scan

ath0      Scan completed :

          Cell 01 - Address: 00:80:C8:AC:ED:BD

                    ESSID:"trio doof"

                    Mode:Master

                    Frequency:2.437GHz

                    Quality:13/94  Signal level:-82 dBm  Noise level:-95 dBm

                    Encryption key:on

                    Bit Rate:1Mb/s

                    Bit Rate:2Mb/s

                    Bit Rate:5Mb/s

                    Bit Rate:11Mb/s

                    Bit Rate:22Mb/s

                    Extra:bcn_int=100

          Cell 02 - Address: 00:50:18:28:B4:3D

                    ESSID:"HalloNachbarn"

                    Mode:Master

                    Frequency:2.462GHz

                    Quality:67/94  Signal level:-28 dBm  Noise level:-95 dBm

                    Encryption key:off

                    Bit Rate:1Mb/s

                    Bit Rate:2Mb/s

                    Bit Rate:5Mb/s

                    Bit Rate:6Mb/s

                    Bit Rate:9Mb/s

                    Bit Rate:11Mb/s

                    Bit Rate:12Mb/s

                    Bit Rate:18Mb/s

                    Bit Rate:22Mb/s

                    Bit Rate:24Mb/s

                    Bit Rate:36Mb/s

                    Bit Rate:48Mb/s

                    Bit Rate:54Mb/s

                    Extra:bcn_int=100

```

first is my neighbor  :Smile:  second is my own

----------

## BloodyNewbie

do you now believe me?  :Smile: 

*  net-wireless/madwifi-cvs

      Latest version available: 0.3

      Latest version installed: 0.3

      Size of downloaded files: 1 kB

      Homepage:    http://sourceforge.net/projects/madwifi/

      Description: Multiband Atheros Driver for WiFi - CVS

      License:     GPL-2

*  net-wireless/madwifi-driver

      Latest version available: 0.1_pre20040824-r1

      Latest version installed: [ Not Installed ]

      Size of downloaded files: 1,693 kB

      Homepage:    http://madwifi.sourceforge.net/

      Description: Wireless driver for Atheros chipset a/b/g cards

      License:     GPL-2

----------

## BloodyNewbie

thanks to great help by Uberlord I could solve my problem, I documented it here:

https://forums.gentoo.org/viewtopic.php?t=218199

----------

## UberLord

 *BloodyNewbie wrote:*   

> 
> 
> ```
> 
> # iwlist ath0 scan
> ...

 

OK OK

Could you contact me tomorrow on IM 9:30am-18:30pm GMT +0 please?

If you can't make it in those times then PM me.

----------

## BlaZoR

Hi!

I'm having one problem with your wireless script (which is really good!!  :Very Happy: ),

I have a Netgear WG311T Wireless Card (with Atheros AR5212) and a Netgear WG624 Wireless Router, I can connect to the router, no problem, but he can't get a IP per DHCP, don't know why. When I try to manually add a IP I can't ping to the router or other things on LAN. I tried it with WEP and without, but no difference

any ideas? 

BlaZoR

----------

## ToddWest

 *UberLord wrote:*   

>  *ToddWest wrote:*   Ive tried to fix this on my own but I just cant figure out whats going on. I installed ndiswrapper with my IPW2200 and I can start it perfectly on my own:
> 
> ```
> iwconfig wlan0 mode Managed
> 
> ...

 

I have mapped the AP's MAC address to the correct ESSID but for some reason it is still not enabling WEP. It just keeps saying

 *     wlan0 connected to "myessid" in managed mode

 *     on channel 06 (WEP disabled)

What could this be?

----------

## dyqik

I've had problems getting the WEP key to be accepted in the ipw2200 windows drivers with ndiswrapper 0.9  The drivers often gave errors on the lines of "operation not supported" or "invalid parameters" when setting the WEP key or the ESSID.  I've not tried with ndiswrapper 0.10, as I've got everything to work with the native linux drivers from http://ipw2200.sf.net/.

My howto (now out of date, only 12 hours after I finished the first draft  :Sad:  ) on how to get the native drivers to work is at https://forums.gentoo.org/viewtopic.php?t=217688.  Although they don't quite work correctly with the wireless-config out of the box yet, it is possible to get it all to work together for a standard open WEP network.

----------

## PEETIE

when i use the line to ebuild wireless-config-0.5.5.ebuild i get an error that states this

aux_get() error; aborting.

How do i fix this?

----------

## navert

To start, thanks for the neat tool.  I emerged it and it worked fine practically right out of the box on my college wireless network (since I could connect through wired there).  I then brought my laptop planning on it being easy here.  Boy was I wrong.  My wireless card succesfully finds the two APs that are available from my housing manager.  iwlist wlan0 scan shows this:

wlan0     Scan completed :

          Cell 01 - Address: 00:06:25:F0:78:4F

                    ESSID:"Tanner 7"

                    Protocol:IEEE 802.11b

                    Mode:Managed

                    Frequency:2.437GHz

                    Quality:0/100  Signal level:-65 dBm  Noise level:-256 dBm

                    Encryption key:off

                    Bit Rate:1Mb/s

                    Bit Rate:2Mb/s

                    Bit Rate:5.5Mb/s

                    Bit Rate:11Mb/s

                    Extra:bcn_int=100

          Cell 02 - Address: 00:04:5A:E8:2C:63

                    ESSID:"Tanner"

                    Protocol:IEEE 802.11b

                    Mode:Managed

                    Frequency:2.462GHz

                    Quality:0/100  Signal level:-73 dBm  Noise level:-256 dBm

                    Encryption key:off

                    Bit Rate:1Mb/s

                    Bit Rate:2Mb/s

                    Bit Rate:5.5Mb/s

                    Bit Rate:11Mb/s

                    Extra:bcn_int=100

running net.wlan0 start successfully finds the ap but hangs up an trying to get the ip address.  iwconfig wlan0 shows this after running net.wlan0 start:

wlan0     IEEE 802.11b  ESSID:"Tanner 7"  

          Mode:Managed  Frequency:2.437GHz  Access Point: 00:06:25:F0:78:4F  

          Bit Rate:11Mb/s   Tx-Power:15 dBm   

          RTS thr:2347 B   Fragment thr:2346 B   

          Encryption key:off

          Power Management:off

          Link Quality:100/100  Signal level:-66 dBm  Noise level:-256 dBm

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

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

WEP is not enabled on the access point.  I can connect fine when I boot up windows.  I know the wireless card and wireless-config work correctly because I can access the net at my college.

I have run ethereal and noticed that when I create a static ip and set up my own routes, I am not hearing the ap.  Meaning, I am pinging the ap (address 192.168.1.1) and in ethereal it is showing that the ap is hearing me and knows who I am.  The ap is even responding, yet I seem to not be receiving anything from the ap since the ping just times out.  Here is a print out of just one ping.

No.     Time        Source                Destination           Protocol Info

      1 0.000000    192.168.1.140         Broadcast             ARP      Who has 192.168.1.1?  Tell 192.168.1.140

Frame 1 (42 bytes on wire, 42 bytes captured)

    Arrival Time: Sep  1, 2004 17:29:49.714375000

    Time delta from previous packet: 0.000000000 seconds

    Time since reference or first frame: 0.000000000 seconds

    Frame Number: 1

    Packet Length: 42 bytes

    Capture Length: 42 bytes

Ethernet II, Src: 00:0c:41:2c:58:3c, Dst: ff:ff:ff:ff:ff:ff

    Destination: ff:ff:ff:ff:ff:ff (Broadcast)

    Source: 00:0c:41:2c:58:3c (192.168.1.140)

    Type: ARP (0x0806)

Address Resolution Protocol (request)

    Hardware type: Ethernet (0x0001)

    Protocol type: IP (0x0800)

    Hardware size: 6

    Protocol size: 4

    Opcode: request (0x0001)

    Sender MAC address: 00:0c:41:2c:58:3c (192.168.1.140)

    Sender IP address: 192.168.1.140 (192.168.1.140)

    Target MAC address: 00:00:00:00:00:00 (00:00:00_00:00:00)

    Target IP address: 192.168.1.1 (192.168.1.1)

No.     Time        Source                Destination           Protocol Info

      2 0.001473    192.168.1.1           192.168.1.140         ARP      192.168.1.1 is at 00:06:25:f0:78:4f

Frame 2 (50 bytes on wire, 50 bytes captured)

    Arrival Time: Sep  1, 2004 17:29:49.715848000

    Time delta from previous packet: 0.001473000 seconds

    Time since reference or first frame: 0.001473000 seconds

    Frame Number: 2

    Packet Length: 50 bytes

    Capture Length: 50 bytes

IEEE 802.3 Ethernet 

    Destination: 00:0c:41:2c:58:3c (192.168.1.140)

    Source: 00:06:25:f0:78:4f (192.168.1.1)

    Length: 36

Logical-Link Control

    DSAP: SNAP (0xaa)

    IG Bit: Individual

    SSAP: SNAP (0xaa)

    CR Bit: Command

    Control field: U, func=UI (0x03)

        000. 00.. = Command: Unnumbered Information (0x00)

        .... ..11 = Frame type: Unnumbered frame (0x03)

    Organization Code: Cisco IOS 9.0 Compatible (0x0000f8)

    Type: ARP (0x0806)

Address Resolution Protocol (reply)

    Hardware type: Ethernet (0x0001)

    Protocol type: IP (0x0800)

    Hardware size: 6

    Protocol size: 4

    Opcode: reply (0x0002)

    Sender MAC address: 00:06:25:f0:78:4f (192.168.1.1)

    Sender IP address: 192.168.1.1 (192.168.1.1)

    Target MAC address: 00:0c:41:2c:58:3c (192.168.1.140)

    Target IP address: 192.168.1.140 (192.168.1.140)

Now, my card is not getting the reply.

I hope you guys can help.  My card is a WPC54G and I am using ndiswrapper with the updated driver from linksys.

Thanks

----------

## UberLord

 *ToddWest wrote:*   

> 
> 
> I have mapped the AP's MAC address to the correct ESSID but for some reason it is still not enabling WEP. It just keeps saying
> 
>  *     wlan0 connected to "myessid" in managed mode
> ...

 

It's reporting that WEP is disabled. To double check, type "iwconfig wlan0" and check if there is an encryption key or not.

----------

## UberLord

 *BlaZoR wrote:*   

> Hi!
> 
> I'm having one problem with your wireless script (which is really good!! ),
> 
> I have a Netgear WG311T Wireless Card (with Atheros AR5212) and a Netgear WG624 Wireless Router, I can connect to the router, no problem, but he can't get a IP per DHCP, don't know why. When I try to manually add a IP I can't ping to the router or other things on LAN. I tried it with WEP and without, but no difference
> ...

 

MAC address filtering? WPA? These are security settings on the AP.

Bad signal strength (can be caused by driver) ?

----------

## UberLord

 *PEETIE wrote:*   

> when i use the line to ebuild wireless-config-0.5.5.ebuild i get an error that states this
> 
> aux_get() error; aborting.
> 
> How do i fix this?

 

Try putting the ebuild in the PORTDIR_OVERLAY/net-wireless/wireless-config dir. PORTDIR_OVERLAY is defined in /etc/make.conf

----------

## UberLord

 *navert wrote:*   

> To start, thanks for the neat tool.  I emerged it and it worked fine practically right out of the box on my college wireless network (since I could connect through wired there).  I then brought my laptop planning on it being easy here.  Boy was I wrong

 

Well, you have it working at college, but not at home and you have demonstrated a greater knowledge of networking than I posesses....... lets try anyway!

As it's your home network, it there any kinda security on it like WEP, WPA, MAC filtering ..... ?

----------

## PEETIE

Ok i used PORTDIR_OVERLAY and it successfully did an ebuild but then when i tried to emerge it i get this message:

emerge net-wireless/wireless-config-0.5.5

Calculating dependencies

!!! Problem in net-wireless/wireless-config-0.5.5 dependencies.

!!! "Specific key requires an operator (net-wireless/wireless-config-0.5.5) (try adding an '=')"

What should i do now?

----------

## Jeremy_Z

Well, adding an '=' :

emerge =net-wireless/wireless-config-0.5.5

----------

## navert

 *UberLord wrote:*   

>  *navert wrote:*   To start, thanks for the neat tool.  I emerged it and it worked fine practically right out of the box on my college wireless network (since I could connect through wired there).  I then brought my laptop planning on it being easy here.  Boy was I wrong 
> 
> Well, you have it working at college, but not at home and you have demonstrated a greater knowledge of networking than I posesses....... lets try anyway!

 

I just did what some linux guys told me to do.  :Smile: 

 *UberLord wrote:*   

> 
> 
> As it's your home network, it there any kinda security on it like WEP, WPA, MAC filtering ..... ?

 

On the home network, there is no security that I know of.  My apartment complex has it open to any one that wants to access.  I have great access when I boot up windows and I don't have to set up any security.  So WEP isn't enabled.  I don't think WPA is.  MAC filtering isn't either since I can use the same card with the same MAC using Windows.

From what I can figure out, my card for some reason can't hear the AP.  I have even created an arp entry with the AP mac address in there.  When I do that and start up ethereal, I can see myself pinging the outside world, but any reply is not picked up by the card (yet with ethereal I can see it just fine).  I could be thinking along the wrong lines.

----------

## BlaZoR

 *UberLord wrote:*   

>  *BlaZoR wrote:*   Hi!
> 
> I'm having one problem with your wireless script (which is really good!! ),
> 
> I have a Netgear WG311T Wireless Card (with Atheros AR5212) and a Netgear WG624 Wireless Router, I can connect to the router, no problem, but he can't get a IP per DHCP, don't know why. When I try to manually add a IP I can't ping to the router or other things on LAN. I tried it with WEP and without, but no difference
> ...

 

MAC adress filtering is not active. WPA not active too. 

Link Quality is 21/94 if you mean that.

Hope you can help me   :Confused: 

```

root@blaz1-gentoo blazor # /etc/init.d/net.ath0 start

 * Running preup function       

 *   Configuring wireless network for ath0

 *   Connecting to "wLaAaAaN" (WEP enabled)...                                            [ ok ]

 *     ath0 connected to "wLaAaAaN" in managed mode

 *     on channel 06 (WEP enabled)

 * Bringing ath0 up via DHCP...                                                           [ !! ]

root@blaz1-gentoo blazor # iwconfig

eth0      no wireless extensions.

lo        no wireless extensions.

ath0      IEEE 802.11g  ESSID:"wLaAaAaN"  

          Mode:Managed  Frequency:2.437GHz  Access Point: 00:09:5B:E7:88:1E  

          Bit Rate:1Mb/s   Tx-Power:50 dBm   Sensitivity=0/3  

          Retry:off   RTS thr:off   Fragment thr:off

          Encryption key: xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xx   Security mode:restricted

          Power Management:off

          Link Quality=19/94  Signal level=-76 dBm  Noise level=-95 dBm

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

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

root@blaz1-gentoo blazor # ifconfig

eth0      Link encap:Ethernet  HWaddr 00:0B:6A:1F:95:A4  

          inet addr:192.168.0.35  Bcast:192.168.0.255  Mask:255.255.255.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:537 errors:0 dropped:0 overruns:0 frame:0

          TX packets:475 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:573634 (560.1 Kb)  TX bytes:79427 (77.5 Kb)

          Interrupt:19 Base address:0xd000 

lo        Link encap:Local Loopback  

          inet addr:127.0.0.1  Mask:255.0.0.0

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0 

          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

root@blaz1-gentoo blazor # 

```

Config

```

essid_ath0="wLaAaAaN"

mode_ath0="Managed"

channel_ath0="6"

key_wLaAaAaN="xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xx"

ifconfig_wLaAaAaN=( "dhcp" )

dhcpcd_wLaAaAaN="-t 10"

essid_00095BE7881F="wLaAaAaN"

```

----------

## UberLord

 *BlaZoR wrote:*   

> 
> 
> I'm having one problem with your wireless script (which is really good!! ),
> 
> I have a Netgear WG311T Wireless Card (with Atheros AR5212) and a Netgear WG624 Wireless Router, I can connect to the router, no problem, but he can't get a IP per DHCP, don't know why. When I try to manually add a IP I can't ping to the router or other things on LAN. I tried it with WEP and without, but no difference
> ...

 

I think the problem may be WEP (as always). Try disabling WEP on the AP and the card and see if you can connect then.

If so, then the Key is not correct or the method (restricted or open) is not correct.

----------

## BlaZoR

 *BlaZoR wrote:*   

> I tried it with WEP and without, but no difference

 

 :Wink: 

----------

## PEETIE

i tried adding an = sign before net-wireless and that didnt work. any other suggestions?

----------

## iverson0881

 *PEETIE wrote:*   

> i tried adding an = sign before net-wireless and that didnt work. any other suggestions?

 

I must ask how you are emerging it.

```
 emerge wireless-config
```

or

```

emerge =net-wireless/wireless-config
```

my /etc/portage/package.keywords says

```

~net-wireless/wireless-config-0.5.5 ~x86

```

and it all works fine

----------

## giannifive

There is a minor bug in the latest version (0.5.5) that might make debugging hard if there is a problem with your wireless card (as there is in my case): in the file /etc/init.d/wireless.sh, two occurences of "eerror" are mistyped as "error".  Here's the diff:

```
*** wireless.sh Fri Sep  3 19:36:17 2004

--- wireless.sh.orig    Fri Sep  3 19:35:19 2004

***************

*** 244,250 ****

        e=$( iwconfig ${iface} essid "${ESSID}" 2>&1 )

        if [[ -n ${e} ]]; then

!               eerror "  ${iface} does not support setting ESSID to \"${dessid}\""

                return 1

        fi

--- 244,250 ----

        e=$( iwconfig ${iface} essid "${ESSID}" 2>&1 )

        if [[ -n ${e} ]]; then

!               error "  ${iface} does not support setting ESSID to \"${dessid}\""

                return 1

        fi

***************

*** 756,762 ****

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

        if [[ -n ${e} ]]; then

!               eerror "${iface} does not support setting the mode to \"${x}\""

                return 1

        fi

--- 756,762 ----

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

        if [[ -n ${e} ]]; then

!               error "${iface} does not support setting the mode to \"${x}\""

                return 1

        fi

```

Aside from this minor problem, wireless-config has always worked quite well for me, and is an excellent add-on for Gentoo.  BTW, why is wireless-config still not in the main Portage tree?

----------

## PEETIE

I tried emerge wireless-config-0.5.5 

ACCEPT_KEYWORDS="~x86" emerge wireless-config-0.5.5

and the full name net-wireless/wireless-config-0.5.5

all of these result in an error:

Problem in wireless-config-0.5.5 dependencies.

"Specific key requires an operator (net-wireless/wireless-config-0.5.5) (try adding an '=')

then if i try

emerge =net-wireless/wireless-config-0.5.5

 it says there are no masked or unmasked ebuilds to satisfy "=net-wireless/wireless-config-0.5.5".

----------

## iverson0881

I think I was able to duplicate what you were getting maybe. I did it with the hal-cvs ebuild.

I got

```

bash-2.05b# emerge -p hal-cvs

These are the packages that I would merge, in order:

/usr/sbin/ebuild.sh: line 1102: /usr/portage/eclass/autotool.eclass: No such file or directory

!!! ERROR: sys-apps/hal-cvs-20040522 failed.

!!! Function inherit, Line 1103, Exitcode 1

!!! died sourcing /usr/portage/eclass/autotool.eclass in inherit()

aux_get(): (0) Error in sys-apps/hal-cvs-20040522 ebuild. (1)

               Check for syntax error or corruption in the ebuild. (--debug)

Calculating dependencies

!!! all ebuilds that could satisfy "hal-cvs" have been masked.

!!! possible candidates are:

/usr/sbin/ebuild.sh: line 1102: /usr/portage/eclass/autotool.eclass: No such file or directory

!!! ERROR: sys-apps/hal-cvs-20040522 failed.

!!! Function inherit, Line 1103, Exitcode 1

!!! died sourcing /usr/portage/eclass/autotool.eclass in inherit()

aux_get(): (0) Error in sys-apps/hal-cvs-20040522 ebuild. (1)

               Check for syntax error or corruption in the ebuild. (--debug)

!!! Error calculating dependencies. Please correct.

```

What I did was 

```
touch /usr/portage/eclass/autotool.eclass
```

and that worked. I'm not sure if this will help.

----------

## PEETIE

no my error is different, and touch didnt work.

----------

## intendedacceleration

I have your wireless-config package installed, but for the life of me I can't get my ipw2100 wireless to work. 

After I followed your instructions, I did the following, which finish cleanly.

```
ACCEPT_KEYWORDS="~x86" emerge ipw2100 wireless-tools
```

So then I do:

```
bash-2.05b# /etc/init.d/net.eth1 start

 * Running preup function

 *   Wireless extensions not found for eth1

 * Bringing eth1 up via DHCP...                                           [ !! ]
```

I am 100% sure I have wireless extentions compiled in my kernel. What did I do wrong?

----------

## Jeremy_Z

After emerge ipw2100, you need to "make modules_install". Then you could test it by modprobe ipw2100.

----------

## intendedacceleration

 *Jeremy_Z wrote:*   

> After emerge ipw2100, you need to "make modules_install". Then you could test it by modprobe ipw2100.

 

 :Shocked:  That did it! 

Thank you!!!!

----------

## riprjak

 *ToddWest wrote:*   

>  *UberLord wrote:*    *ToddWest wrote:*   Ive tried to fix this on my own but I just cant figure out whats going on. I installed ndiswrapper with my IPW2200 and I can start it perfectly on my own:
> 
> ```
> iwconfig wlan0 mode Managed
> 
> ...

 

Sorry for the long quote... EXACTLY the same problem... wireless-config (0.5.3 and 0.5.5) sets wep then UNSETS it and hence, fsck's the wireless connection.

Started happening when I upgraded to ndiswrapper 0.9 and happens also in 0.10.  With ndiswrapper 0.8, it was all tickety boo... although th get it to come up, I had to run the script once before I pressed the go button for the nic.

ALL keys etc are double checked and correct.

I couldnt see WHY, so I scrapped wireless config and simply run a script that scans for AP's and then executes

```
iwconfig wlan0 mode Managed

iwconfig wlan0 key XXXXXXXXXXXXXXXXXXXXXXXXXX

iwconfig wlan0 essid myessid

dhcpcd wlan0
```

based on the result for "essid" from a lookup table.

less elegant Ill grant, but it works.  If someone has some insight as to why the wireless config sets then unsets the wep key, please let me know.

err!

jak

----------

## UberLord

 *giannifive wrote:*   

> There is a minor bug in the latest version (0.5.5) that might make debugging hard if there is a problem with your wireless card (as there is in my case): in the file /etc/init.d/wireless.sh, two occurences of "eerror" are mistyped as "error".  Here's the diff:
> 
> 

 

Thanks - several people have kindly pointed this out and it will be resolved in the next release - hopefully this week.

 *Quote:*   

> Aside from this minor problem, wireless-config has always worked quite well for me, and is an excellent add-on for Gentoo.  BTW, why is wireless-config still not in the main Portage tree?

 

It should be going into portage as soon as a Gentoo dev gives the thumbs up for something else ......... when, I really cannot say.

----------

## UberLord

 *riprjak wrote:*   

> 
> 
> Sorry for the long quote... EXACTLY the same problem... wireless-config (0.5.3 and 0.5.5) sets wep then UNSETS it and hence, fsck's the wireless connection.
> 
> Started happening when I upgraded to ndiswrapper 0.9 and happens also in 0.10.  With ndiswrapper 0.8, it was all tickety boo... although th get it to come up, I had to run the script once before I pressed the go button for the nic.
> ...

 

If wireless fails, I remove wifi settings, including WEP. The "report" you are seeing which says WEP disabled is merely a report. It may be wrong.

Could you post the full output of my script and iwconfig please? Thanks

----------

## UberLord

 *BlaZoR wrote:*   

>  *BlaZoR wrote:*   I tried it with WEP and without, but no difference 
> 
> 

 

Well, I'm all out of ideas then .....

----------

## riprjak

 *UberLord wrote:*   

> 
> 
> If wireless fails, I remove wifi settings, including WEP. The "report" you are seeing which says WEP disabled is merely a report. It may be wrong.
> 
> Could you post the full output of my script and iwconfig please? Thanks

 

Will do, might take a couple of days since I have a major project to kill first.

However, the script didnt lie, WEP WAS enabled and it connected to the accesspoint then DISABLED WEP (was refreshing iwconfig as I did it).

The only change from working to not working was NDISWRAPPER 0.8 to 0.9 (tried 0.10 as well), so I suspect that your script isnt the cause, just the effect.

Anyway, Ill whack some more detail down in a few days.

err!

jak

----------

## BlaZoR

 *UberLord wrote:*   

>  *BlaZoR wrote:*    *BlaZoR wrote:*   I tried it with WEP and without, but no difference 
> 
>  
> 
> Well, I'm all out of ideas then .....

 

I will reset the router and try it again (without any security things), when that doesn't have a function I will buy an access point and connect this to my ethernet switch  :Wink: , I think, this is the easiest way  :Very Happy: 

----------

## UberLord

 *riprjak wrote:*   

> 
> 
> The only change from working to not working was NDISWRAPPER 0.8 to 0.9 (tried 0.10 as well), so I suspect that your script isnt the cause, just the effect.
> 
> 

 

OK - get back to me when you can  :Smile: 

----------

## UberLord

NEW EBUILD POSTED

Fixes

All instances of error should now have been changed to eerror (Thanks to many people who pointed this out)

AP quality sorting should now work

We only change mode if requested is different from current (ipw fix)

Numereous other misc fixes

Changes

The association script setting has been removed - this was only useful for LEAP users and you should be able to run this in the preup function anyway.

wireless.example is now provided in conf.d instead of wireless - this stops existing settings being overwritten with new releases. Just remember to check it for any changes!

----------

## jsaints

Just wanted to say thank you for all your hard work UberLord and all who have contributed to this topic.  Thanks to this script i was able to install a Dlink DWL-520 and DWL-650 (both Atheros based) cards without any trouble.

thanks again

here where the steps i took to install each card:

1. emerge sync

2. emerge gentoo-dev-sources

3. Ensure that DEVICE DRIVERS-->NETWORKING SUPPORT-->WIRELSS LAN (NON-HAM RADIO)---> WIRELESS LAN DRIVERS & WIRELESS EXTENSIONS  is selected in make muneconfig kernel config

4.  Compile the kernel and install it on boot partiition

5.  emerge pciutils (if not already installed)

6.  type lspci to see if card in listed and detected

7.  (Laptop only) type rc-update add pcmcia default

8.  (Laptop only) /etc/init.d/pcmcia start

9.  emerge wireless-tools

10.  ACCEPT_KEYWORDS="~x86" emerge madwifi-driver

11 . Follow step by step the first page of this forum - be sure to add ath0 to /etc/conf.d/net

12.  type ifconfig -a to see if the device ath0 is listed

13. ln -s /etc/init.d/net.eth0 /etc/init.d/net.ath0

14.  /etc/init.d/net.ath0 start

15.  type ifconfig to see if your wireless device ath0 received an ip address

16.  ensure that /etc/resolv.conf is still properly configured

17 . Enjoy wireless networking!

----------

## tharasix

I'm getting a 404 on trying to download the ebuild you posted today.

```
genlaptop wireless-config # wget http://rsm1.demon.co.uk/wireless-config-0.6.1.ebuild

--17:57:21--  http://rsm1.demon.co.uk/wireless-config-0.6.1.ebuild

           => `wireless-config-0.6.1.ebuild'

Resolving rsm1.demon.co.uk... 80.176.244.158

Connecting to rsm1.demon.co.uk[80.176.244.158]:80... connected.

HTTP request sent, awaiting response... 404 Not Found

17:57:21 ERROR 404: Not Found.
```

Did I screw up, or is something messed up on your end?

Chad Martin

----------

## UberLord

 *tharasix wrote:*   

> I'm getting a 404 on trying to download the ebuild you posted today.
> 
> ```
> genlaptop wireless-config # wget http://rsm1.demon.co.uk/wireless-config-0.6.1.ebuild
> 
> ...

 

```
wget http://rsm1.demon.co.uk/~roy/downloads/wireless-config-0.6.1.ebuild
```

Just the URL   :Rolling Eyes: 

----------

## UberLord

NEW EBUILD POSTED

Fixes

Dropping into ad-hoc mode when association failed now works

Removed error when setting nickname failed when in ad-hoc mode or master mode

Atmel drivers now appear to connect OK

----------

## Bigbang

I used to use this thing to make my wireless work but due to something I did somewhere, it doesn't work anymore. Here's what it does when I do:

```
#/etc/init.d/net.eth1 start

 * Running preup function

 *   Configuring wireless network for wlan0

 *   Connecting to "myessid" (WEP enabled)...                          [ ok ]

 *     eth1 connected to "myessid" in managed mode

 *     on channel 04 (WEP enabled)

 * Bringing eth1 up via DHCP...                                              [ !! ]
```

I tried installing the latest kernel, updating portage, ... it still doesn't work.

BTW: I can't do echo command and the net-wireless/wireless-config command. I have a x86 arch.

----------

## UberLord

 *Bigbang wrote:*   

> I used to use this thing to make my wireless work but due to something I did somewhere, it doesn't work anymore. Here's what it does when I do:
> 
> ```
> #/etc/init.d/net.eth1 start
> 
> ...

 

I would guess that the WEP key is wrong or MAC filtering is enabled or something.

Some information about your wifi card/driver/AP would be useful

----------

## Bigbang

I don't use check for the MAC adress.

The problem is that it was working before, anyway, here's what you asked for:

```
#lspci

0000:00:00.0 Host bridge: ALi Corporation: Unknown device 1672

0000:00:01.0 PCI bridge: ALi Corporation PCI to AGP Controller

0000:00:04.0 IDE interface: ALi Corporation M5229 IDE (rev c4)

0000:00:06.0 Multimedia audio controller: ALi Corporation M5451 PCI AC-Link Controller Audio Device (rev 02)

0000:00:07.0 ISA bridge: ALi Corporation M1533 PCI to ISA Bridge [Aladdin IV]

0000:00:08.0 Bridge: ALi Corporation M7101 PMU

0000:00:09.0 Modem: ALi Corporation M5457 AC'97 Modem Controller

0000:00:0a.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)

0000:00:10.0 CardBus bridge: Texas Instruments PCI1410 PC card Cardbus Controller (rev 01)

0000:00:11.0 CardBus bridge: Toshiba America Info Systems ToPIC95 PCI to Cardbus Bridge with ZV Support (rev 33)

0000:00:12.0 System peripheral: Toshiba America Info Systems SD TypA Controller (rev 05)

#iwconfig

eth1    IEEE 802.11-DS  ESSID:"blainbillard"  Nickname:"blainbillard"

   Mode:Managed  Frequency:2.427GHz  Access Point: 00:06:25:DD:3A:17

   Bit Rate:11Mb/s   Tx-Power=15 dBm   Sensitivity:1/3

   Retry limit:4   RTS thr:off   Fragment thr:off

   Encryption key:####-####-## (my key)

   Power Management:off
```

It's really strange. Also, what do the last 2 commands do and should I bother with them?

"net-wireless/wireless-config" is just a directory

~thx for helping

----------

## UberLord

 *Bigbang wrote:*   

> 
> 
> BTW: I can't do echo command and the net-wireless/wireless-config command. I have a x86 arch.

 

What's the exact command and whats the error?

----------

## Bigbang

```
# echo "net-wireless/wireless-config ~x86" >> /etc/portage/package.keywords

bash: /etc/portage/package.keywords: no file or directory of this type

# net-wireless/wireless-config

bash: net-wireless/wireless-config: no file or directory of this type

```

"/etc/portage" doesn't exist and "net-wireless/wireless-config" is just a directory

----------

## UberLord

 *Bigbang wrote:*   

> 
> 
> ```
> # echo "net-wireless/wireless-config ~x86" >> /etc/portage/package.keywords
> 
> ...

 

Sorry - my instructions at fault.  :Embarassed: 

I've corrected them now.  :Smile: 

Here's what you need todo

```

mkdir -p /etc/portage

echo "net-wireless/wireless-config ~x86" >> /etc/portage/package.keywords

emerge -u wireless-config

```

----------

## Vyeperman

Could you please fix whatever the issue is, either the ebuild is wrong or your server is down..and I would like to grab the script.

----------

## UberLord

 *Vyeperman wrote:*   

> Could you please fix whatever the issue is, either the ebuild is wrong or your server is down..and I would like to grab the script.

 

Looks fine from here

You can always grab the files from http://rsm1.demon.co.uk/~roy/downloads and put them in the right places

----------

## Vyeperman

Jeez that was a fast reply.....

----------

## UberLord

I aim to please   :Laughing:   :Cool:   :Very Happy: 

----------

## fel1x

hey, i have a problem, i can't get the wireless-config to emerge.

I have downloaded the ebuild from your site, i did the ebuild cmd, did the echo in the package.keywords file.

But i can't get it to work  :Sad: 

example:

wireless-config # emerge net-wireless/wireless-config

Calculating dependencies

!!! all ebuilds that could satisfy   "net-wireless/wireless-config" have been masked.

!!! Error calculating dependencies. Please correct.

ACCEPT_KEYWORDS="~x86" emerge net-wireless/wireless-config

Calculating dependencies \

emerge: there are no masked or unmasked ebuilds to satisfy ">=sys-apps/baselayout-1.8.11".

!!! Error calculating dependencies. Please correct.

thx in advance

----------

## UberLord

 *fel1x wrote:*   

> # emerge net-wireless/wireless-config
> 
> Calculating dependencies
> 
> !!! all ebuilds that could satisfy   "net-wireless/wireless-config" have been masked.
> ...

 

Edit the file /etc/portage/package.keywords and ensure you have the following line

```
net-wireless/wireless-config ~x86
```

 *Quote:*   

> 
> 
> ACCEPT_KEYWORDS="~x86" emerge net-wireless/wireless-config
> 
> Calculating dependencies \
> ...

 

The latest baselayout is 1.10.4 - your portage tree must be very old

Try an 

```
emerge sync

emerge -uaDv world
```

 before installing wireless-config

----------

## Bigbang

 *UberLord wrote:*   

> 
> 
> ```
> 
> mkdir -p /etc/portage
> ...

 

done, but...

...it still fails at the DHCP line, I'll try without WEP as soon as I can and tell you about it

maybe it's my router because someone did some changes in it recently, but I looked and can't seem to find what could not be working with it

EDIT: It worked without the WEP key, but since I really need to have the WEP key on, I have some more questions:

```
key_blainbillard="restricted ##########"
```

Is this way of writing the WEP key ok (or open)? And what does the channel line do exactly?

~thx for all the support

----------

## UberLord

 *Bigbang wrote:*   

> It worked without the WEP key, but since I really need to have the WEP key on, I have some more questions:
> 
> ```
> key_blainbillard="restricted ##########"
> ```
> ...

 

There's examples in /etc/conf.d/wireless.example for setting WEP keys

Also, there's a man page for iwconfig which describes the ways of entering a WEP key. My script use iwconfig

----------

## oisch

I upgraded to 0.6.2 and it seems that preassociate_ESSID is gone.

Is there a way to use this function again. I used it to set my mac adress via ifconfig, as the acces point only allows specific macs and it's way to complicated to register a new one.

Another question: is there a way to set multiple nameservers? via nameserver_ESSID?

Thanks for this great script. It's getting better every day. The Gentoo devs should really integrate it now.

----------

## UberLord

 *oisch wrote:*   

> I upgraded to 0.6.2 and it seems that preassociate_ESSID is gone.
> 
> Is there a way to use this function again. I used it to set my mac adress via ifconfig, as the acces point only allows specific macs and it's way to complicated to register a new one.
> 
> 

 

Yes, I removed it. You can run the macchanger program in the preup function in /etc/conf.d/net instead

Obviously this means that you cannot run a specific script per AP, but I don't as yet see a need for this. Besides, I'm not sure it would go into Gentoo with that feature as it stood.

 *Quote:*   

> 
> 
> Another question: is there a way to set multiple nameservers? via nameserver_ESSID?

 

Not in the version you have  :Sad: 

But as it's a good idea and very easy todo, it's going in the next version  :Smile: 

 *Quote:*   

> 
> 
> Thanks for this great script. It's getting better every day. The Gentoo devs should really integrate it now.

 

Oh, I'm hoping that it will be in portage Sometime Soon (tm)   :Cool: 

----------

## sbastion

Strange occurence, the wireless script won't recognize my device as having wireless extensions, which it does, then it gets brought up by dhcp anyway, just not using the wireless script.  This bugs me, because I keep connecting to my neighbor's wireless if it comes up first.

```

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

 * Running preup function

 *   Wireless extensions not found for ra0

 * Bringing ra0 up via DHCP...                                                                                                                               [ ok ]

 * ra0 received address 192.168.0.101

# iwconfig

eth0      no wireless extensions.

lo        no wireless extensions.

ra0       RT2500 Wireless  ESSID:"Home"

          Mode:Managed  Channel:9  Access Point: 00:0D:88:9F:F5:EF

          Bit Rate:54Mb/s

          RTS thr:off   Fragment thr:off

          Encryption key:off

          Link Quality:0/70  Signal level:-169 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

# ifconfig

lo        Link encap:Local Loopback

          inet addr:127.0.0.1  Mask:255.0.0.0

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:84 errors:0 dropped:0 overruns:0 frame:0

          TX packets:84 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:5316 (5.1 Kb)  TX bytes:5316 (5.1 Kb)

ra0       Link encap:Ethernet  HWaddr 00:0C:76:FF:CA:30

          inet addr:192.168.0.101  Bcast:192.168.0.255  Mask:255.255.255.0

          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:3144 errors:0 dropped:0 overruns:0 frame:0

          TX packets:540 errors:0 dropped:0 overruns:0 carrier:0

          collisions:10 txqueuelen:1000

          RX bytes:906501 (885.2 Kb)  TX bytes:103286 (100.8 Kb)

          Interrupt:11 Base address:0x2000

```

This also seems to have the effect of making my entire system 'lag'.. each command in a terminal takes about 1 second to be executed.  Any ideas?

----------

## iverson0881

 *sbastion wrote:*   

> Strange occurence, the wireless script won't recognize my device as having wireless extensions, which it does, then it gets brought up by dhcp anyway, just not using the wireless script.  This bugs me, because I keep connecting to my neighbor's wireless if it comes up first.
> 
> 

 

Have you tried setting up Preferred APs in the script's config?

As for UberLord I have a bug or something going nuts somewhere. I had version 0.5.5 and when my PC was booting up it would show that it was connecting to the proper SSID which is Hameed.

But after upgrading to 0.6.2 it says Hameed but with a bunch of random characters trailing. It connects just fine but I'm wondering why these random characters are there. 

I have only upgraded the Script when this had occured so it has something to do with your script. 

Anyway its not a big deal since it still connects but its something to think about. 

Thanks

----------

## koolio4

Hey, i m having a bit of trouble settin up my wireless. I ve been readin this thread since the beginning. I have a dell lattidude c640 with a Linksys WPC11 card v3. 

The last things that i have done is emerge wireless-config and wireless-tool. 

I m using a 2.6.7 r11 kernel, and i do have 

```
 [*] wireless land drivers ) non-hamradio & wireless extensions
```

All my device drivers are compiled and installed as modules in the kernel

I dont think i cant start setting up the /etc/conf.d/wireless yet because something seems to be wrong with iwconfig, here is the output

```
 iwconfig

eth0 no wireless extensions

lo     no wireless extensions

eth1 no wireless extensions
```

at boot time, everything almost seems to be checkin out ok 

```
 pcmcia support detected

starting pcmcia

cardmgr[4973] watching 2 sockets

cardmgr[4973] starting, version is 3.2.5

cardmgr[4973] socket 0, linksys WPC11 11mbps 802.11b wlan card

cardmgr[4973] executing: ' ./network start eth1 "

cardmgr[4973] + ./ network: line 28 /etc/init.d/net.eth1 : no such file or directory

cardmgr[4973] start cmd exited with status 127                                  [ok]

bringing up eth0 via dhcp ...                                                              [ok]

    eth0 revieve 192.168.1.112

...
```

The lights on the card light up, and it has never frozen. So i m not sure what to do now, any leads would help

thanks.

----------

## sbastion

 *Quote:*   

> Have you tried setting up Preferred APs in the script's config? 

 

Yup.  I'd quote you the script, but I'm running on Windows till I get this wireless thing straightened out.

Koolio, I'm not to familiar with pcmcia.. but it looks like /etc/init.d/net.eth1 can't be found.  Check to see if it's there, and if it isn't:

```
ln -s /etc/init.d/net.eth0 /etc/init.d/net.eth1
```

----------

## koolio4

thx sbastion, i saw that i forgot to create that. i figured since ifconfig eth1 was already showing the card, i didnt have to so i didnt bother to check. Anyway i did it, and edited /etc/conf.d/net.

The funny thing is, the wireless now works, i m actually on it but i really havent event edited the /etc/conf.d/wireless.example so i havent even created /etc/conf.d/wireless. 

After doing 

```
 ln -s /etc/init.d/net.eth0 /etc/init.d/net.eth1
```

all i did was edit /etc/conf.d/net, and uncommented iface_eth1, and gave it the proper ip address used on my router ( i use static ip addressing at home for security i got a quite a few computers so its easier for me like that), and set up the gateway, and rebooted, and it picked it up when i rebooted. I didnt know it could work like that, the funny thing is i didnt even notice cause i was about to run ping, and the ethernet cable got unplugged, so i went  ahead with it just out of curiosity to see what output it would give, and to my surprise, nothing. its just responded back within 2 seconds. I m guessing it would work too if i just changed it do dhcp. So since its working, i m wondering if i still need the scripts and the wireless tools that i emerged earlier since i havent edited them yet ?

here is my /etc/conf.d/net

```

# /etc/conf.d/net:

# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/conf.d/net,v 1.7 2002/1$

# Global config file for net.* rc-scripts

# This is basically the ifconfig argument without the ifconfig $iface

#

#wireless card static ip address

iface_eth1="192.168.1.9 broadcast 192.168.1.255 netmask 255.255.255.0"

#iface_eth1="207.170.82.202 broadcast 207.0.255.255 netmask 255.255.0.0"

# For DHCP set iface_eth? to "dhcp"

# For passing options to dhcpcd use dhcpcd_eth?

#

#ethernet card info (temp dhcp)

iface_eth0="dhcp"

dhcpcd_eth0="-N"

# For adding aliases to a interface

#

#alias_eth0="192.168.0.3 192.168.0.4"

# NB:  The next is only used for aliases.

#

# To add a custom netmask/broadcast address to created aliases,

# uncomment and change accordingly.  Leave commented to assign

# defaults for that interface.

#

#broadcast_eth0="192.168.0.255 192.168.0.255"

#netmask_eth0="255.255.255.0 255.255.255.0"

# For setting the default gateway

#

#wireless router gateway

 gateway="eth1/192.168.1.1"

```

My wireless.example is still unedited, so i figured i wouldnt touch that til i can figure out why its actually working.

here is my if config output ( notice how eth1 is detected as ethernet, but i m still gettin constant wireless signal but still gives me the mac address of the wireless card )

```

genlap root # ifconfig

eth0      Link encap:Ethernet  HWaddr 00:08:74:98:77:A3

          inet addr:192.168.1.112  Bcast:192.168.1.255  Mask:255.255.255.0

          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:5 errors:0 dropped:0 overruns:0 frame:0

          TX packets:12 errors:0 dropped:0 overruns:0 carrier:8

          collisions:0 txqueuelen:1000

          RX bytes:1890 (1.8 Kb)  TX bytes:6550 (6.3 Kb)

          Interrupt:11 Base address:0xec80

eth1      Link encap:Ethernet  HWaddr 00:06:25:AC:B1:0D      ***wireless card mac***

          inet addr:192.168.1.9  Bcast:192.168.1.255  Mask:255.255.255.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:3562 errors:0 dropped:0 overruns:0 frame:0

          TX packets:1573 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:3309923 (3.1 Mb)  TX bytes:239545 (233.9 Kb)

          Interrupt:3 Base address:0x100

lo        Link encap:Local Loopback

          inet addr:127.0.0.1  Mask:255.0.0.0

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:6 errors:0 dropped:0 overruns:0 frame:0

          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:300 (300.0 b)  TX bytes:300 (300.0 b)

```

here is iwconfig

```

genlap root # iwconfig

eth0      no wireless extensions.

lo        no wireless extensions.

eth1      no wireless extensions.

```

Now all this said, my other question is to find out if i could set up another interface such as eth2 and make it dhcp for school. The school network uses a wireless dhcp server, so is it possible to do so that when gentoo loads lets say when i m at school, it ll pick up the dhcp server and bring up eth2, and keep eth1 static for my home wireless, and disable all netorking device from boot, and enable them manually depending if i m home (wireless eth1), at schoo (possible eth2), or using the ethernet cable directly from the router at home (cable eth0) ?

or could i just do something like this instead 

```

iface_eth1="192.168.1.9 broadcast 192.168.1.255 netmask 255.255.255.0"

gateway="eth1/192.168.1.1"

#iface_eth1="dhcp"

#dhcpcd_eth0="-N"

and then once i get to school and need dhcp just edit and have this 

#iface_eth1="192.168.1.9 broadcast 192.168.1.255 netmask 255.255.255.0"

#gateway="eth1/192.168.1.1"

iface_eth1="dhcp"

dhcpcd_eth1="-N"

```

thanks for the help guys, any leads, comments or questions are welcomed.

----------

## dyqik

Wireless config will just work if you have an AP broadcasting it's ESSID, and without WEP enabled.  The wireless config example is pretty clear as well.

If you just copy wireless.example to wireless, and edit the copy, you can always get back to your currently working settings by deleting wireless.

Your current setup will allow anyone to connect and monitor your internet traffic, so you should change it to enable WEP.  The wireless config allows static ips for certain networks, and dynamic for others, so there's no need to create an eth2.

----------

## sbastion

koolio:  I'm actually surprised your wireless link works.  Even tho neither the wireless tools, nor the script provided in this forum are necessary for wireless connectivity to work, I figured wireless extensions -were- needed.  But, that being said, no, you don't need this script or the wireless tools, tho I would strongly recommend the wireless tools, as they will at least allow you to manually control essid/wep keys as necessary.  Now, I would also suggest this script, as it allows you to preset the otherwise manual settings you would have to go through each time.  So in the case of home/school, you can set per-essid rules, dhcp for school, static ip/gateway for home.  However, you will probably run into a problem: even tho your wireiess is working, it's registering as having no wireless extensions by iwconfig.  This means that this script will probably not recognize eth1 as a wireless device, thus not enable itself on that device (basically the same problem I have, tho my iwconfig does register my device as having wireless extensions).  This is as far as my knowledge of linux and the way this script works goes.  Mr. Uber Lord may have better suggestions/ideas, so you may want to wait until he is able to respond before making any decisions  :Smile:  . Hmm.. now that I think about it.. try this, and let me know if it still says no wireless extensions are found:

```
ifconfig eth1 up

iwconfig

```

-

In the mean time, I'm still having the same problem as posted earlier, and would appreciate any help  :Smile:  .

----------

## Klavs

Hi - I've written in this thread before but I never got the problem resolved  :Sad: 

I'm not sure if it's a dependency problem in the init-scripts or what..

What happens is that, when the wireless if is started, it also insists on starting net.eth0  :Sad:  (which is crap as that gets started last - overwriting my default gw - and thus means I can't get past my own subnet, until I down the eth0 again and fix the problem).

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

 * Unmounting network filesystems...                                                               [ ok ]

 * Running predown function

 *   Removing wireless configuration from wlan0...                                                 [ ok ]

 * Bringing wlan0 down

 *   Removing inet6 addresses

 *     wlan0 inet6 del fe80::205:3cff:fe09:d5c5/64...                                              [ ok ]

 *   Releasing DHCP lease for wlan0...                                                             [ ok ]

 *   Stopping wlan0...                                                                             [ ok ]

 * Running preup function

 *   Configuring wireless network for wlan0

 *     wlan0 connected as "MYWLAN"

 *     in ad-hoc mode on channel 06 (WEP enabled)

 * Bringing wlan0 up via DHCP...                                                                   [ ok ]

 *   wlan0 received address 10.4.50.101

 * Running preup function

 *   Wireless extensions not found for eth0

 * Bringing eth0 up (192.168.50.101)...                                                              [ ok ]

 *   Setting default gateway (192.168.50.1)...                                                      [ ok ]

 * Mounting network filesystems... 

REALLY annoying  :Sad:  - any ideas what is wrong here? I was hoping it would be resolved in later baselayouts - but running baselayout-1.9.4-r3 and still it does this  :Sad: 

----------

## koolio4

 *dyqik wrote:*   

> Wireless config will just work if you have an AP broadcasting it's ESSID, and without WEP enabled.  The wireless config example is pretty clear as well.
> 
> If you just copy wireless.example to wireless, and edit the copy, you can always get back to your currently working settings by deleting wireless.
> 
> Your current setup will allow anyone to connect and monitor your internet traffic, so you should change it to enable WEP.  The wireless config allows static ips for certain networks, and dynamic for others, so there's no need to create an eth2.

 

i see what you are saying, i will eventually get that done, but so far, i dont have any network problems, as i have restricted my wireless broadcats on the router settings to only 5 specific mac addresses, and only allow the exact range of ip addresses ( with the amount of computers i got )allowed to connected to the rest of the network. I i got 3 in my room directly into the router, then my router on wireless and my roomatas on the wireless also. I ve gone to 2 of my neighgbors ' places and tried to connected to my network and was unable to connect. I have 5 static ips that can connect, plus all mac addresses put in restriction. So far i havent had any breaches as i constantly monitor if anything but my computers are connected andi havent seen anyting able to conected I think mac address restriction is also another form of security. what do u guys think ?

Altho i still dont undersand why the iwconfig output returns no wireless extentions, my kernel is up to date, baselayout is installed, and so is wireless tools as well as wireless tools, i mean i ve done everything ( i think ) so if anyone can give me a hand on that, its be good. 

thx

----------

## UberLord

 *sbastion wrote:*   

> Strange occurence, the wireless script won't recognize my device as having wireless extensions, which it does, then it gets brought up by dhcp anyway, just not using the wireless script.  This bugs me, because I keep connecting to my neighbor's wireless if it comes up first.
> 
> ....
> 
> This also seems to have the effect of making my entire system 'lag'.. each command in a terminal takes about 1 second to be executed.  Any ideas?

 

Sounds like a driver/kernel/hardware problem. Could you post the relevant parts of dmesg and/or /var/log/messages? Obviosuly not the whole stuff - just stuff relating to either firmware or ra

EDIT - If wireless extensions come up after ifconfig ra0 up, edit /etc/init.d/wireless.sh and look for the wireless_pre_start function right near the end of the file. Then add "interface_up ${iface}" on a new line just before wireless_check_extensions

Post back with your results  :Smile: 

----------

## UberLord

 *iverson0881 wrote:*   

> 
> 
> But after upgrading to 0.6.2 it says Hameed but with a bunch of random characters trailing. It connects just fine but I'm wondering why these random characters are there. 

 

It's either a problem with your driver or wireless-tools. I changed that bit of code to use iwget -r instead if trying to parse the iwconfig output. When wireless tools matures, I'll be using more of iwgetid - the current version in ~x86 supports more stuff like working out the channel.

However, it is buggy (wireless tools or your driver). My madwifi card had a similar issue until I upgraded the drivers.

----------

## UberLord

 *Klavs wrote:*   

> Hi - I've written in this thread before but I never got the problem resolved 
> 
> I'm not sure if it's a dependency problem in the init-scripts or what..
> 
> What happens is that, when the wireless if is started, it also insists on starting net.eth0  (which is crap as that gets started last - overwriting my default gw - and thus means I can't get past my own subnet, until I down the eth0 again and fix the problem).
> ...

 

If you're feeling brave, checkout http://rsm1.demon.co.uk/~roy/downloads and look at the latest net-scripts package

Expand the compressed archive into /etc and re-link all scripts to /etc/init.d/net.lo

This is a complete networks scripts package that supports wireless, 2 types of interface package and 4 dhcp clients - and a few other things.

----------

## duhblow7

hi uberlord,

first off...great script, keep up the good work!!

i'm able to use the script when i don't turn on MAC filtering or WEP on my AP, but i would like some type of security.  when i connect to my AP without WEP and MAC filtering, ssid = "TRON", it shows this:

```
tranquil oo7 # /etc/init.d/net.eth1 start

 * Running preup function

 *   Configuring wireless network for eth1

 *   Connecting to "troy" (WEP Disabled)...                                                  [ ok ] 

 *     eth1 connected to "troy�9@a" at 00:0F:66:00:BD:FF

 *     in managed mode on channel 6 (WEP disabled)

 * Bringing eth1 up via DHCP...                                                              [ ok ]

 *   eth1 received address 192.168.1.5
```

why are there weird characters after my SSID name when i connect to the AP?  Also because of this, when i try to define my 64bit 10 hex WEP key i cannot properly define it in /etc/conf.d/wireless.

when i turn on WEP and try:

```
essid_eth1="troy"

key_troy="3D-07-2C-A3-3B enc open"

preferred_aps=( "troy" )

```

i get the following output:

```
 * Running preup function

 *   Configuring wireless network for eth1

 *   Connecting to "troy" (WEP enabled)...                                                   [ ok ]

 *     eth1 connected to "troy�9@a" at 00:00:00:00:00:00

 *     in managed mode on channel 0 (WEP enabled)

 * Bringing eth1 up via DHCP...                                                              [ !! ]
```

i don't think i'm getting the AP MAC address because i'm not getting passed the encryption and therefore cannot get an IP.  I am using static DHCP allocations based on my wireless MAC address.  I am using the Linksys WRT54G router with Samadhi2 firmware.  I have an Intel 2200 Pro wireless card with ipw2200 and ieee80211_crypt_wep modules loaded.

The following commands using iwconfig were able to authenticate my wireless network:

```
iwconfig eth1 essid troy

iwconfig eth1 key 3D072CA433B

```

thanks,

oo7

----------

## UberLord

 *duhblow7 wrote:*   

> 
> 
> why are there weird characters after my SSID name when i connect to the AP?  Also because of this, when i try to define my 64bit 10 hex WEP key i cannot properly define it in /etc/conf.d/wireless.
> 
> 

 

OK - too many people have reported this.

Shame, as it's much easier to use iwgetid -r instead of parsing iwconfig.

Edit /etc/init.d/wireless and look for the function wireless_get_essid

Replace the line iwgetid with the code below

```
iwconfig ${1} 2>${devnull} | awk -F\" '/ESSID/ {print $2}'
```

Hopefully I will release a new version in a day or two

----------

## duhblow7

if a lot of people have reported this, i bet it's caused by using 'hacked' firmware for the linksys routers.  the most common firmware hacks for the linksys WRT54G 802.11b/g cable/dls router is called Samadhi2 and the linksys WAP54G access point is called Freya.

----------

## duhblow7

i tried the change you suggested.  i still get an error:

```

tranquil root # /etc/init.d/net.eth1 start

 * Running preup function

 *   Configuring wireless network for eth1

 *   Connecting to "troy" (WEP enabled)...                                     [ ok ]

 *     eth1 connected to "troy" at 00:00:00:00:00:00

 *     in managed mode on channel 0 (WEP enabled)

 * Bringing eth1 up via DHCP...                                                [ !! ]

tranquil root # nano -w /etc/conf.d/wireless

tranquil root # /etc/init.d/net.eth1 start

 * Running preup function

 *   Configuring wireless network for eth1

 *   Connecting to "troy" (WEP Disabled)...                                    [ ok ]

 *     eth1 connected to "troy" at 00:0F:66:00:BD:FF

 *     in managed mode on channel 6 (WEP disabled)

 * Bringing eth1 up via DHCP...                                                [ ok ]

 *   eth1 received address 192.168.1.5

```

the first time i tried to start net.eth1 i had wep enabled and my /etc/conf.d/wireless looked like this:

```
essid_eth1="troy"

key_troy="s:3D-07-2C-A3-3B enc open"

preferred_aps=( "troy" )

```

the second time i disabled WEP on the router and removed the key_troy line and it connects fine.  There was one time i started net.eth1 and got this:

```
tranquil root # /etc/init.d/net.eth1 restart

 * Running preup function

 *   Configuring wireless network for eth1

 *   Connecting to "troy" (WEP enabled)...                                     [ ok ]

 *     eth1 connected to "troy" at 00:0F:66:00:BD:FF

 *     in managed mode on channel 6 (WEP enabled)

 * Bringing eth1 up via DHCP...                                                [ !! ]
```

but i still wasn't able to get an IP.  any ideas?

----------

## UberLord

 *duhblow7 wrote:*   

> if a lot of people have reported this, i bet it's caused by using 'hacked' firmware for the linksys routers.

 

No - I saw it myself with early madwifi-drivers. And I know I haven't modded my AP in any way or form .....

----------

## UberLord

 *duhblow7 wrote:*   

> 
> 
> ```
> essid_eth1="troy"
> 
> ...

 

s: - implies an ASCII string

Try removing it

```
key_troy="3D-07-2C-A3-3B enc open"
```

----------

## duhblow7

i was trying with the s: and without it.

funny thing was when i was able to get my AP's MAC address and what seemed like i connected successfully with WEP i had it with the s:.  Go figure.  I'll keep my eye out for your updates.

oo7

----------

## UberLord

 *duhblow7 wrote:*   

> i was trying with the s: and without it.
> 
> funny thing was when i was able to get my AP's MAC address and what seemed like i connected successfully with WEP i had it with the s:.  Go figure.  I'll keep my eye out for your updates.
> 
> 

 

That's because your client WEP type is open. This allows connection even with an invalid WEP key ....

----------

## hollowsoul

Trying to set a Prism Duette in Master mode,

But complains, that eth5 doesnt support setting essid but i can set it with iwconfig??

```
 * Running preup function

 *   Configuring wireless network for eth5

 *   eth5 does not support setting ESSID to "Donnie Darko"

 * Failed to configure wireless for eth5

 * preup eth5 failed

```

tail -f /var/log/messages/current and got the following when i ran the script, any ideas what is wrong      linux-2.6.9-rc1-mm4

```
Sep 13 10:46:19 [kernel] eth5: reset problem: no 'reset complete' IRQ seen

Sep 13 10:46:20 [kernel] eth5: timeout waiting for mgmt response

Sep 13 10:46:20 [kernel] eth5: mgt_commit_list: failure. oid=ff020008 err=-110

Sep 13 10:46:21 [kernel] eth5: timeout waiting for mgmt response

Sep 13 10:46:21 [kernel] eth5: mgt_commit_list: failure. oid=ff020003 err=-110

Sep 13 10:46:22 [kernel] eth5: timeout waiting for mgmt response

Sep 13 10:46:22 [kernel] eth5: mgt_commit_list: failure. oid=10000000 err=-110

Sep 13 10:46:23 [kernel] eth5: timeout waiting for mgmt response

Sep 13 10:46:23 [kernel] eth5: mgt_commit_list: failure. oid=17000007 err=-110

Sep 13 10:46:23 [kernel] eth5: mgmt tx queue is still full

Sep 13 10:46:23 [kernel] eth5: mgt_commit_list: failure. oid=19000001 err=-12

Sep 13 10:46:23 [kernel] eth5: mgmt tx queue is still full

Sep 13 10:46:23 [kernel] eth5: mgt_commit_list: failure. oid=10000002 err=-12

Sep 13 10:46:23 [kernel] eth5: mgmt tx queue is still full

Sep 13 10:46:23 [kernel] eth5: mgt_commit_list: failure. oid=19000004 err=-12

Sep 13 10:46:23 [kernel] eth5: mgmt tx queue is still full

Sep 13 10:46:23 [kernel] eth5: mgt_commit_list: failure. oid=12000000 err=-12

Sep 13 10:46:23 [kernel] eth5: mgmt tx queue is still full

Sep 13 10:46:23 [kernel] eth5: mgt_commit_list: failure. oid=12000001 err=-12

Sep 13 10:46:23 [kernel] eth5: mgmt tx queue is still full

Sep 13 10:46:23 [kernel] eth5: mgt_commit_list: failure. oid=12000002 err=-12

Sep 13 10:46:23 [kernel] eth5: mgmt tx queue is still full

Sep 13 10:46:23 [kernel] eth5: mgt_commit_list: failure. oid=12000004 err=-12

Sep 13 10:46:23 [kernel] eth5: mgmt tx queue is still full

Sep 13 10:46:23 [kernel] eth5: mgt_commit_list: failure. oid=12000005 err=-12

Sep 13 10:46:23 [kernel] eth5: mgmt tx queue is still full

Sep 13 10:46:23 [kernel] eth5: mgt_commit_list: failure. oid=12000006 err=-12

Sep 13 10:46:23 [kernel] eth5: mgmt tx queue is still full

Sep 13 10:46:23 [kernel] eth5: mgt_commit_list: failure. oid=12000007 err=-12

Sep 13 10:46:23 [kernel] eth5: mgmt tx queue is still full

Sep 13 10:46:23 [kernel] eth5: mgt_commit_list: failure. oid=12000003 err=-12

Sep 13 10:46:23 [kernel] eth5: mgmt tx queue is still full

Sep 13 10:46:23 [kernel] eth5: mgt_commit_list: failure. oid=150007e0 err=-12

Sep 13 10:46:23 [kernel] eth5: mgmt tx queue is still full

Sep 13 10:46:23 [kernel] eth5: mgt_commit_list: failure. oid=ff02000c err=-12

Sep 13 10:46:23 [kernel] eth5: mgmt tx queue is still full

Sep 13 10:46:23 [kernel] eth5: mgt_commit_list: failure. oid=ff020003 err=-12

Sep 13 10:46:23 [kernel] eth5: mgmt tx queue is still full

Sep 13 10:46:23 [kernel] eth5: mgt_update_addr: failure

Sep 13 10:46:23 [kernel] eth5: mgmt tx queue is still full

                - Last output repeated 12 times -

Sep 13 10:46:23 [rc-scripts] eth5 does not support setting ESSID to "Donnie Dark o"

Sep 13 10:46:23 [rc-scripts] Failed to configure wireless for eth5

Sep 13 10:46:23 [kernel] eth5: mgmt tx queue is still full

                - Last output repeated 8 times -

Sep 13 10:46:23 [rc-scripts] preup eth5 failed

```

----------

## UberLord

 *hollowsoul wrote:*   

> Trying to set a Prism Duette in Master mode,
> 
> But complains, that eth5 doesnt support setting essid but i can set it with iwconfig??
> 
> 

 

Sounds like you have a similar problem to the others here

https://forums.gentoo.org/viewtopic.php?t=218289

I have this problem as well with my SMC2802W card :/

----------

## bjchamb

Is there any way that I can have the script load the appropriate modules when I bring the interface up (and ideally unload them when I bring the interface down)?  The reason I need this is because if the module loaded at boot time (for some reason) iwconfig fails to detect it.  But if it is inserted after booting it works fine.

----------

## UberLord

 *bjchamb wrote:*   

> Is there any way that I can have the script load the appropriate modules when I bring the interface up (and ideally unload them when I bring the interface down)?

 

https://forums.gentoo.org/viewtopic.php?p=1468048&highlight=#1466600

----------

## jrmfe

Hey hello, sorry my bad english.

Thats a awesome script you made, congratulations!

Anyway, i have a sugestion you could implement and i'm almost sure more people would use it.

How about... a new config option: 

lastscript_ESSID - for some ESSID, it would run a user made script or a shell command, but just when the interface is finally sucessfull configurated. The ideia is to allow post configuration after the interface is ready.

Ex: I would use like: lastscript_WiFi_IST="pptp-command start WiFi_IST"

I think is very usefull to start VPN client services and stuff like that.

Thanks for your time and pacience!  :Smile: 

----------

## UberLord

You can use the postup() function in /etc/conf.d/net for that.

A global variable called ESSID is set when wireless config has been successful - so you can test against that.

----------

## UberLord

IMPORTANT ANNOUNCMENT

wireless config is now in portage in the sys-apps/baselayout-1.11.0 package

See the 1st post in this thread for installation instructions

Fixes - numerous

Changes

nameserver_ESSID="192.168.0.1" has been depreciated in favour of

nameservers_ESSID=( "192.168.0.1" "192.168.0.2" )

----------

## Sudrien

Launched warning-free after an

echo "ifconfig_wlan0=( \" dhcp \")" >> /etc/conf.d/net

(well, ifconfig_eth1 in my case)

This is good.  :Smile: 

in a related note, the new base layout also includes an error related to "dm-crypt" - which I  haven't figured out how to stop yet. 

-Sud.

----------

## iverson0881

New baselayout stuff working great here and loving it =)

I'm not getting any of those errors from the above post when running /etc/init.d/net.ath0 restart. I'll have to see if its different (it shouldn't be) whenever i feel like rebooting.

Thanks UberLord =) and the kind Gentoo devs =)

----------

## jrmfe

Hey, hello  :Smile: 

 *UberLord wrote:*   

> You can use the postup() function in /etc/conf.d/net for that.
> 
> A global variable called ESSID is set when wireless config has been successful - so you can test against that.

 

Ok, i followed your advice, i came up with this:

```
        

         # Wireless Network related user script

         eval script=\"\$\{startscript_${ESSID}\}\"

         [[ -n ${script} ]] && {

             einfo "  User defined start script for Wireless Network ${ESSID}"

             eval "${script}"

             eend $?

         }

```

I have startscript_WiFi_IST set in /etc/conf.d/wireless

However, this only works when i use "/etc/init.d/net.eth1 restart", that is, the interface must be allready running, and then i restart it.

This is odd, i found ESSID is only set when i have the interface restarted, i believe that wasnt your idea.

PS: What others global variable are set in the script?

MORE DEBUG INFO:

With: 

```

postup () {

   echo "ESSID: ${ESSID}"

}

```

I start with eth1 down

```

laptop-jose conf.d # /etc/init.d/net.eth1 start

 * Running preup function

 *   Configuring wireless network for eth1

 *   Scanning for access points

 *     Found "WiFi_IST" at 00:60:B3:17:87:E2

 *   Connecting to "WiFi_IST" (WEP Disabled)... [ ok ] 

 *     eth1 connected to "WiFi_IST" at 00:60:B3:17:87:E2

 *     in managed mode on channel 1 (WEP disabled)

 * Bringing eth1 up...

 *   eth1 dhcp [ ok ]

 *     eth1 received address 10.1.9.160

 *   Adding routes 

 *     -host wifi.localnet eth1[ ok ] 

 * Running postup function

ESSID:

```

Then i restart

```

laptop-jose conf.d # /etc/init.d/net.eth1 restart

 * Running predown function

 *   Removing wireless configuration from eth1... [ ok ] 

 * Bringing eth1 down...

 *   Releasing DHCP lease for eth1 [ ok ] 

 *   Stopping eth1 [ ok ] 

 * Running preup function

 *   Configuring wireless network for eth1

 *   Scanning for access points

 *     Found "WiFi_IST" at 00:60:B3:17:87:E2

 *   Connecting to "WiFi_IST" (WEP Disabled)... [ ok ] 

 *     eth1 connected to "WiFi_IST" at 00:60:B3:17:87:E2

 *     in managed mode on channel 1 (WEP disabled)

 * Bringing eth1 up...

 *   eth1 dhcp [ ok ] 

 *     eth1 received address 10.1.9.160

 *   Adding routes

 *     -host wifi.localnet eth1 [ ok ] 

 * Running postup function

ESSID: WiFi_IST

```

Anyway, if i have eth1 down and "/etc/init.d/net.eth1 restart", it doesnt set ESSID

Thanks for all!

----------

## UberLord

 *jrmfe wrote:*   

> Anyway, if i have eth1 down and "/etc/init.d/net.eth1 restart", it doesnt set ESSID

 

You're right!

I have a fix - find the wireless_configure() function and remove the word ESSID from the line starting with the word "local"

----------

## nevil

I'm having problems getting it to work with pump. I don't receive an IP address.

My config file looks like this

------

retries 3

device eth0 {

}

device wlan0 {

nodns

nogateway

}

------

Installed udhcp and it worked instantly.

----------

## UberLord

 *nevil wrote:*   

> I'm having problems getting it to work with pump. I don't receive an IP address.
> 
> Installed udhcp and it worked instantly.

 

Well, that shows you have a working DHCP server.

Does pump --interface eth1 get an address? replace eth1 with your interface.

I have pump working - but I don't have a pump config file.

----------

## Sudrien

 *Sudrien wrote:*   

> 
> 
> in a related note, the new base layout also includes an error related to "dm-crypt" - which I  haven't figured out how to stop yet. 

 

 *iverson0881 wrote:*   

> 
> 
> I'm not getting any of those errors from the above post when running /etc/init.d/net.ath0 restart. I'll have to see if its different (it shouldn't be) whenever i feel like rebooting.

 

Yeah, I'm still getting used to not having to reboot... It's in /etc/init.d/checkfs

-Sud.

----------

## jrmfe

 *UberLord wrote:*   

> 
> 
> I have a fix - find the wireless_configure() function and remove the word ESSID from the line starting with the word "local"

 

Fix confirmed  :Smile:  now working as it should...

Thanks for all!

----------

## iverson0881

```
 * Setting up dm-crypt mappings...

/sbin/runscript.sh: line 277: [: Failed to setup a mapping or swap device.: integer expression expected                                                   [ !! ]

/sbin/runscript.sh: line 296: return: Failed to setup a mapping or swap device.: numeric argument required
```

hehe nevermind then I'm getting it as well.  Well I do have a swap partition assigned in fstab (i don't know if this is the same as the swap device) but it is there and hardly ever used.

----------

## sl70

Thanks to Uberlord for the awesome script. However, I'm having problems getting two encryptions keys working. In the setup for my access point (a gentoo machine running hostap) I have:

```
iwconfig wlan0 essid SNL  key xxxxxxxxxxxxxxxxx  key yyyyyyyyyyyyyyyyyyy

```

In /etc/conf.d/wireless I have:

```
key_SNL="[1] xxxxxxxxxxxxxxxxxx  enc restricted [2] yyyyyyyyyyyyyyyyyy enc restricted" 
```

But I found I can only get a connection if I include only one encryption key.

Here's what shows up in my log when I try with two keys:

```
Sep 17 21:34:39 nasubi eth0: authenticate with AP 00:09:5b:11:d0:c6 CHAN=3

Sep 17 21:34:39 nasubi eth0: TX authentication (alg=1 transaction=1 status=0 Success)

Sep 17 21:34:39 nasubi eth0: RX authentication (alg=1 transaction=2 status=0 Success)

Sep 17 21:34:39 nasubi eth0: TX authentication (alg=1 transaction=3 status=0 Success)

Sep 17 21:34:40 nasubi eth0: authentication with AP 00:09:5b:11:d0:c6 CHAN=3 timed out

```

The access point log shows this:

```
Sep 17 21:26:57 brian wlan0: 00:04:e2:83:f3:7c auth_cb - frame was not ACKed

Sep 17 21:31:57 brian wlan0: STA 00:04:e2:83:f3:7c did not ACK activity poll frame

Sep 17 21:31:58 brian wlan0: sending disassociation info to STA 00:04:e2:83:f3:7c(last=83576015, jiffi

es=83877015)

Sep 17 21:31:59 brian wlan0: sending deauthentication info to STA 00:04:e2:83:f3:7c(last=83576015, jif

fies=83878015)

Sep 17 21:31:59 brian wlan0: Could not find STA 00:04:e2:83:f3:7c for this TX error 
```

( also tried it without the enc restrcted, and with various other little permutations but with no luck.) Am I doing something badly wrong?

----------

## UberLord

@sl70

Although you can configure upto 4 keys, only 1 key can be active at any time. Maybe you're not setting the default key to use?

----------

## ongardie

I can't get the init script to start:

```
bash-2.05b# /etc/init.d/net.eth1 start

 * Loading networking modules...

 *   modules: wireless ifconfig dhcpcd

 *     ifconfig provides interface

 *     dhcpcd provides dhcp                                                                              [ ok ]

 *   Configuring wireless network for eth1

 * Looks like there was a probem loading the firmware for eth1

 * Failed to configure wireless for eth1

```

I am using the ipw2200 drivers.

```
bash-2.05b# cat /etc/conf.d/wireless

preferred_aps_eth1=("Wireless")

preferred_only_eth1="no"

```

If you need more info, I will gladly supply it.

Thank you for reading this post.

-ongardie

----------

## UberLord

 *ongardie wrote:*   

> I can't get the init script to start:
> 
> ```
> bash-2.05b# /etc/init.d/net.eth1 start
> 
> ...

 

Could you post the output of the following commands please

```
ifconfig eth1 down

iwconfig eth1

ifconfig eth1 up

iwconfig eth1

```

Thanks!

----------

## Mallow005

I'm getting an error for dm-crypt mappings at bootup... the same thing in the previous post about "Failed to setup a mapping or swap device.: integer expression expected"

I'm not sure if that has anything to do with the fact that now cardmgr fails to start now. It says Make sure that you have PCMCIA modules built or support compiled into the kernel, but I certainly do and it was working for previous builds of this kernel before I emerge the new baselayout. Any known fixes?

----------

## cyner

I too get dm-crypt mappings errors at boot, and I have no idea what it is. I can't understand why installing a wireless card does this and removes the colors from my prompt.

Other than that (and the fact that WEP didn't work), I'm happy.

A tip for RaLink RT2400 users (e.g. ASUS WL-130b): download and compile the module from http://www.sourceforge.net/projects/rt2400/ -- do not try to compile the older Minitar version of the module.

Oh, and the /etc/init.d/net.xxx script doesn't work at all. ("Looks like there was a probem loading the firmware for ra0.") So I'm starting it by hand... I never understood what good net.xxx did anyway.

```
modprobe rt2400

ifconfig ra0 up 192.168.0.xxx netmask 255.255.255.0

iwconfig ra0 essid XXX

route add default gw 192.168.0.1
```

----------

## HeraldMage

Hi,

First of all, thanks very much for a great improvement to the wireless scripts. The merge into baselayout has greatly improved things.

I got it working mostly, where I now have my wired as eth0 built in (and many thanks for the configurability of the DHCP timeout, BTW...when I'm not wired (e.g., on an airplane) it sucked having to wait forever for it to not get an address). I was getting annoyed enough to consider installing DHCPD and using a loopback plug...

My problem now is getting the multiple key option to work with the AP. It works OK with just one, of course, but I'd like to try to understand the entirety of it.

Working config is the following (conf.d/wireless, just the relevant lines):

I've obfuscated the key and AP name.

```

mode_eth1="Managed"

channel_eth1="8"

key_Bobo="XXXXXX2F4816E428D2A1XXXXXX enc open"

preferred_aps_eth1=( "Bobo" "t-mobile" )

preferred_only_eth1="no"

```

What I wanted to do was list multiple keys:

```

key_Bobo="[1] XXXXXX2F4816E428D2A1XXXXXX key [2] YYYYYYB56DAB99845810YYYYYY key key [1]"

```

But when I do that, I get:

```

eth1 does not support setting keys

or the parameter "mac_key_Bobo" or "key_Bobo" is incorrect

Failed to associate with any preferred access points on eth1

```

My access point is a stock Linksys WRT54G, configured with Bobo as the ESSID, no SSID broadcast (there are enough other wide open APs for folks to pick), WEP 128-bit encryption, and MAC address filtering. My Linux box is Gentoo 2.6.8-r3 with orinoco_pci drivers for my ThinkPad T30's built in Intersil Prism 2.

On a related note, I am also getting the dm-crypt issue after emerging the new baselayout. It boots OK, but it seems that for some reason the check in /etc/init.d/checkfs for the existence of /etc/conf.d/cryptfs actually passes, even though the file isn't there, so at the end, the line 244 gets called:

```

ewend ${cryptfs_status} 'Failed to setup a mapping or swap device.'

```

I've noticed this seems to be harmless (swap is actually still mounted OK, all systems functioning normal), but it was puzzling. I was more annoyed that I've spent too much time in recent years in the Windows world and my scripting skills are too rusty to have figured it out on my own.   :Confused: 

And the set of PS1 in baselayout 1.11.x was also annoying, but I fixed that by editing /etc/profile again and modifying the else off the /etc/bash/bashrc test (which doesn't exist, and I was too lazy to build it):

```

iif [ "$EUID" = 0 ] || [ "`/bin/whoami`" = 'root' ]; then

    PS1='\[\033[01;31m\]\h \[\033[01;34m\]\W \$ \[\033[00m\]'

else

    PS1='\[\033[01;32m\]\h \[\033[01;36m\]\W \$ \[\033[00m\]'

fi

```

So now I have my color prompts back, so I can remember which windows have me su'ed to root or not.

Look forward to hearing the answers to the cryptfs check and the key problem. Of course, if you need any other info, let me know.

HeraldMage

----------

## UberLord

 *cyner wrote:*   

> I too get dm-crypt mappings errors at boot, and I have no idea what it is. I can't understand why installing a wireless card does this and removes the colors from my prompt.

 

It is an experimental version of baselayout - if you don't want those error's then you can always go back to an earlier version and use the wireless ebuild.

 *Quote:*   

> 
> 
> Oh, and the /etc/init.d/net.xxx script doesn't work at all. ("Looks like there was a probem loading the firmware for ra0.") So I'm starting it by hand... I never understood what good net.xxx did anyway.
> 
> 

 

Could you post the output of the following please - sounds like a similar problem to the ipw2200 user above

```
ifconfig ra0 down

iwconfig ra0

ifconfig ra0 up

iwconfig ra0
```

Thanks

----------

## UberLord

 *HeraldMage wrote:*   

> 
> 
> What I wanted to do was list multiple keys:
> 
> ```
> ...

 

I suggest trying to get it working on the command line - you need to be able todo it with one command.

```
iwconfig eth1 ${key}
```

 Replace ${key} with what you use in key_Bobo

Once you have that working, you should be able to use the same thing for key_Bobo  :Smile: 

----------

## HeraldMage

Ah yeah, stupid syntax error.

 *Quote:*   

> 
> 
> ```
> 
> key_Bobo="[1] XXXXXX2F4816E428D2A1XXXXXX key [2] YYYYYB56DAB99845810YYYYYY key key [1]"
> ...

 

One too many "key"s in that line.

Troubleshooting on the command line and doing a 'man iwconfig' helped out, to get me the working: 

```

key_Bobo="[1] XXXXXX2F4816E428D2A1XXXXXX key [2] YYYYYB56DAB99845810YYYYYY  key [1]"

```

Thanks for the tip.

----------

## ongardie

 *UberLord wrote:*   

> 
> 
> Could you post the output of the following commands please
> 
> ```
> ...

 

No problem, this is the ouptut I get after a cold boot: 

```
bash-2.05b# ifconfig eth1 down

bash-2.05b# iwconfig eth1

eth1      ieee 802.11b  ESSID:"Wireless"

          Mode:Managed  Channel:1  Access Point: 00:09:5B:3F:A5:06

          Bit Rate=1Mb/s

          RTS thr:off

          Encryption key:off

          Power Management:off

          Link Quality:3/100  Signal level:-184 dBm  Noise level:-144 dBm

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

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

bash-2.05b# ifconfig eth1 up

bash-2.05b# iwconfig eth1

eth1      ieee 802.11b  ESSID:"Wireless"

          Mode:Managed  Channel:1  Access Point: 00:09:5B:3F:A5:06

          Bit Rate=1Mb/s

          RTS thr:off

          Encryption key:off

          Power Management:off

          Link Quality:3/100  Signal level:-184 dBm  Noise level:-144 dBm

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

          Tx excessive retries:0  Invalid misc:11   Missed beacon:5
```

----------

## cyner

 *UberLord wrote:*   

> Could you post the output of the following please - sounds like a similar problem to the ipw2200 user above
> 
> ```
> ifconfig ra0 down
> 
> ...

 

 *Output wrote:*   

> bash-2.05b# ifconfig ra0 down
> 
> bash-2.05b# iwconfig ra0
> 
> ra0       no wireless extensions.
> ...

 

I don't know why, but it ignores my net and wireless configurations, which are:

 *net wrote:*   

> ifconfig_ra0=("192.168.0.XXX netmask 255.255.255.0")
> 
> routes_ra0=("default gw 192.168.0.1")

 

 *wireless wrote:*   

> essid_ra0="xxx"
> 
> channel_ra0="6"

 

(Above it did remember the essid, but I think that's because it was set earlier. It didn't set the channel.)

----------

## UberLord

 *ongardie wrote:*   

> 
> 
> No problem, this is the ouptut I get after a cold boot: 
> 
> ```
> ...

 

I see the problem - here's a quick fix for you

Edit /etc/net.modules.d/wireless

Goto line 759 - it should be inside the function wireless_configure()

Change the line 

```
if [[ ${e%% *} != IEEE ]]; then
```

 to read

```

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

That should sort you and cyner out  :Smile: 

----------

## UberLord

 *cyner wrote:*   

> 
> 
> I don't know why, but it ignores my net and wireless configurations, which are:
> 
>  *net wrote:*   ifconfig_ra0=("192.168.0.XXX netmask 255.255.255.0")
> ...

 

OK - what's the output of the script? It should say setting ra0 IP to 192.168.0.XXX or similar

Also, in managed mode YOU don't set the channel - the AP does. Channel on the wireless card is only for ad-hoc and master modes.

----------

## amne

Please direct follow-ups to Wireless configuration and startup - The Gentoo way (part 2)

----------

