LinHES Forums
http://forum.linhes.org/

HOWTO Autostart Wireless Card wlan0 with settings on reboot
http://forum.linhes.org/viewtopic.php?f=3&t=8228
Page 1 of 1

Author:  kbanse [ Wed Feb 01, 2006 7:46 pm ]
Post subject:  HOWTO Autostart Wireless Card wlan0 with settings on reboot

After I got my ndiswrapper installed, and got my MN-730 wireless pci card from Microsoft working, it wouldn't connect after reboot. So I had to manually go to the command line and start the card, enter my wep key etc...

This is how to fix it.

Add a file called ifcfg-wlan0 to /etc/sysconfig/network-scripts
In that file, add the following:
Code:
DEVICE=wlan0
BOOTPROTO=dhcp
HWADDR=xx:xx:xx:xx:xx:xx  <-- your card MAC address - get it with ifconfig
ONBOOT=yes
TYPE=Wireless
MODE=Managed
ESSID='yournetworkname'
CHANNEL=
IPADDRESS=
DOMAIN=
NETMASK=
USERCTL=no
PEERDNS=no
GATEWAY=
IPV6INIT=no
RATE=Auto
KEY=xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xx <-- Whatever your WEP key is


Create a file called wlanup (or whatever you want)

In it, put the following:

Code:
echo "Loading ndiswrapper..."
modprobe ndiswrapper

echo "Setting mode Managed..."
iwconfig wlan0 mode Managed

echo "Setting up wireless interface wlan0..."
echo " -- Setting ESSID"
iwconfig wlan0 essid YourNetworkName

echo " --Setting to cchannel 6..."
iwconfig wlan0 channel 6  <-- Your channel number

echo " --Setting encryption key"
iwconfig wlan0 key restricted XXXXXXXXXXXXXXXXXXXXXXXXXX <-- Your security key

echo "Bringing up interface wlan0..."
ifconfig wlan0 up

echo "Activating UP address via DHCP..."
dhclient wlan0


Then save it in /etc/init.d don't name it "wlan" because there is already one there, so choose something like "S45wlanup"

Then...
Code:
chmod 755 /etc/init.d/S45wlanup


Next, create a symlink to the file you just made and put it in /etc/rc5.d
Code:
cd /etc/rc5.d
ln -s /etc/init.d/S45wlanup


I'm going from memory but I think that's about it. Let me know if I've missed anything.

Good Luck.

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/