Configuring a Linksys Wifi card on Fedora Core 4

You do of course need to ensure that the drivers for your network card and WPA Supplicant are installed. That is beyond this howto since I’m not about to cover all linux installations and Network Cards (That and I can’t remember, been a while since I wrote these scripts). Feel free to use at your own risk, this is just a memory aid for me in case I need to use it again, at that point I’ll document it fuller  🙂

1) First, identify what you’ve actually got. This is what my machine reports:
[code lang=”bash”]$ lspci

0000:01:0b.0 Network controller: Broadcom Corporation bcm4306[/code]

2) Download the Windows XP drivers for the Linksys WMP54G Network card here you will need to know which card version you have. 

3) Follow the instructions on Installing NDIS Wrapper and voila, it should work. The following bash scripts are used by me, to automatically bring up the wireless interface on reboot. Feel free to use them, they are a bit messy but work fine for me. If you find a problem then feel free to fix it yourself, if you let me know about it I’ll change the script were needed and give you credit.

[code lang=”bash”] 
#!/bin/sh
# chkconfig: 2345 09 96
# Description: A script to bring up my wireless network card
# Filename: Wifi
# Created by William Dickson Friday Dec 23 2005
# For the Linksys WMP54G Network card with the Broadcom BCM4306 chipset
# Source function library.
. /etc/init.d/functions

RETVAL=0

modprobe() {
if ! grep wlan0: /proc/net/dev 1> /dev/null ; then
/sbin/modprobe ndiswrapper > /dev/null
fi
}

WPA_BIN=/usr/local/bin/wpa_supplicant
test -x $WPA_BIN || { echo “$WPA_BIN not installed”;
if [[ “$1” = “stop” ]]; then exit 3;
else exit 0; fi; }

WPA_CONFIG=/etc/wpa_supplicant.conf
test -r $WPA_CONFIG || { echo “$WPA_CONFIG does not exist”;
if [[ “$1” = “stop” ]]; then exit 2;
else exit 0; fi; }

start() {
# Check to see that there is a device called wlan0 and if there is one
# then continue to load wpa_supplicant
if grep wlan0: /proc/net/dev 1> /dev/null ; then
# Authenticate to the the Access Point using the wpa_supplicant
# program installed previously and the access information store in the file # /etc/wpa_supplicant.config.
$WPA_BIN -Dndiswrapper -i wlan0 -c $WPA_CONFIG -Bw > /dev/null
# /sbin/dhclient -q &> /dev/null
#if ! /sbin/route | grep “default” 1> /dev/null; then
#/sbin/route add default gw 192.168.1.1
#fi
return $RETVAL
fi
}

stop() {
# Check to see that the Wireless interface is up and if so then bring it down.
if grep wlan0: /proc/net/dev 1> /dev/null; then
# Check to make sure that the wireless lan interface is up and if it is
# then bring it down
if ! /sbin/ifconfig | grep “wlan” 1> /dev/null; then
/sbin/ifconfig wlan0 down
fi
/usr/local/bin/wpa_cli terminate &> /dev/null
return $RETVAL
fi
}

# Check to see that ndiswrapper has installed the Linksys network card with
# Broadcom chipset, if it has not then echo an error message. This can be
# checked by using the command: ndiswrapper -l
# Installed drivers:
# bcmwl5 driver present, hardware present
if /sbin/lspci | grep BCM4306 > /dev/null ; then
# See how we were called.
case “$1″ in

start)
modprobe
start
;;

stop)
stop
;;

restart)
stop
start
;;
*)
echo $”Usage: $0 {start|stop|restart}”
exit 1
esac
else echo “Card not present, cannot initialise”
fi
exit $?
[/code]

[code lang=”bash”]
# Please read /usr/share/doc/initscripts-*/sysconfig.txt
# for the documentation of these parameters.
IPV6INIT=no
ONBOOT=yes
USERCTL=no
PEERDNS=yes
TYPE=Wireless
DEVICE=wlan0
HWADDR=00:0f:66:f2:b6:74
BOOTPROTO=static
IPADDR=192.168.1.10
NETMASK=255.255.255.0
NETWORK=192.168.1.0
BROADCAST=192.168.1.255
GATEWAY=192.168.1.1
DHCP_HOSTNAME=
DOMAIN=
ESSID=’The name of your Access Point’
CHANNEL=1
MODE=Managed
[/code]
[code lang=”bash”]
# Filename: wpa_supplicant.conf
# Should be place in /etc
# allow frontend (e.g., wpa_cli) to be used by all users in ‘wheel’ group
ctrl_interface=/var/run/wpa_supplicant
#
network={
ssid=”The name of your Access Point”
psk=”Your own passphrase”
key_mgmt=WPA-PSK
proto=WPA
}
[/code]
[code lang=”bash”]
# Filename static-route
# /etc/sysconfig/static-routes
any: net 127.0.0.0 netmask 255.0.0.0 dev lo
any: net default gateway 192.168.1.1 wlan0
[/code]

Leave a Reply