Thursday, December 31, 2009

Configuring Broadcom (bcm43xx) Wireless Adaptor in Linux!

Configuring wireless adaptor in linux wasn't an easy job few years back, but now some of the linux distribution have started providing inbuilt drivers with OS like Kubuntu, Mint etc.
My laptop has broadcom wireless adaptor, which didn't responded to many of the linux distribution, until now when I came across Linux mint 7 (gloria). It detects my adaptor, by just choosing the STA proprietary wireless driver for it & works fine after that.
Recently, I have found some of the methods to configure the wireless adaptor in different linux distributions.

For OpenSUSE, a 1-click install YMP file (YaST Metapackage file) is available from Packman. To install this, go to http://packman.links2linux.org/ & search for broadcom-wl. Click on '1-click install' icon & follow the onscreen instructions.

To get it working on Mint 5, you can follow the instructions given at www.linuxmint.com/wiki/index.php/Broadcom_bcm43xx

.As for Fedora, its available in RPM fusion & for Mandriva, there is Mandriva non free repositories.

For CentOS, follow instructions(this methodology is obtained from http://kiranjith83.blogspot.com/):
Download wireless package from Broadcom
Untar the file hybrid-portsrc-x86_32_5_10_27_6.tar.gz (hybrid-portsrc-x86_64_5_10_27_6.tar.gz if you’re running on a 64-bit kernel) in its own folder:
>tar -xvzf hybrid-portsrc-x86_32_5_10_27_6.tar.gz
You should now see this in your directory listing:
hybrid-portsrc-x86_32_5_10_27_6.tar.gz
lib
Makefile
src

Add the following line to the file. Open file include/typedefs.h and add there the line below at header
#define TYPEDEF_BOOL

Without adding the header the compiling process exits with error
Now build the Loadable Kernel Module (LKM) like so:
>make -C /lib/modules/`uname -r`/build M=`pwd`

Of course, you need to make sure you have all the required kernel headers before building it. Once that’s done, your directory listing should look like this:
built-in.o
hybrid-portsrc-x86_32_5_10_27_6.tar.gz
lib
Makefile
modules.order
Module.symvers
src
wl.ko
wl.mod.c
wl.mod.o
wl.o

The magic file we need is wl.ko. Make sure you don’t have b43, b43legacy or b43xx loaded by running this:
>rmmod bcm43xx; rmmod b43; rmmod b43legacy

And for good measure remove ndiswrapper modules:
>rmmod ndiswrapper

Now load the module ieee80211_crypt_tkip:
>modprobe ieee80211_crypt_tkip

And finally load the wl.ko module:
>insmod wl.ko

Now if you do an ifconfig, you should see wlan0 right after your eth0 and lo devices.Test it out by scanning and connecting to a network. If it works, then you might want your module to load upon boot, which is something the Broadcom readme doesn’t touch on. Let me school you how.
Copy the wl.ko file to /lib/modules/2.6.26-1-686/kernel/net/wireless/
>cp wl.ko /lib/modules/2.6.26-1-686/kernel/net/wireless/

Create the module dependencies:
>depmod -a

Try loading your new module!:
>modprobe wl

If you get no error on modprobe, then it worked perfectly! Next you have to tell your system to load the module at startup. On my debian system, I do this by editing the file /etc/modprobe.conf to include the following:
>alias wlan0 wl

Now, reboot and you’ve got official Broadcom wifi. 
If you Need to setup linux as router do as follows?
Enable the ipforwarding and add the masqurade to eth0
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
***********************************************
Do reply & post me methods of doing it in other
linux OSs.

1 comment:

  1. ur blog is really nice and helpful for all. I just wanna suggest that u should go for blog advertising & marketing there is a website which is offering very unique features at affordable prices. There are Expert advertising teams who will promote ur blog & affiliate ads through all over the networks. All u have to do is submit your blog plus pay affordable prices and rest leave it to Advertising Team for promotion & marketing then see how u enjoy a lots of quality traffic plus good readers to ur blog. Eventually I have bookmarked your blog & also shared with my friends so keep posting & happy blogging…

    ReplyDelete