LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Linux Answers > Networking
User Name
Password

Notices


By raxxal at 2005-02-23 13:33
How to set up a Linux wireless LAN.
By Alex Rodriguez

Some vendors do not provide linux driver for their wireless network cards, so a hack must be implemented. What we are going to implement is the Windows NDIS (Windows network driver API) drivers supplied by the vendors.


Install ndiswrapper. Get the latest version at:
http://sourceforge.net/projects/ndiswrapper/

untar it, cd to the new ndiswrapper dir, and install it(make, make install).
Get the windows driver for the wireless card you have, you may find it in your Windows CD that came with your wireless card provided by the vendor.

ndiswrapper -i bcmwl5.inf <-- this the driver for my wireless card, yours probably will be different.

You need to look for the file with the extension inf.

Next, type: modprobe ndiswrapper, and bingo! Your wireless card LED should light up. Just not ready yet.
To check that the driver has been installed type:
ndiswrapper -l
Installed ndis drivers:
bcmwl5 driver present, hardware present.

Next, you need to create a file in /etc/sysconfig/network-scripts called : ifcfg-wlan0
Add the following to this file:

DEVICE=wlan0
BOOTPROTO=dhcp
HWADDR=00:90:4X:94:22:6X <- Your wireless card MAC address, get it with ifconfig
ONBOOT=yes
TYPE=Wireless
MODE=Managed
ESSID='HomeNet' <- The name of your access point(wireless router).
CHANNEL=
IPADDR=
DOMAIN=
NETMASK=
USERCTL=no
PEERDNS=no
GATEWAY=
IPV6INIT=no
RATE=Auto
KEY=7DC0E6358666EEFA3B088888 <- Your access point generated security key.



Finally, you need to create a script, name it whatever you want, I named mine: wlan.
Add to this script the following:

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 HomeNet

echo " --Setting to cchannel 11..."
iwconfig wlan0 channel 11

echo " --Turning on managed mode..."
iwconfig wlan0 mode Managed

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

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

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

Make it executable: chmod 755, then add it to your rc.local, and your set to go. Every time the computer boots up, your wireless lan should come up ready to go.

Run iwconfig wlan0 to see how your wireless card is doing:

iwconfig wlan0
wlan0 IEEE 802.11g ESSID:"HomeNet"
Mode:Managed Frequency:2.462GHz Access Point: 00:12:17:19:5A:CA
Bit Rate:54Mb/s Tx-Power:25 dBm
RTS thr:2347 B Fragment thr:2346 B
Encryption key:7DC0-EAAA-8666-EEFA-3B06-2556-77 Security mode:restricted
Power Management:off
Link Quality:100/100 Signal level:-45 dBm Noise level:-256 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:2551 Missed beacon:0




Want to see more? Run the following command:

iwlist scanning
lo Interface doesn't support scanning.

eth0 Interface doesn't support scanning.

eth1 Interface doesn't support scanning.

sit0 Interface doesn't support scanning.

wlan0 Scan completed :
Cell 01 - Address: 00:12:17:19:5A:CA
ESSID:"HomeNet"
Protocol:IEEE 802.11b
Mode:Managed
Frequency:2.462GHz
Quality:0/100 Signal level:-54 dBm Noise level:-256 dBm
Encryption key:on
Bit Rate:1Mb/s
Bit Rate:2Mb/s
Bit Rate:5.5Mb/s
Bit Rate:6Mb/s
Bit Rate:9Mb/s
Bit Rate:11Mb/s
Bit Rate:12Mb/s
Bit Rate:18Mb/s
Bit Rate:24Mb/s
Bit Rate:36Mb/s
Bit Rate:48Mb/s
Bit Rate:54Mb/s
Extra:bcn_int=100
Extra:atim=0

by nlugenga on Mon, 2005-04-18 08:54
Hei,
I am grateful for all the instructions you gave on installaing the ndiswrapper for my network card,
but the command
modeprobe ndiswrapper gives an error:
"
root@nlugenga-lnx driver]# modprobe ndiswrapper
/lib/modules/2.4.21-20.EL/misc/ndiswrapper.o: The module you are trying to load (/lib/modules/2.4.21-20.EL/misc/ndiswrapper.o) is compiled with a gcc
version 2 compiler, while the kernel you are running is compiled with
a gcc version 3 compiler. This is known to not work.
/lib/modules/2.4.21-20.EL/misc/ndiswrapper.o: insmod /lib/modules/2.4.21-20.EL/misc/ndiswrapper.o failed
/lib/modules/2.4.21-20.EL/misc/ndiswrapper.o: insmod ndiswrapper failed

"
However the second command to list the driver, i.e. ndiwrapper -l shows the driver and hardware to be present.
can you give soem idea on how too solv this problem?

regards,

Lugenga

