[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Starting wlan0 instead of eth0



On Thursday 26 May 2005 01:39 am, Jason Edson wrote:
> I'm new to this part of my debian system. Instead of having eth0 load
> up when my system starts, I want to run a script that enables my
> wireless card(wlan0) that uses ndiswrapper to load. My script looks
> like this:
>
> #!/bin/bash
> echo "Starting wireless networking....."
> ifconfig eth0 down
> modprobe ndiswrapper
> sleep 1
> iwconfig wlan0 mode Managed
> iwconfig wlan0 essid cocksmoker
> iwconfig wlan0 key blahblahblahmynetkey
> dhcpcd -t 10 -d -G 192.168.1.1 wlan0
> echo "Wireless networking started.....hopefully!"
>
> I don't know how to achive this so any pointers or links for some
> reading would be very appreciated. Thanks for your time.

Take a look at the man page for interfaces.

I think what you want to do is to make sure you have a line in 
the /etc/network/interfaces that looks something like this:

auto wlan0 

This should be near the top of the file.  In addition, you can then do 
something like this for your iwconfig stuff show above (this is also in the 
file /etc/network/interfaces) :

iface wlan0 inet dhcp
        pre-up modprobe ndiswrapper
        pre-up iwconfig wlan0 essid cocksmoker
        pre-up iwconfig wlan0 key blahblahblahmynetkey
        post-down rmmod ndiswrapper


John



Reply to: