Ndiswrapper: Broadcom BCM4306 802.11b/g WLAN with Linux and WPA supplicant (EAP/TLS)

Translation of the original in Catalan. Read it in: CatalàCastellano

wifi.gif

This is the mini-PCI card that is built into my DELL X300, in fact until now I hadn't been able to configure it in any way. But yesterday things finally changed. So in case anyone has this card, they should know that with the new kernel and ndiswrapper versions it can be made to work with the Win driver under Linux.

In the end it hasn't been very difficult, although in the earlier attempts I sweated a lot. The first thing I recommend is to make sure that you don't have a kernel with the "CONFIG_4KSTACKS" option checked and if you are Gentoo users that the USE variable doesn't have the "4kstacks" flag. You also need the source code of the compiled kernel to be in /usr/src since it is necessary to be able to do the emerge of ndiswrapper without problems.

Let's suppose we have already done the emerge of net-wireless/ndiswrapper, concretely I have installed the ndiswrapper-1.0_rc4 package. Then I have put the windows driver in the /etc/ndiswrapper directory, concretely the files bcmwl5.inf and bcmwl5.sys. You will have these two files in Windows if you have configured the wi-fi card there. If not, I attach a package containing the Windows driver: SP23107A.tar.gz you can uncompress it and copy the files I mention to /etc/ndiswrapper.

Now you can run a: ndiswrapper -l and see if you have the driver loaded:

# ndiswrapper -l
Installed ndis drivers:
bcmwl5  driver present, hardware present

if not, you can load it with:

ndiswrapper -i /etc/ndiswrapper/bcmwl5.inf

Now you have to load the kernel module so that the card is loaded into linux:

modprobe ndiswrapper

If you look at /var/log/messages or do a dmesg you will be able to see something similar to this:

ndiswrapper version 1.0rc4 loaded (preempt=yes,smp=no)
ndiswrapper: driver bcmwl5 (Broadcom,10/28/2003, 3.40.25.3) added
ACPI: PCI Interrupt Link [LNKE] enabled at IRQ 5
PCI: setting IRQ 5 as level-triggered
ACPI: PCI interrupt 0000:02:04.0[A] -> GSI 5 (level, low) -> IRQ 5
ndiswrapper: using irq 5
wlan0: ndiswrapper ethernet device 00:90:96:a3:65:ec using driver bcmwl5
wlan0: encryption modes supported: WEP, WPA with TKIP, WPA with AES/CCMP
mtrr: base(0xe8020000) is not aligned on a size(0x300000) boundary

As the log tells us, we already have the wlan0 interface created:

# iwconfig
lo        no wireless extensions.
eth0      no wireless extensions.
wlan0     IEEE 802.11g  ESSID:off/any
          Mode:Managed  Frequency:2.462 GHz  Access Point: 00:00:00:00:00:00
          Bit Rate:54 Mb/s   Tx-Power:25 dBm
          RTS thr:2347 B   Fragment thr:2346 B
          Encryption key:off
          Power Management:off
          Link Quality:99/100  Signal level:-66 dBm  Noise level:-256 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:1956  Invalid misc:47992   Missed beacon:0

Remember, however, that you have to do an ifconfig wlan0 up because otherwise in the kernel interface listing you won't see the interface, since by default it is down. Now you only have to configure the wifi interface with iwconfig, for example:

iwconfig wlan0 essid nomxarxa

With this, if the network doesn't have WEP or any security system, we will have enough for the rest of the things, like the channel, to be configured by themselves. If you want to see which networks we have available we can use the command:

iwlist wlan0 scan

You can find this command inside the net-wireless/wireless-tools package.

To configure our network card as a WPA client you can install the package: net-wireless/wpa_supplicant, concretely I have installed version 0.3.6. The configuration is explained by pof in a comment of the article: Secure Wi-Fi Network: freeRadius + WRT54G = 802.1x (WPA-radius EAP/TLS). But I summarize it here. After installing the mentioned package you only have to configure the /etc/wpa_supplicant.conf file, for example following the configuration of the mentioned post it would look like this:

network={
ssid="druvs"
proto=WPA
key_mgmt=WPA-EAP
pairwise=TKIP
group=TKIP
eap=TLS
identity="exemple@exemple.com"
ca_cert="/etc/cert/root.pem"
client_cert="/etc/cert/root.pem"
private_key="/etc/cert/root.p12"
private_key_passwd="whatever"
}

To launch the client you only have to put:

wpa_supplicant -B -iwlan0 -c/etc/wpa_supplicant.conf -Dndiswrapper

If you want to launch it in error debugging mode:

wpa_supplicant -dd -iwlan0 -c/etc/wpa_supplicant.conf -Dndiswrapper

Don't forget that if you have to obtain the IP address from the AP you have to launch the DHCP client or if you use static IPs you have to configure the wlan0 interface with ifconfig.

3 comments

Comments from the old blog, as they were written. Comments are closed.

  1. B2K

    Thank you guy,

    it works fine !!

    My broadcom bcm4306 on a dell latitude laptop works fine now !

    thank a lot

    B2K

  2. b.labartette

    And me to, but I don't use WPA for this time, I can't connect with it. I don't know why.

    But Wifi works fine now.

    Thanks a lot.

  3. jose

    driver