by Dee on Mon, 2005-04-18 16:28
[QUOTE]Originally posted by raxxal
This thread is to discuss the article titled: Linux Wireles LAN [/QUOTE

I'm a newbie

When I boot my linux box up after following all the directions: I get a error message that the mac address isn't correct............I've double check to make sure that there's know typo in my ifcfg-wlan0 but it keeps giving error about mac address not being right...............what I'm thinking is it could be conflicting with my nic card eth0 because I get a error for this as well.................So with that said is there away to disable it for testing purposes..............Also can you point me in the right direction for download ndiswrapper, the exact link to download .....................I'm running fedora

Thanks for your help...................if anymore info is needed please remember I'm a newbie

by JerryNew2Linux on Mon, 2005-04-18 17:53
I think it is very clear, and I was able to follow it through without great Linux knowledge. I've installed the package already a couple of times, and this seems clear--complex, but clear.

The question I have is: WHY IN THE WORLD DON'T ALL DISTROS COME WTH NDISWRAPPER ALREADY INSTALLED?

And a bunch of the most common drivers already present?

And a simple dialogue box that pops up when the hardware detected is not covered by the installed driver list, telling the newbie how to open a console and install the correct driver?

What am I missing here? Does the Linux community really want people migrating from Windoze to go through this? My vision of converting people is to enable them to use the OS first, then teach them how to manipulate it.

by workingthepenguin on Thu, 2005-09-08 02:18
Hi,

I followed the instructions to the word, however Iam having this problem: When Linux is starting I get messages: Bringing up Device Wlan0 [Failed] Different Physical address than expected. Then when linux has loaded completely, I open the terminal and do the following:


[root@localhost ~]# /etc/rc.local
Loading ndiswrapper...
Setting mode Managed...
Setting up wireless interface wlan0...
-- Setting ESSID
--Setting to cchannel 11...
--Turning on managed mode...
Bringing up interface wlan0...
Activating UP address via DHCP...
Internet Systems Consortium DHCP Client V3.0.1
Copyright 2004 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/products/DHCP

sit0: unknown hardware address type 776
sit0: unknown hardware address type 776
Listening on LPF/wlan0/00:0b:cd:75:c7:5a
Sending on LPF/wlan0/00:0b:cd:75:c7:5a
Sending on Socket/fallback
DHCPREQUEST on wlan0 to 255.255.255.255 port 67
DHCPACK from 192.168.2.1
SIOCADDRT: File exists
bound to 192.168.2.30 -- renewal in 1021319845 seconds.
[root@localhost ~]#


OR


[root@localhost ~]#modprobe ndiswrapper
[root@localhost ~]# dhclient wlan0
Internet Systems Consortium DHCP Client V3.0.1
Copyright 2004 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/products/DHCP

sit0: unknown hardware address type 776
sit0: unknown hardware address type 776
Listening on LPF/wlan0/00:0b:cd:75:c7:5a
Sending on LPF/wlan0/00:0b:cd:75:c7:5a
Sending on Socket/fallback
DHCPREQUEST on wlan0 to 255.255.255.255 port 67
DHCPACK from 192.168.2.1
SIOCADDRT: File exists
bound to 192.168.2.30 -- renewal in 1021321553 seconds.
[root@localhost ~]#

and everything works fine. Can anyone please tell me how to avoid doing this time and again?

by U4ea on Tue, 2005-10-25 04:00
Why bother making a script? You have all the settings in ifcfg-wlan0, you can just run "ifup wlan0"...

...however this still leaves a problem with the ndiswrapper module not being loaded on boot - to solve this either edit your /etc/modprobe.conf to include the module, or run "ndiswrapper -m" to edit the file automatically.

Re: the incorrect mac address problem above, just remove the HWADDR line from ifcfg-wlan0 file.

Regards,

Haydn.

by raxxal on Sat, 2005-11-12 03:25
For those with routers without encryptions keys, they need to modifie the scripts a little bit.


echo "Loading ndiswrapper..."
modprobe ndiswrapper

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

echo " -- Setting ESSID"
iwconfig wlan0 essid default <------ Not ESSID, still "default" need to be used.

echo " --Setting to cchannel 11..."
iwconfig wlan0 channel 11

#echo " --Setting encryption key" <--- Not encription key, comment out both lines.
#iwconfig wlan0 key restricted 7DC0E6358666EEFA3B0628888 <-- Your security key

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

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

by Diademed on Thu, 2006-01-05 03:49
Quote:
Originally Posted by JerryNew2Linux

What am I missing here? Does the Linux community really want people migrating from Windoze to go through this? My vision of converting people is to enable them to use the OS first, then teach them how to manipulate it.
First off, linux is NOT windows. Much of Windoze is essentially bloat. Linux purposefully does not include every possible driver, because it is unnecessary, and will slow down your system. Certain distros, such as Suse, Gentoo, Ubuntu, Xandros and the like may tend to have more newbie friendly drivers and automation than a more core-based distro like slackware.

Believe it or not, the goal of Linux is not to suck people from the Windows community. Rather, to give them choices in what they do. If you want a distro that 'just works', try Ubuntu, Knoppix, Xandros....use it until it breaks, then learn how to build a system from scratch, if you so desire.

by Roger Vardon on Tue, 2006-01-31 21:40
This is all old stuff. Or, am I missing something? What version and which Linux are you doing this on? Fedora Core 4 does not go this route.

Q.E.D.

by rickh on Tue, 2006-01-31 22:46
Sorry to interject negativity here, and I happily admit to not reading the article, but,

... Wireless cards have gotten low enough in price that encouraging people to use ndiswrappers is shameful. If your card doesn't have a native driver available, get a different one. That said getting a wireless card going can be a frustrating experience, especially on a laptop. But it feels so good when you finally get it working ...

by Allanitto Newbee on Fri, 2007-10-26 17:43
Hi,

I know this is a very old topic here in LQ but I just used it on my Slackware 12 and is so much faster to load on boot than to use what the kernel has prepared configurations. I am so happy. My questions are... 1)how am I going to insert wpa_supplicant in either of the script created here and where?
2) should I download wpa_supplicant from source or just use the one that comes with the Kernel(Slackware 12 I know there is).

can I just insert this somewhre in the script?

wpa_supplicant -c /etc/wpa/wpa.conf -D wext -dd -i wlan0 -B

if I had created a configuration file in /etc/wpa/wpa.conf?


Thanks


  



All times are GMT -5. The time now is 03:03 PM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration