Penguin
Note: You are viewing an old revision of this page. View the current version.

Notes on Setting Up Wireless Networks in Linux

This page details how you can setup a wireless connection under linux, and hopefully some tips and tricks that you can use to simplify the task.

There are several methods you can use to configure a wireless interface in a linux computer, often these a distribution specific. This page takes the approach of showing you how to manually setup a link at the command line before delving in to distribution specific details. While this page is written with 802.11b in mind it should be generic enough to help with other wireless technologies such as 802.11g as well.

The structure of this page is a number of steps that should be executed in order, at the end of each step is a Troubleshooting section that should help you to fix any problems that you encountered. Do not proceed to the next step unless you are sure you have completed all the preceding steps correctly!

Verify Environment

First we need to check that there is a wireless card in your computer to. To get a list of all wireless interfaces in the machine use the iwconfig command. In Debian, this command is part of the package called wireless-tools. In the example shown below we can see that this particular computer has a single wireless interface called eth2. The rest of the output provides details of the current configuration of the wireless interface. Ignore that for now, we'll deal with it later - the important thing here is that you have a wireless interface installed and ready to go.

xenon:~# iwconfig
lo        no wireless extensions.

eth0      no wireless extensions.

eth1      no wireless extensions.

eth2      IEEE 802.11-DS  ESSID:"test"  Nickname:"test"
          Mode:Ad-Hoc  Frequency:2.462GHz  Cell: 00:02:2D:39:A9:31
          Bit Rate=11Mb/s   Tx-Power=15 dBm   Sensitivity:1/0
          Retry limit:4   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality:36/0  Signal level:-61 dBm  Noise level:-97 dBm
          Rx invalid nwid:0  Rx invalid crypt:3  Rx invalid frag:6514
          Tx excessive retries:6  Invalid misc:0   Missed beacon:0

Troubleshooting

If iwconfig does not show any wireless interfaces in your computer you have a problem! Steps to fix it

  • Check that you do actually have a wireless card installed
  • Check that you have the appropriate modules (driver) for your card compiled and successfully loaded, see WirelessChipsets for more information on this
  • Check that PCMCIA is correctly configured if you are using a miniPCI card
  • If still stuck, try google, or try emailing the WlugMailingList.
  • As with most system settings commands, you must su(1) to the root user for the command to have permissions to query hardware devices.

Determine Wireless Settings

At this step we need to determine the parameters of our wireless. The biggest question here is the mode of the link. If you are connecting to an Access-Point then you will ned to configure your interface in Managed mode, otherwise for connecting two or more computers directly to each other you will need to use Ad-Hoc mode. The following steps will provide an example of each mode. The other three peices of information that you need are Channel, ESSID and Network. Channel specifices the Physical frequency that your wireless card transmits and receives on. ESSID can be thought of as a Network Name and is used to allow multiple logically seperate wireless networks to operate on the same channel. Network is the IP settings that you will use to communicate with the other end of the link. All four of these parameters (Mode, Channel, ESSID and Network) need to be agreed on between the two ends of the link for it to function correctly. The values that the remainder of this example will use for these parameters are shown below.

Managed Mode

  • Mode: Managed
  • Channel: 6
  • ESSID: wlug-test
  • Network: 10.10.10.0/24, this computer will be 10.10.10.1, Access Point will be 10.10.10.128

Ad-Hoc Mode

  • Mode: Ad-Hoc
  • Channel: 6
  • ESSID: wlug-test
  • Network: 10.10.10.0/24, this computer will be 10.10.10.1, Remote Computer will be 10.10.10.254

Setup Wireless

This step configures the wireless settings shown in the previous section.

Managed Mode

iwconfig eth2 mode Managed
iwconfig eth2 essid "wlug-test"

You'll notice that we didn't set the channel - this is intentional. In Managed mode the channel is automatically set by the access point and should not be specified on the client. If you did everything correctly you should now be able to get output similar to below, the important settings are ESSID, Mode and Frequency.

xenon:~# iwconfig eth2
eth2      IEEE 802.11-DS  ESSID:"wlug-test"  Nickname:"test"
          Mode:Managed  Frequency:2.437GHz  Access Point: 00:02:2D:39:A9:31
          Bit Rate=11Mb/s   Tx-Power=15 dBm   Sensitivity:1/0
          Retry limit:4   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality:36/0  Signal level:-61 dBm  Noise level:-97 dBm
          Rx invalid nwid:0  Rx invalid crypt:3  Rx invalid frag:6514
          Tx excessive retries:6  Invalid misc:0   Missed beacon:0

Ad-Hoc Mode

iwconfig eth2 mode Ad-Hoc
iwconfig eth2 essid "wlug-test"
iwconfig eth2 channel 6

If you did everything correctly you should now be able to get output similar to below, the important settings are ESSID, Mode and Frequency.

xenon:~# iwconfig eth2
eth2      IEEE 802.11-DS  ESSID:"wlug-test"  Nickname:"test"
          Mode:Ad-Hoc  Frequency:2.437GHz  Cell: 00:02:2D:39:A9:31
          Bit Rate=11Mb/s   Tx-Power=15 dBm   Sensitivity:1/0
          Retry limit:4   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality:36/0  Signal level:-61 dBm  Noise level:-97 dBm
          Rx invalid nwid:0  Rx invalid crypt:3  Rx invalid frag:6514
          Tx excessive retries:6  Invalid misc:0   Missed beacon:0

Verify Configuration

If your output matches the examples above for the 3 important parameters then you are ready to move on to the next step.

Troubleshooting

If you don't get output similar to above you could try the following

  • Bring the interface up (some cards don't update their config until the interface is brought up) eg. ifconfig eth2 up, then try iwconfig again
  • Check dmesg, syslog, etc for any error messages printed
  • If still stuck, google, or try the wlug mailing list.

Setup IP

This is a pretty generic step and isn't actually related to Wireless in any way, it's the same as bringing up any interface at all!

Managed Mode, Ad-Hoc Mode

ifconfig eth2 10.10.10.1 netmask 255.255.255.0 broadcast 10.10.10.255 up

Verify Configuration - Managed Mode

xenon:~# ping 10.10.10.128
PING 10.10.10.128 (10.10.10.128): 56 data bytes
64 bytes from 10.10.10.128: icmp_seq=0 ttl=64 time=3.9 ms
64 bytes from 10.10.10.128: icmp_seq=1 ttl=64 time=3.6 ms
64 bytes from 10.10.10.128: icmp_seq=2 ttl=64 time=3.6 ms

--- 10.10.10.128 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 3.6/3.7/3.9 ms

Verify Configuration - Ad-Hoc Mode

xenon:~# ping 10.10.10.254
PING 10.10.10.254 (10.10.10.254): 56 data bytes
64 bytes from 10.10.10.254: icmp_seq=0 ttl=64 time=3.9 ms
64 bytes from 10.10.10.254: icmp_seq=1 ttl=64 time=3.6 ms
64 bytes from 10.10.10.254: icmp_seq=2 ttl=64 time=3.6 ms

--- 10.10.10.254 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 3.6/3.7/3.9 ms

Troubleshooting

  • Check settings at remote end - do they match configured settings here
  • Check for any error messages in dmesg, syslog, etc
  • If still stuck, google, or try the wlug mailing list.

Done

At this point you are done and successfully have a wireless interface up and running in linux! Now on to how to configure it in your distribution....


CategoryWireless, CategoryNotes