WirelessLinuxHowTo
[HomePage.html home]
WirelessLinuxHowTo
Table of contents
- [#Overview Overview]
- [#Hardware_support Hardware support]
- [#Chipsets_supported_by_Linux Chipsets supported by Linux]
- [#Wireless_Configuration_Tools Wireless Configuration Tools]
- [#Installation_of_wireless_tools Installation of wireless-tools]
- [#Module_Installation Module Installation]
- [#Applying_wifi_settings Applying wifi settings]
- [#Applying_network_settings Applying network settings]
- [#Testing Testing]
- [#Connecting_to_an_OLSR_Mesh_network Connecting to an OLSR Mesh network]
- [#Security Security]
- [#Encrypted_networks Encrypted networks]
- [#Finalising_settings Finalising settings]
- [#Ubuntu_Debian Ubuntu/Debian]
- [#Loading_modules Loading modules]
- [#Saving_wireless_config Saving wireless config]
- [#Saving_network_config Saving network config]
- [#Ubuntu_Debian Ubuntu/Debian]
- [#Troubleshooting Troubleshooting]
- [#My_ACX111_based_card_is_not_working_ My ACX111 based card is not working!]
- [#Further_help Further help]
Overview
This document is written to provide some guidance in the setup of a Wireless network card in Linux.
Hardware support
As is the usual case when it comes to Linux, some hardware is supported via [OpenSource.html OpenSource] drivers, some by vendor supplied drivers, and others are not supported at all.
As Linux drivers work off chipsets, rather than the brand of the card (quite often the same chipset it used by several different companies), you need to find out what chipset your card is using.
In general, to find your card's chipset, you can type in the following command:
This should give you a list of all of the devices on the PCI bus - including your wireless card.
You can also run a Google search for your card to see if someone else has documented which chipset is used.
Chipsets supported by Linux
Here is a list of places documenting Linux support of different Wireless chipsets:
- Linux Wireless LAN card list
- Cards that work with NDISWrapper
- Madwifi documenting the Atheros chipset
- Prism54G documenting the PRISM chipset.
The following chipsets have been tested by members of The-Mesh:
- Texas Instruments ACX100/ACX111
- Atheros
- Prism Based chipsets
Wireless Configuration Tools
Most distributions of Linux ship with a set of Wireless Configuration tools called... wireless-tools. These tools are used to manipulate the "Wireless Extensions" of your system - in other words, your wireless card settings.
There are three main tools that you will use to configure your card:
- iwconfig - Configure the Wireless Interface
- iwlist - Scan for available networks
- ifconfig - Configure the Network settings such as IP address and subnet.
Installation of wireless-tools
In Ubuntu and Debian:
In SuSe:
More info...
Module Installation
Well, I am sure most of us are familar with having to load drivers to get your hardware to talk to your Operating system? Well, Linux is no different, except it refers to drivers as modules. Basically, these modules are inserted into the running Kernel and with any luck will provide an interface from the software side to the hardware side of things (the card itself). If you're lucky enough, your wireless card driver/module will already be available in your current Linux install.
All wireless kernel modules that are currently installed on your system are located under the following directory:
Note: Atheros modules seem to be installed into /lib/modules/$(uname -r)/kernel/madwifi... just to make things more confusing.
The first thing to do is the make sure Linux has not already loaded a module for your wireless card. Modern Linux distributions are coming out with more and more hardware support, so you make be in luck:
This command should return a list of cards installed. If it looks something like the example below, then it is more than likely there is no driver/module loaded for your card:
lo no wireless extensions.
eth0 no wireless extensions.
eth1 no wireless extensions.
sit0 no wireless extensions.
So, we have established what chipset we have, so we now know what driver to load (if not, try a Google search, you can usually find out pretty quickly what module to load). Lets say we have an atheros based chipset. We would load the module like this:
Now, if it was successful, you should be able to run the iwconfig command again and see a result such as the following:
root@localhost:~# iwconfig wlan0 wlan0 IEEE 802.11b+ ESSID:"darwin_mesh" Nickname:"acx v0.3.21" Mode:Ad-Hoc Frequency:2.412 GHz Cell: 52:48:48:0A:82:A4 Bit Rate:11 Mb/s Tx-Power=18 dBm Sensitivity=187/255 Retry min limit:7 RTS thr:off Encryption key:off Power Management:off Link Quality=80/100 Signal level=76/100 Noise level=1/100 Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0 Tx excessive retries:9 Invalid misc:0 Missed beacon:0
Applying wifi settings
So, by now you should have a wireless card installed and the modules loaded for it. We will now use the iwconfig command to configure the wireless settings on the card. The following is a list of basic settings you will need to apply to get your card working:
- ESSID - What wireless network do you want to join?
- Channel - What channel (frequency) is your wireless network on?
- Mode - Are you configuring your access point for Ad-Hoc?, Managed (node client), Master (Access point), Secondary (backup Access point) or Monitor (for passive monitoring).
- txpwr - How much power do you want to output? Noting that the higher your power output, generally the more noisy your signal, resulting in a poor SNR. See [WirelessDefinitions.html WirelessDefinitions] for more details.
Descriptions for the above settings are available in the iwconfig manpage:
We also need to establish which interface our wireless card is. Usually it is wlan0, though on the Atheros cards it comes up as ath0.
Here is an example command to configure a wireless card in Ad-Hoc? mode:
We then check that these settings have been applied:
Applying network settings
Now that we have configured our wireless settings, we can now apply our network settings using ifconfig. The following is an example:
We can also add our default gateway (such as our Internet router) in here if we want:
Of course, you will probably want to change the IP address settings to suit the network you are connecting to. Keep in mind that the device(s) on the other end of the wireless link need to be in the same IP range. In this case it is 192.168.0.0/255.255.255.0.
Testing
Ok, so we have added our module, configured our card and given it an IP address. Now, let see if we can actually use it:
PING 192.168.0.254 (192.168.0.121) 56(84) bytes of data.
64 bytes from 192.168.0.254: icmp_seq=1 ttl=64 time=0.031 ms
64 bytes from 192.168.0.254: icmp_seq=2 ttl=64 time=0.029 ms
64 bytes from 192.168.0.254: icmp_seq=3 ttl=64 time=0.029 ms
64 bytes from 192.168.0.254: icmp_seq=4 ttl=64 time=0.029 ms
4 packets transmitted, 4 received, 0% packet loss, time 2999ms
rtt min/avg/max/mdev = 0.029/0.029/0.031/0.005 ms
With any luck you will get a result simular to the above. If this is the case, then congratulations... you have wireless connectivity.
If you find that you can't talk to anything from your wireless card, you may want to check the following:
- Are you sure the address you are trying to ping is available by wireless?
- Are you sure there is no firewall active on your host or the host you are trying to ping? It may be preventing ping responses.
- Does the network you're trying to connect to use encryption such as WPA or WEP?
You may want to try the iwlist command to see if you can actually see any other wireless networks:
Check the make sure your wireless settings match the settings of the network you're trying to connect to.
Check out the Troubleshooting section for more details on getting thing to work.
Connecting to an OLSR Mesh network
If you're wanting to join an OLSR Mesh network such as [NtFreeNet.html NtFreeNet], please refer to the [OLSR+in+Linux.html OLSR in Linux] HowTo?.
Security
If you're not familiar with the security implications of using Wireless networks, please read our page on [WirelessSecurity.html WirelessSecurity].
Encrypted networks
Most private wireless networks run some form of encryption. Usually it's a WEP or WPA based encryption that you need to know the key to. This section explains how to add encryption settings into your wireless setting to join a private wireless network.
Finalising settings
Hopefully by now you have a functional configuration that is allowing you to connect to your wireless network. If you don't then please refer to the Troubleshooting section. Lets finalise these settings so they come backup on a reboot.
Ubuntu/Debian
Applying the following settings to your Ubuntu or Debian install should allow your wireless configurations to survive reboot.
Loading modules
In order to load modules at start up, you place the module name in your /etc/modules file. This file is read by the startup scripts and loads before you wireless card is brought up by the network scripts.
Saving wireless config
Debian and Ubuntu use /etc/network/interfaces to control the settings for each interfaces. The wireless-tools package that comes with Debian and Ubuntu accepts values from /etc/network/interfaces. Below is an example:
auto lo iface lo inet loopback auto wlan0 iface wlan0 inet static address 192.168.0.128 netmask 255.255.255.0 gateway 192.168.0.254 # Wireless settings wireless-essid darwin_mesh wireless-mode ad-hoc wireless-channel 1 wireless-txpower 84mw
More details on this configuration can be found in /usr/share/doc/wireless-tools/README.Debian.
Saving network config
As mentioned above, network configurations in Debian and Ubuntu are stored in /etc/network/interfaces. In order to add your wireless network card to the list of interfaces to bring up at boot, you need to make sure you declare the autocommand and enter in the network settings you want for your card. Below is an example:
auto lo iface lo inet loopback auto eth0 iface eth0 inet dhcp auto wlan0 iface wlan0 inet static address 192.168.0.128 netmask 255.255.255.0 gateway 192.168.0.254
More information on the interfaces settings can be found in the manpage for interfaces:
Need to add in settings for following distros:
- SuSe/Fedora/Redhat
- Loading modules
- Saving wireless config
- Saving network config
Troubleshooting
My ACX111 based card is not working!
We have found issues with Ubuntu Dapper using cards based off the Texas Intruments ACX111 chipset.
The following information was found on the Ubuntu Wiki:
sudo gedit /etc/modprobe.d/options
Once the file is opened, add these two lines to the file and save:
- Ensure a working version of the acx111 firmware is used.
and it worked. All the other steps appear to be unnecessary, and they are quite difficult to achieve with a fresh install of dapper, since Internet access is likely not available due to this very problem, and a lot of stuff needs to be downloaded, and packages fetched. Not a task for a newbie.
Further help
If you're still having problems, just into IRC (details on [The-Mesh.html The-Mesh] mainpage) or throw a post up in the forums.
Links:
No comments:
Post a Comment