WiFi card start on boot ?


Forum: Networking
Topic: WiFi card start on boot ?
started by: loserbaby

Posted by loserbaby on Sep. 04 2006,22:07
My wifi card, PCMCIA, is working fine with ndiswrapper. However, I have to enter command " sudo iwconfig wlan0 essid ****** key ****** " then goto netsetup,netcard config... every time I boot my computer. None of this is a big deal and it is now second nature, but I am still wondering if I have missed some simple solution that will start my card and allow to connect with my given info automatically.
Posted by ^thehatsrule^ on Sep. 06 2006,21:10
See /opt/bootlocal.sh
Posted by joer on Sep. 06 2006,22:39
If you use the control panel then a script is generated in /opt/bootlocal.sh called myndis.sh. sudo that script or all a call to that script in /opt/bootlocal.sh
Posted by loserbaby on Sep. 13 2006,17:48
Quote (joer @ Sep. 06 2006,18:39)
If you use the control panel then a script is generated in /opt/bootlocal.sh called myndis.sh. sudo that script or all a call to that script in /opt/bootlocal.sh

here's my output

#!/bin/bash
# put other system startup command here
/sbin/syslogd
loadkeys us

Posted by roberts on Sep. 14 2006,05:21
The myndis.sh script is created in the /opt  directory.
Look for it in /opt
Add it to your .filetool.lst to have in the backup/restore
Add it to the /opt/bootlocal.sh to have it start at bootup.

Newer versions of DSL prompt you to "Save wireless" upon shutdown. This automates the above process.



Posted by Wittfella on Sep. 14 2006,11:48
G'Day all,

I have finally got my wireless working after much consternation, and have the same issue as the OP. (Running a full HD install)

In my "/opt/bootlocal.sh" I have to have the following to get it to work;

Code Sample
modprobe ndiswrapper
sleep 2
sudo iwconfig essid XXXX key open XXXX
sudo ifconfig wlan0 XXXX netmask XXXX broadcast XXXX up
sleep 2
sudo route add default gw XXXX


First problem:
I can't get ndiswrapper to load automatically. "ndiswrapper -m" said an alias already exists, but when I check "/etc/modprobe.conf" it is empty. I manually put in "alias wlan0 ndiswrapper" but no luck.

Second:
I don't understand why I have to run the iwconfig and ifconfig commands again.  I have checked both "/etc/network/interfaces" and "/etc/sysconfig/network-scripts/ifcfg-wlan0" and they contain all the required info.  

Shouldn't I be able to bring it up with just "ifconfig wlan0 up"?

If you have to enter the whole command again, what is the point of the "interfaces" and "cfg-wlan0" files.

Struggling to understand some things, new to linux!

Cheers,
Wittfella

Posted by roberts on Sep. 14 2006,15:31
Most of the answers posted here are for liveCD or frugal installs.
That is why those commands are listed in /opt/bootlocal.sh
Traditional hard drive installs should work as any typical distro.

Posted by Wittfella on Sep. 18 2006,15:03
G'Day,

For those people who have a full HD install, this is how I got it to work automatically at startup. I realise it seems a long way around, and its easier to put the commands in bootlocal.sh, but I wanted to get it to work using the rc5.d startup stuff.

Firstly, you have to make sure the "/etc/network/interfaces" file is configured correctly. It should look similar to this (i use static,  dhcp is slightly different)

Code Sample
auto lo wlan0
iface lo init loopback

iface wlan0 inet static
    address 192.168.1.3
    netmask 255.255.255.0
    network 192.168.1.0
    broadcast 192.168.1.255
    gateway 192.168.1.1        <----my router, yours may be different

    wireless-key XXXXXX open   <----it defaults to "Restricted security", which is the same as "Shared". I happen to use "Open".
    wireless-essid XXXXXX


Assuming you have already loaded ndiswrapper you should now be able to bring up the network with;

Code Sample

ifup wlan0


"ifup" basically just runs iwconfig and ifconfig using the information supplied in the configuration file.

In my case, I cannot get ndiswrapper to load automatically. I added it to "/etc/modules" as instructed in many places but still no go.  I eventually got it to work by modifying the "interfaces" file again;

Code Sample
auto lo wlan0
iface lo init loopback

iface wlan0 inet static
    pre-up modprobe ndsiwrapper     <----added these two lines
    pre-up sleep 4

    address 192.168.1.3
    netmask 255.255.255.0
    network 192.168.1.0
    broadcast 192.168.1.255
    gateway 192.168.1.1        <----my router, yours may be different

    wireless-key XXXXXX open   <----it defaults to "Restricted security" normally, which is the same as "Shared". I happen to use "Open".
    wireless-essid XXXXXX

I needed the sleep command because ndiswrapper takes a couple of seconds to activate, so you need to make sure wlan0 is created before iwconfig is called.

Now to get this executed at boot using the normal rc.d stuff, go to "/etc/rc5.d" and create a symlink to the standard network startup script, which basically just calls "ifup -a".

Code Sample
ln -s /etc/init.d/networking S20networking

Hope this is of use to someone,

Cheers,
Wittfella

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.