# Wireless surprise

## jimtss

Hi all.

I have a little story to tell and then two questions.  I am fairly new to Gentoo but not linux.  Put Gentoo on my home machine several months ago and like it a lot.  Decided to put Gentoo on my IBM Thinkpad T22 laptop about 2 weeks ago and did so.  BTW, on both machines, I share the HDD with Windows 2000.  Install on laptop went very smooth but did have some trouble getting sound working.  Works great now.  Then, about a week ago, I started the WIFI adventure.  This being a laptop, it has built-in Intel Pro 100 wired ethernet which Gentoo configged automagically and works great.  My wireless PCMCIA card is a Microsoft MN-520 that uses the orinoco driver.  My AP is a D-Link DI-514 router and AP combo unit.  First thing I did was build new kernel with PCMCIA, yenta-socket and orinoco-hermes drivers as module.  As soon as I did that, Gentoo sees my WIFI card in the slot after emerging wireless-tools.  Tried setting it up with wireless tools and after 3 whole days of fiddling and reading forums, gave up and decided to try wpa_supplicant.  Wpa needs to use the hostap driver.  I emerged that and fiddled for 2 or 3 days with no luck.  Also tried ndiswrapper but it didn't like my .inf file which I got right out of my Windows software.  Then, decided to go back to wireless tools one more time and stumbled accross this little gem in the forums:  

---iwconfig eth1 essid "my netname" key xxxxxxxxxx---

---dhcpcd eth1---

I typed this in and HOT DOG it worked!!!  It was just a matter of fiddling with the scripts to get it to run at boot-up.  The WIFI card now works but it does something strange.  My AP is set up with a 64 bit hex wep key for security.  In Gentoo, the WIFI works with or without the wep key-it doesn't care.  I switched back to windows to check this and windows WILL NOT connect without the correct wep key.  What gives?  The other oddity is, if I unplug the cat5 cable from my wired eth0 socket, booting of Gentoo hangs for 2 long minutes when trying to start up DHCP on eth0.  So . . .

1.  Did I accidently discover something wierd about wep keys and linux?

2.  Is there a simple work around of the long delay before eth0-wired times out and completes the boot-up?

          Thanks.

----------

## happyoutkast

regarding eth0 the only things I can suggest are:

1. remove from startup any internet dependent services, such as ntpd. However these services won't typically cause your system to hange too badly, they'll just fail when they can't resolve the domain needed or open the ports needed. Also on most machines dhcpd runs on startup as well, if it's looking for an ip on a interface with no connection it may hang for a minute until it realizes it's not going to get an ip address. This has happened to me before on gentoo, mandrake, red hat, and fedora core. You can fix this by removing dhcpd from startup and configuring the interface statically, typically you can get away with configuring the interface with a static ip even if the network has a dhcp server on it. Just make sure that your resolv.conf file has your dns addresses in it, etc... 

2. make eth0 not run on startup. This might not be practical since you may need to run them both at any time. However if you're not going to run them all the time and are on a laptop, I would probably opt for a manual startup of needed interfaces when you use them simply to save power and resources. However doing this alone probably wouldn't solve your problem, dhcpd would most likely still hang and fail.

As far as the wep key issue....you got me. As far as I knew whether your in windoze, linux, or a mac a wep key should always be required. It might have something to do with your AP configuration though...

----------

## NeddySeagoon

jimtss,

You can set a dhcp timeout. There is a worked example in /etc/conf.d/net.example

That will fix the long timeout.

For the WiFi key to be ignored - *both* ends have to ignore it. I suspect its getting set in two places and you are only changing one.

It can be in either or both of /etc/conf.d/net and/or /etc/conf.d/wireless.

The use of /etc/conf.d/wireless is depreciated.

----------

## jimtss

Thanks for the quick reply happyoutkast.  I will try these things you suggested.  

Jim.

----------

## jimtss

Here is what it looks like when connected.  NeddySeagoon.  [/code]

[code]

James_phxaz ~ # iwconfig eth1

eth1      IEEE 802.11-DS  ESSID:"default"  Nickname:"default"

          Mode:Managed  Frequency:2.437 GHz  Access Point: 00:0D:88:2C:65:AB

          Bit Rate:11 Mb/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=92/92  Signal level=5/153  Noise level=111/153

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

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

Its got me puzzled.

----------

## jimtss

Thanks for the tips NeddySeagoon and Happyoutkast.  FYI, just had to add this line to my net.conf to fix long timeout in boot up.  

```

      dhcpcd_eth0="-t 10"

Thanks.  
```

----------

## NeddySeagoon

jimtss,

Your iwconfig output shows that encryption is off.

Since the link works, it must be off at both ends.

----------

## jimtss

NeddySeagoon I saw that too and so, as a test, I went in and commented out my "KEY=" line in my wireless.opts file.  After doing that WIFI stopped working.  Went in and uncommented the KEY line and it resumed working.  Makes sense but don't know why it doesn't show up in iwconfig eth1.

  Thanks again.

----------

## UberLord

You can use ifplugd to start/stop net scripts using baselayout-1.11 and earlier

with baselayout-1.12, the net scripts can launch ifplugd (~ARCH version) or netplug by themselves.

ifplugd and netplug start/stop interfaces if a cable is plugged in/removed - this eliminates the need to timeout dhcpcd daemons or other klunky work arounds

----------

## happyoutkast

well definitely some good things to know, I'll keep them in mind if I ever manage to get my wireless working. I can scan fine, I'm just having a problem with a pesky kernel panic anytime I try and actually connect....

----------

## jimtss

Thanks Uberlord for the tips.  I emerged ifplugd.  So much to learn in linux world, that's why I like it so much.  If anyone else is interested in how I got my WIFI to work, briefly, here is what I found out.  The Gentoo docs on wireless say that you can put your config in /etc/conf.d/net or /etc/pcmcia/wireless.opts.  That's not quite true.  I had to use BOTH config files not either/or.  Here are my two files:

My /etc/conf.d/net:

[/code]

modules=( "iwconfig" )

dhcpcd_eth0="-t 10"

iwconfig_eth1="mode managed"

key_ESSID="default"

preferred_aps=( "default" )

associate_order_eth1="forcepreferredonly"

And my /etc/pcmcia/wireless.opts:

```

mes_phxaz pcmcia # cat wireless.opts

case "$ADDRESS" in

#microsoft wireless mn-520 wireless config

microsoft,*,*,*)

        NICKNAME="Microsoft MN-520"

        INFO="MN-520"

        ESSID="default"

        KEY="XXXXXXXXXX"

        MODE="Managed"

        CHANNEL="6"

        RATE="auto"

        ;;

esac

FYI, am running 2.6.12-gentoo-r10 on an IBM Thinkpad T22 that used a PentiumIII mobile processor and my WIFI card is a Microsoft MN-520 that needs the Orinoco driver as you can see.  And I had to turn on PCMCIA and Yenta socket and Orinoco driver as module in Make Menuconfig.  
```

----------

## UberLord

 *jimtss wrote:*   

> The Gentoo docs on wireless say that you can put your config in /etc/conf.d/net or /etc/pcmcia/wireless.opts.  That's not quite true.  I had to use BOTH config files not either/or.

 

Your statement is not quite true - the Gentoo wireless doc only mentions /etc/conf.d/net and /etc/conf.d/wireless - nothing pcmcia there.

HINT: You don't need pcmcia-cs unless you have a 16-bit card.

----------

## jimtss

Uberlord, it is a 16 bit card and I'm just saying that this is what worked for me, right or wrong.  I struggled for a solid week trying to do it the 'Gentoo' way without success.  It's obviously a newbee hack, I'm sure not a developer like you but it works great.  I do appreciate the attention of a knowledable linux developer-don't get me wrong and thank you again.

----------

## UberLord

As a quick test, does it work if you remove wireless.opts or make it a blank file?

I ask as it's a PITA to maintain the same config in two different files!

----------

## jimtss

Uberlord, I did "rm wireless.opts" and rebooted the computer and it stopped working.  The wireless green light on the card appeared to work as it stopped blinking and came on solid like it's supposed to.  But, when I fired up Mozilla, no internet.  I re-installed /etc/pcmcia/wireless.opts and it works again. Go figure.

----------

## happyoutkast

uberlord-

    Do you have an idea why I would get a kernel panic when I try and connect to my AP? I only ask here because I already posted this under its own thread twice now, a few views and no replies both times. I think I might try out this "newbie hack" and see if I have any more luck...

using ndiswrapper and wpa-supplicant. Drivers load ok, and scans ok, just a kernel panic when I attempt to connect to the AP. The card is a linksys wmp54gx...

----------

