Networking :: WiFi card start on boot ?



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

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.

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


original here.