Wireless Networking with VectorLinux 5 and aboveIntroduction:
In light of the growing demand for help with wireless hardware and networking, this HowTo should cover the basics that anyone can follow to get "on the air".
This HowTo will cover wireless networking using VectorLinux 5 and above.
It includes using wireless 802.11A/B/G standards and will also included help for the usage of WEP and WPA protocols.
It will be updated when necessary with new information about wireless networking and new tools that may make it easier to use wireless networks.
I suggest you read through the HowTo first before getting started. There are a few sections that assume you have Internet access to look up names or download drivers, but this may not be your case, so it will be better to read first and find which sections cover your specific needs better.
Lets get started! - Step 1: Know if your hardware works
The very first thing you should do is to find out if a certain card is known to work with Linux before you buy it. Even if a native driver is not availible, then NdisWrapper is usually the next best thing, but it is not 100% fail-safe either!
I suggest that you visit this website, for information on wireless cards:http://linux-wless.passys.nl/
You can select a brand, bus type (USB, PCMCIA, PCI, etc) or chip type as a filter, but the easiest is probably to find a card in a store, write down the name and model, and then search for it on that site.
So, select the brand name and then press the "Show" button.
A list will be presented to you, and is self-explanatory.
Should you have purchased a card before consulting the compatibility list, chances are still good that it will work, but you might need to keep your fingers crossed for luck. - Step 2: Making sure your card is detected
Before getting worked up about modules, VASM,NdisWrapper, configuration files and the like, take a deep breath...think clearly and work calmly. Rushing things inevitably leads to screw-ups and even more work.
Now open a terminal, logon as root and issue the following commands (as root):
If you have a PCI or CardBus/PCMCIA wireless card:
If you have a USB card/dongle:
You will be presented with a list of all the devices connected to that bus type, and you must try and locate the entry that belongs to your card.
For example, the output of lsusb on my computer is:
Bus 1 Device 1: ID 0000:0000
Bus 1 Device 2: ID 0409:0058 NEC Corp. HighSpeed Hub
Bus 1 Device 4: ID 0000:0000
Bus 1 Device 3: ID 083a:4505 Accton Technology Corp.
Bus 2 Device 1: ID 0000:0000
Bus 3 Device 1: ID 0000:0000
Bus 4 Device 1: ID 0000:0000
Bus 5 Device 1: ID 0000:0000
So, analyzing the output I got from lsusb, i can see my USB hub connected on Bus1-Device2. Since i have nothing else connected to my USB ports, the next entry has to be my wireless card.
The brand name presented for my card by lsusb is not consistent with the brand name on the box the card came in (I have an SMC USB dongle), but that can be explained because the chip inside the card was probably not manufactured by SMC Corp.
So, once you find out which entry is most likely your card's, the really important piece of information is the ID number.
In my case, it is 083a:4505
Write down the ID number for your card, and then if possible, use Google to search for the web for it.
After "Googling" my card's ID number, surely enough websites popped up leading to SMC's website, and other indicating that that number refers to a Zydas ZD1211 wireless chip. Perfect!
After knowing what chip your card carries, things get a lot easier. - Step 3: Get your card and computer talkinga ) With a native Linux module
To try to get your card communicating with VectorLinux, the first thing you should try is VASM's hardware auto-detect utility.
Still using your terminal and logged on as root, type: (save anything you were working on before doing this, because X server will shut down)
You will be dumped into text-mode, where VASM can analyze things properly
Login as root once again, and then simply type:
And hit enter. The familiar VASM interface will appear. Navigate through the menu to HARDWARE ---> HWCONF and press enter.
Your harware will be probed, and you should see whether your new card has been detected.
Once it has finished you can exit VASM and start X again by giving this command:
As soon as you have logged in again,open a terminal and type:
You should see text being displayed in your terminal window, that looks something like this:
# /etc/modprobe.conf (old location for Linux 2.6+ config)
# The use of this config file is deprecated if you are using a
# 2.6.x or newer kernel. Instead, create files in the
# /etc/modprobe.d/ directory containing modprobe options.
# For more information, see "man modprobe.conf".
alias eth0 ne2k-pci
alias wlan0 zd1211b
The actual contents of the file may vary, but i'm giving mine as an example.
If you have an ethernet card, then there should be a line called "alias eth0 xxxxx"
, where xxxxx stands for the network card's module name.
If your wireless card was detected by VASM, then another entry should appear called "alias wlan0 xxxxxx"
, or maybe "alias eth1 xxxxxx"
If that is the case, then your network interface has been properly created.
It might also happen that VASM failed to find a module for your card and thus, did not create a new alias.
In that case, please refer back to your cards ID number you got earlier on, and search Google for it again, combining the ID number with terms like "linux" and "module". Example, place this in the search bar: 083a:4505 module
Once you find a suitable module name, you can try inserting the module.
In your root terminal, type these commands:
Where xxxxxxx is the name of the module you looked up.
In my case, the module name was zd1211b, so I typed:
If after you typed those commands and got no errors, then you know that you have the right module in place to get your card going. So next, you can add the alias manualy to /etc/modprobe.conf. Run this:
At the end of the file, create a new alias that will look like this:
alias wlan0 xxxxxxxxx
Replace xxxxxxx with the name you used in the modprobe command.
Aliases are necessary to tell the kernel to "link" a module or driver to a word. This way you can use the alias to set up a hardware interface that you can work with, and to be able to interact with the module.
If you are using VectorLinux 5.8 or above, if your card does have native support then the module will be loaded automaticaly.
VectorLinux 5.8 uses ifplugd to monitor network interfaces and try and connect to the ones it was assigned to.
You may want to add wlan0 (or whatever network interface you assigned to your card) to ifplugd.
Open /etc/ifplug.d/ifplugd.conf with you editor and find the line that looks like this:INTERFACES="eth0"
Add your network interface to that line, so it should look like this:INTERFACES="eth0 wlan0"
When a new interface has been added to ifplugd then it must be restarted.
You can restart ifplugd with the following command:
service ifplugd restart
But I have found that sometimes I need to reboot to get the interface up and running with ifplugd, although simply restarting it is fine most of the times.
On the other hand, you may also have run into an error when trying to modprobe the module name you found with Google. If so, then you have two options: You can visit the website of the company that manufactured your card's chip or you can use NdisWrapper to try and use a Windows XP driver as a substitute.
If you decide to go with the first option, then you might need to compile the module for your card by yourself, since all the manufacturers don't provide a read-made module for you. This might be the toughest path if you are not familiar with compiling software from source because you might also need additional libraries and the source code for your kernel too. Read the information provided with the source code carefully and think where its worth your time going to that effort.b ) Using NdisWrapper
The next best option is to use NdisWrapper. NdisWrapper is a module that "wraps arround" a Windows network driver, allowing the Linux kernel to work with it. NdisWrapper is known to work exceptionally well and can replace the native Linux module for your card should it not exist or be to hard to obtain.
However, it is not 100% fail-safe so don't expect miracles!
You might find NdisWrapper to be your only recourse if you don't have any internet connection to search for information regarding the native Linux kernel modules for your card or download the appropriate module source code. NdisWrapper allows you to do (nearly) everything offline.
NdisWrapper is very easy to use, even though its a command-line tool (at least for now).
Your wireless card was certainly accompanied by an installation CD that contains the Windows XP drivers for your card, but it is recomended that you first visit the following website to know if there are any Windows drivers for your card recommended by the NdisWrapper team:http://ndiswrapper.sourceforge.net/mediawiki/index.php/List
Get the right driver from the manufacturer's website, and unzip it into a folder on your hard-drive.
If you don't have any way to access the website, then you will have to use the Windows XP drivers provided on the CD that was supplied with the card.
Windows XP drivers are files that end with a .inf extension. So, when looking for the Windows driver for your card, you must find a file that ends in .inf
As soon as you locate the driver, then open up a terminal as root and navigate to the directory where the driver is:cd /xxx/xxx/xxx
Replace /xxx/xxx/xxx with the path to the folder.
that will list the contents of the folder.
Next, you must insert the driver into NdisWrapper, using the following command:
ndiswrapper -i drivername.inf
Replace drivername with the name of the Windows driver you want to use (and don't forget to included the .inf extension at the end!)
When you hit enter no errors should occur.
There should also be a file that has a .sys
extension, and it must be in the same folder as your .inf
Now, check to see if NdisWrapper is able to make that driver find your card using:
You will be given a list of currently installed drivers, and their status:
2802w driver installed
airplus driver installed
bcmwl5 driver installed
gplus driver installed
mrv8ka51 driver installed, hardware present
net8180 driver installed
netadm11 driver installed
netdlwl driver installed
ntpr11ab driver installed
w70n51 driver installed
If all goes well, the line that corresponds to the driver you just installed will say "driver installed, hardware present".
If it doesn't have "hardware present" on that line, then your card is not being detected.
Now, you need to create an alias for your card that links to the ndiswrapper module, as you would do with a native module.
You can do this by typing:
However, you should make sure that it was actually created before proceeding, so type:
Some text will be displayed in your terminal, and make sure that there is an entry called alias wlan0 ndiswrapper
If there isn't then add it yourself to the end of modprobe.conf:
You are finally ready to try out NdisWrapper and see if it works!
Enter these commands to get NdisWrapper's module running:
If there were no errors, then you have NdisWrapper up and running!
Follow the same procedure as mentioned above for adding wlan0 to ifplugd, if you are using VectorLinux 5.8 or higher.
Note for VectorLinux 5.8 Standard users:
Use GSlapt or slapt-get to update NdisWrapper to the version provided in the repository.Step 4 - Getting connectedI) Doing it Old-Schoola ) Open Network (without WEP or WPA/WPA2)
Now that your card and computer are not ignoring each other, you can proceed to connect to your router or access point.
If you are connecting to an open network (no keys, no encryption), then this part is for you.
Otherwise if you're using WEP or WPA, skip to the next section.
Connecting to an open network is probably the easiest and requires very little effort and configuration.
However, if you are using an open network at work, it might not be a very wise idea if you have valuable data to protect.
If you are a casual home user without a care in the world, you don't mind having war-drivers camped out in front of your house 24/7, follow this section and you should have your wireless network up-and-running in no time.
Open a terminal as root and type
If you have VectorLinux 5.8 and you have added your wireless interface to ifplugd, then you should see something like this:
eth0 Link encap:Ethernet HWaddr 00:40:33:91:C0:F5
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:2 dropped:0 overruns:0 carrier:4
RX bytes:0 (0.0 b) TX bytes:1180 (1.1 KiB)
Interrupt:10 Base address:0xdf20
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:5648 errors:0 dropped:0 overruns:0 frame:0
TX packets:5648 errors:0 dropped:0 overruns:0 carrier:0
RX bytes:282400 (275.7 KiB) TX bytes:282400 (275.7 KiB)
wlan0 Link encap:Ethernet HWaddr 00:13:F7:1E:D5:58
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:15235 errors:0 dropped:0 overruns:0 frame:0
TX packets:94505 errors:0 dropped:0 overruns:0 carrier:0
RX bytes:1949939 (1.8 MiB) TX bytes:0 (0.0 b)
If you can't see your interface because you did not add it to ifplugd or you aren't using VL 5.8, then issue this command to get it going:
ifconfig wlan0 up
Replace wlan0 with whatever your network interface is.
The next step is to see you are within range of your access-point or router, and to see what details it broadcasts:
iwlist wlan0 scan
You should get something like this:
wlan0 Scan completed :
Cell 01 - Address: 00:13:F7:33:86:F9
Bit Rates:132 Mb/s
I've noticed that when using NdisWrapper, the output of that command is normaly more detailed than when using native Linux kernel modules.
As you can see, my router broadcasts its SSID as well as other data.
Sometimes routers or accesspoints won't broadcast their SSID as a "safety measure".
Now to see what data your wireless interface has ready before connecting:
You should see what details are already there.
To configure your interface with the information required, issue these commands (preferably in this order as well):
iwconfig wlan0 essid xxxxx
Replace xxxxx with your router's SSID, if it does not broadcast it automaticaly. If you SSID is comprised of several words, then you will need to wrap it with quotes:
iwconfig wlan0 essid "xxxx xxxx xxx"
Set your card's mode to Managed (Ad-Hoc is applicable in some cases, but normaly the Managed mode is the most common. You may also use the Auto mode, but this sometimes leads to miss-configurations):
iwconfig wlan0 mode Managed
Set you card to receive on any channel:
iwconfig wlan0 channel Auto
If your router is not set to auto-configure the channels and is set on a particular one, then replace Auto with the channel number.
Lastly, you must let your card know it can associate to any available access-point:
iwconfig wlan0 ap any
Now run iwconfig wlan0 again, and the data you just entered should appear in the output.
After you finished the above instructions, you can use DHCP to connect to establish a connection with your router (only if your router or access-point is configured to hand out DHCP connections, which they normaly are by default). This can take less than a second or up to a minute, depending on your drivers and your card, the router, and the signal strength/quality.
Normaly 25 seconds is enough, so you can start the network using dhcp with this command:
dhcpcd -t 25 -d wlan0
Your MAC address will appear in the terminal window, and as soon as a connection is established your IP address will appear as well.b ) With WEP
So you want some extra protection eh? WEP is ok for preventing people form "accidentaly" connecting to your wireless network.
I say this because the WEP protocol has proved to be a VERY weak means on encrypting wireless networks. Programs such as aircrack and collect data from a WEP encrypted network and decipher the keys in no time.
At least someone who does manage to use a WEP connection without authorization can't say it was by mistake, because they do need to go out of their way to get in...
Configuring your interface to use WEP is nearly as easy as when using an open network.
Scan for your network details with iwlist, as done above, and you should get a similar output:
wlan0 Scan completed :
Cell 01 - Address: 00:13:F7:33:86:F9
Bit Rates:132 Mb/s
Notice that the scan reveals that the network requires an encryption key.
The first iwconfig command to issue to your interface if the key command.
You can use either HEX keys or ASCII keys, depending on what you put into your router.
To use a HEX key, simply type:
iwconfig wlan0 key xxxxxxxxxx
Replace xxxxxxxxx with your HEX key. A HEX key is a mix of numbers and letters from A to F.
If you have ASCII version of you key, then use:
iwconfig wlan0 key s:xxxxxx
Replace xxxxxx with your ASCII key. Note that the ASCII keys are always shorter than HEX ones, so they are more practical to remember.
Now run iwconfig wlan0
again, and you should see your key in the output, under HEX form.
After this is done, you can use the rest of the instructions of the Open Network configuration to get your connection up and running.
To those who use VectorLinux 5.8 Standard:
You will notice that the WaveLan applet on the XFCE taskbar only starts indicating the presence of a signal once the WEP key has been entered.c ) With WPA/WPA2
The only way to really connect to a WPA protected network with Linux is using wpa_supplicant.
Supposedly, the iwpriv command should also enable you to configure your interface for WPA connections, but so far I haven't had much luck with that.
wpa_supplicant works by reading data from a configuration file, usually called wpa_suppplicant.conf
and placed in the /etc
The configuration file can sometimes be very complex, depending on the router's or access-point's configurations.
You can find a file with exaples of what the configuration file should look like by looking at the wpa_supplicant documentation, buried in /usr/doc/wpa_supplicant-version/doc/docbook/wpa_supplicant.conf.5. Its a pitty no man-page was offered, but then the wpa_supplicant --help command does have a few tips on how it should be used.
This is what a simple wpa_supplicant.conf file looks like:
Replace xxxxxx with the correct values. The psk parameter is where you put your key or passphrase.
The pairwise and group settings depend on what type of encryption you have set for WPA/WPA2 on your router, but aren't always necessary.
Save the settings to /etc/wpa_supplicant.conf
and then type this command to make sure the file can't be read by normal users:
chmod 600 /etc/wpa_supplicant.conf
That will keep your encryption key safe from regular users.
Make sure your wireless interface is up.
Now, to connect to the network, use this command:
wpa_supplicant -B -Dwext -iwlan0 -c/etc/wpa_supplicant.conf
If you are using ndiswrapper, then the command should look like:
wpa_supplicant -B -Dndiswrapper -iwlan0 -c/etc/wpa_supplicant.conf
You should see wpa_supplicant giving output about its status. When its done, you are connected to the network!II ) Connect using James Bond gadgets:
Luckily the GNU/Linux world is not totally void of tools with graphical interfaces.
However, since VectorLinux aims to be a lightweight and calorie-free distro, such tools are normaly hard to come by, that fit in with VL's design philosophy.
One example of this is NetworkManager. It is hailed for its great automatic network detection and setup features, and improving wireless network usability. That is all fine and good if you have a 1.4GHz Pentium 4 to make sure that all the core GNOME components run smoothly in the background.
Fortunately, a tool called WiFi-Radar emerged from the ether of the vast OpenSource world, to give users a graphical tool to easily manage their wireless connection, without hogging too many system resources.
WiFi-Radar is included by default in VectorLinux 5.8 Standard.
Before you can start using it, you must set its configuration file to use your wireless insterface.
In a terminal as root, edit wifi-radar.conf:
The second line refers to the interface to use, and looks like this:interface = eth1
Replace eth1 with your wireless network interface.
Now, select WiFi-Radar from the "Network" section of the launch menu.
You will be presented with a simple interface. If you wait for a few seconds, WiFi-Radar will automatically scan for networks, and list them.
When one appers, then press the "Edit" button.
You will be able to enter all the information needed to connect to your wireless network. After you've entered the necessary details, press "Save" and you will be returned to the main window.
Now simply click on the profile you created/modified and the press "Connect".
Simple, eh? WiFi-Radar is very handy if you use a laptop and need to access different networks. This way, you keep your configurations saved in each network's profile, and connecting is only a click away.
Another good tool for connecting to WPA/WPA2 protected networks is wpa_gui. This tool simply acts as a front-end to the wpa_supplicant command, so you still need the wpa_supplicant.conf file in /etc
for it to work.
To use it, simply run wpa_gui
from a terminal as root, or select the "Run Program" from the launch menu and enter:
It is also very straightforward and easy to use.
If you are using one of the SOHO versions of VectorLinux, you should also be able to use KWifi-Manager to configure your network.
Ralink also provides a QT based tool for its RT2500 series chips called RaConfig. It is very complete and easy to use. Extra Notes:
a ) Third-party kernel modules and stability:
Most manufacturers don't make Linux kernel modules to provide Linux support for their cards. So there are usually many different teams working on creating modules without these companies' help.
If these open-source modules end up being included in the Linux kernel its because they have passed the strict quality control of the kernel developers, and are considered good to use.
Some companies chose to provide Linux support, but do it like crap.
One example of this is Ralink. I must say that it is good to see a company that does support Linux by providing GPL'd drivers, but they are of inferior quality.
If you do chose to use a Ralink based card, then you can compile the drivers provided at Ralink's website, but you can't use them with kernel that have Symetric Multi-Processing (or SMP) support enabled.
SMP is quite important nowadays, since all (or nearly all) new PC's and some high-end laptops ship with multi-core processors. SMP allows the kernel to take optimal advantage of this architecture.
Since Ralink's drivers don't have SMP support, they will crash a kernel that has SMP enabled.
There are two ways arround this:
1 - Use a SMP-disable kernel (one should be availible in the repo soon)
2- Don't buy a Ralink based card in the first place (remember in the beggining of the HowTo: make sure it works properly before buying it. And don't hesitate to ask at the forums first if you are in doubt!).Update - 27/03/2007:
project (coordinated by "serialmonkey") has made some improvements over the drivers release by Ralink.
However, these drivers (like the ones release by Ralink) do not support SMP enabled kernels.
The team is now also working on the rt2x00 project drivers
which are based on chip specifications from Ralink, but aim to support SMP and follow kernel programming guide-lines, so as to one day be merged into the mainline Linux kernel releases.
If you want to test the rt2x00 drivers, then download the CVS tarball release from this page:http://rt2x00.serialmonkey.com/wiki/index.php?title=Downloads
Or just click on this link to download the tarball directly:http://rt2x00.serialmonkey.com/rt2x00-cvs-daily.tar.gz
Read the "INSTALL" file for details on compiling the right module for your card.
This is still VERY experimental stuff, so I strongly advise you not to use these drivers in an environment where stability is of utmost importance.
If you feel like a challenge and don't mind helping with the bug-squashing, then the rt2x00 release is for you.
You can post any of your debugging info at the serialmonkey forum, under the "rt2x00 BETA testing" section:http://rt2x00.serialmonkey.com/phpBB2/
b ) NdisWrapper stuff:
NdisWrapper is a great tool to have, in case there are no native Linux modules for the chip in your card.
However, since NdisWrapper provides a means for untested and proprietary code to enter the kernel, your kernel gets marked as "tainted", or in other words, untrusworthy. Big deal.....well, maybe it is. Remember all the problems in Windows caused by bad drivers? The last thing you want is having your Linux box crash randomly like Windows.
Also, because NdisWrapper can't do miracles, sometimes it can't provide all the functions the card may have.
c ) Wireless is great, but use it with caution. Make sure to take the necessary measures to protect your data.
Monitor your router logs and use tools like Ethereal and aircrack to audit your network security.
I hope this covers nearly all problems encountered on the forum. Enjoy!