Jump to content

Wireless from a noob


Guest Mugendai
 Share

Recommended Posts

Guest Mugendai

I'm pretty new to Linux, I've delved here and there. Keep giving it a moderate, to light try now and then, been much more extended time between tries since I no longer have high speed internet. Anyway, this time around, I got a new laptop with wireless, and decided to give a go at Mandrake 10.2 beta for AMD 64.

 

Well getting the wireless up and running took some work. First let me say that Mandrake came with some nice lil GUIs to simplify the proccess.. though they didn't work out.

 

The main issue stimmed from the fact that there is no driver for my wireless, it's one of those broadcom ones. So I needed to use ndiswrapper. The GUI tool let me setup an ndiswrapper driver though, how nice. Unfortunately my laptop manufacturer(asus) didnt bother to provide me an INF file, instead it was an installer, and I couldn't seem to find an inf anywhere, even looking at the temp files during extraction.

It wouldn't have mattered anyway, cause you can not use the 32 bit drivers with the 64 bit system.

 

So I had to find the driver, I found this: http://www.linuxant.com/driverloader/drivers.php

Driverloader seems to be a tool similar to ndiswrapper, I didnt give it a try though, as it requires signing up, and um maybe money, didn't look into that, what matters is there is a copy of the 64 bit broadcom driver on that page.

 

So once I had the driver, I fed it to the GUI configurator, and it set things up for me. It also gave me the opportunity to setup encryption options here, which I did.

However, encryption options depend on wpa_supplicant, which is apparently not supplied anywhere in the 3 CD install I got. It did create the config file for wpa_supplicant however.

So I had to go get wpa_supplicant and compile it. Then I copied it's binaries to /usr/local/bin.

Also important here was that I put a link to wpa_supplicant binary in /usr/sbin

 

Ookay, so I was still not up and running at this time, so I tested and found things worked fine without encryption, but of course, encryption is a must to anyone who has security on the brain.

 

It was not a big step to get wpa_supplicant up and running though.(well it was a day or two of reading lots of scripts and docs which I had little to no familiarity with) It only took a few lines in some conf files to make stuff happy.

First of all the boot scripts in this release of mandrake already support both ndiswrapper, and wpa_supplicant, however, the GUI config tool does not set things up proper for us, atleast not in all cases.

 

I needed to add just one line to the config for the interface, found in /etc/sysconfig/network-scripts/ifcfg-wlan0

Just added this line to the end of it(nothing had docs about this, I simply found its usage in the script file)

WIRELESS_WPA_DRIVER=ndiswrapper

 

That is of course only neccisary if ndiswrapper is used. Be careful if you try using the GUI configurator from now on, it doesn't handle this line, and will remove it from the file.

 

Most people may have been up and running at this point, however, I have one more layer(actualy a few more, but only one worth mentioning) of security in my wireless configuration, I dont broadcast the SSID, so I needed to change that conf file that was generated for me. The file is "/etc/wpa_supplicant.conf" I went ahead and configured it somewhat based on some howtos I found. But the line that really mattered in my situation was "ap_scan=2" this is prolly not configured at all in the default setup the GUI makes(it wasnt for me). What it does is let the driver handle the proccess of looking for the access point. This one also doesn't require that it broadcast the SSID. Here is what my conf file ended up looking like:

ctrl_interface=/var/run/wpa_supplicant # for wpa_cli support
ap_scan=2

network={
   ssid="MYSSID"
   psk="mypsk"
   key_mgmt=WPA-PSK
   proto=WPA
}

 

At this point I was up and running to where my wireless would be good to go each time I booted. However, I plan to use this laptop away from home, and I don't like the idead of it taking forever to boot. But if it doesnt find a dhcp server for the ethernet or wireless it hangs on boot for a long time while it keeps trying to get an IP. So I spent a couple more days figuring out what to do here, I ended up modifying the script that brings up network interfaces.

/sbin/ifup

The problem was specifically that it runs the dhcp client, and waits till an IP is resolved, or until a long timeout is reached, so instead I made it do this in the background.

Starting at line 366:

$DHCP_CLIENT $DHCP_ARGS &
#    if $DHCP_CLIENT $DHCP_ARGS; then
#	echo $" done."
#    else
# Associate a zeroconf IP address to an alias of the interface
if [ -x /sbin/zcip ]; then
    if /sbin/zcip -s -i $DEVICE:${ZEROCONF_ALIAS_NUMER=9}; then
 echo $" done."
 if [ -x /etc/init.d/tmdns ]; then
     /etc/init.d/tmdns reload > /dev/null 2>&1
 fi
 exit 0
    fi
fi
echo $" done."
#	exit 1
#    fi

The first line is the only lline I added, it simply runs the dhcp client in the background by adding that & on the end. And we go ahead and set things up as if we had no IP(cause once dhcp gets on, it will fix us up) So I just comment out the the section for success, and the end of the if block. I also chanfe "failed" to "done", and commend out the exit line that would treat this as a failure.

 

Now that this is done, when any netowork interface comes up, it simply returns allowing the system to continue to boot while it looks for a dhcp server in teh background.

 

There was one more thing, since no proper IP will have been found by the time we hit the port mapper, the portmapper will sit around and wait till one is found.. *rolls eyes* so again we need to make it just get on with it, cause so far as I can tell, there is no need for it to sit around doing nothing until the netwokr is up, all seems fine if we just get on with things.

So I had to change the script fot portmapper: /etc/rc.d/init.d/portmap

What causes the hangup with portmap is it checks to see if the netowkr is up, if not, it sleeps for 5 seconds, and tries again.. doing this up to 5 times, thats 25 secs it sits around for no reason if there is no network around. So instead, I just made it not sit around at all.

There are two lines to change at line 30:

MAX=5
TIMEOUT=5

Simply changing MAX to 0 should do the trick no problem, but just for the pointlessness of it all I changed TIMEOUT to 0 as well.

 

And thats it, thats where I am. If wireless is availble its connected on boot, if ethernet is availble it connects on boot. And if nothing is available it doesnt waste a min sitting around looking for them.

 

Next up, I try to get ATI's driver compiled and installed.

Edited by Mugendai
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...