Penguin
Blame: WirelessSetupNotes
EditPageHistoryDiffInfoLikePages
Annotated edit history of WirelessSetupNotes version 11, including all changes. View license author blame.
Rev Author # Line
4 JohnMcPherson 1 !!! Notes on Setting Up Wireless Networks in Linux
2 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.
3
7 SleepyHead 4 There are several methods you can use to configure a wireless interface in a linux computer, often these are 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.
4 JohnMcPherson 5
6 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!
6 JohnMcPherson 7
11 IanMcDonald 8 There is also useful webpages at:
9 * [HP|http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html] which has quite a lot of links and background information.
10 * http://linuxwireless.org/ which is the new official wiki of wireless drivers for Linux
4 JohnMcPherson 11
12 !! Verify Environment
5 JohnMcPherson 13 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__.
14 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.
6 JohnMcPherson 15
16 Other common names for a wireless interface include "wlan0" or "ath0" (the latter for wireless cards using the Atheron/madwifi driver). If the output of ''iwconfig'' shows something other than 'eth2', make the appropriate substitution in the rest of the following commands.
17
4 JohnMcPherson 18 <verbatim>
19 xenon:~# iwconfig
20 lo no wireless extensions.
21
22 eth0 no wireless extensions.
23
24 eth1 no wireless extensions.
25
26 eth2 IEEE 802.11-DS ESSID:"test" Nickname:"test"
27 Mode:Ad-Hoc Frequency:2.462GHz Cell: 00:02:2D:39:A9:31
28 Bit Rate=11Mb/s Tx-Power=15 dBm Sensitivity:1/0
29 Retry limit:4 RTS thr:off Fragment thr:off
30 Power Management:off
31 Link Quality:36/0 Signal level:-61 dBm Noise level:-97 dBm
32 Rx invalid nwid:0 Rx invalid crypt:3 Rx invalid frag:6514
33 Tx excessive retries:6 Invalid misc:0 Missed beacon:0
34 </verbatim>
35
36 !Troubleshooting
6 JohnMcPherson 37 If ''iwconfig'' does not show any wireless interfaces in your computer you have a problem! Steps to fix it:
4 JohnMcPherson 38 * Check that you do actually have a wireless card installed
39 * Check that you have the appropriate modules (driver) for your card compiled and successfully loaded, see WirelessChipsets for more information on this
40 * Check that [PCMCIA] is correctly configured if you are using a miniPCI card
41 * If still stuck, try google, or try emailing the WlugMailingList.
42 * As with most system settings commands, you must su(1) to the root user for the command to have permissions to query hardware devices.
6 JohnMcPherson 43
44
45
46 !! Check Network Availability
47
48 You can check if your card can see any access points at all by issuing the command __<tt>iwlist eth2 ap</tt>__ (or whatever interface your wireless is on if not 'eth2').
49
50 <verbatim>
51 # iwlist eth2 ap
52 eth2 Peers/Access-Points in range:
53 00:11:2F:61:49:2B : Quality=0/94 Signal level=-95dBm Noise leve=-95dBm
54 </verbatim>
55 This shows the [MAC] address of any remote wireless access points (or peers if in AdHoc mode?).
56
57 Apparently the "__<tt>iwlist ... ap</tt>__" command is obsolete, and the
58 better command is "__<tt>iwlist ''eth2'' scanning</tt>__", which gives its output in the different format.
10 IanMcDonald 59
60 On some network cards you need to issue the above scanning command to get the card to associate. e.g. Current driver for Broadcom 4306
6 JohnMcPherson 61
62 !Troubleshooting
63 If your wireless card can't find anything to connect to, you won't get
64 very far.
65 * Check that you are not too far away from the equipment
66 * Check that there is no interference (running microwave ovens, cordless phones operating on the same frequency, ...)
67
68
69
4 JohnMcPherson 70
71 !! Determine Wireless Settings
6 JohnMcPherson 72 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 pieces of information that you need are ''Channel'', ''ESSID'' and ''Network''.
73
74 ''Channel'' specifices the Physical frequency that your wireless card transmits and receives on. Often the channel will be determined automatically between wireless equipment.
75
76 ''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 --- you can't connect to an AccessPoint unless you are both using the same ESSID!
77
78 ''Network'' is the IP settings that you will use to communicate with the other end of the link.
79
80 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.
4 JohnMcPherson 81
82 !Managed Mode
83 * Mode: Managed
84 * Channel: 6
85 * ESSID: wlug-test
86 * Network: 10.10.10.0/24, this computer will be 10.10.10.1, Access Point will be 10.10.10.128
87
88 !Ad-Hoc Mode
89 * Mode: Ad-Hoc
90 * Channel: 6
91 * ESSID: wlug-test
92 * Network: 10.10.10.0/24, this computer will be 10.10.10.1, Remote Computer will be 10.10.10.254
6 JohnMcPherson 93
94
4 JohnMcPherson 95
96 !! Setup Wireless
97 This step configures the wireless settings shown in the previous section.
98
99 !Managed Mode
100 <verbatim>
101 iwconfig eth2 mode Managed
102 iwconfig eth2 essid "wlug-test"
103 </verbatim>
104 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.
105 <verbatim>
106 xenon:~# iwconfig eth2
107 eth2 IEEE 802.11-DS ESSID:"wlug-test" Nickname:"test"
108 Mode:Managed Frequency:2.437GHz Access Point: 00:02:2D:39:A9:31
109 Bit Rate=11Mb/s Tx-Power=15 dBm Sensitivity:1/0
110 Retry limit:4 RTS thr:off Fragment thr:off
111 Power Management:off
112 Link Quality:36/0 Signal level:-61 dBm Noise level:-97 dBm
113 Rx invalid nwid:0 Rx invalid crypt:3 Rx invalid frag:6514
114 Tx excessive retries:6 Invalid misc:0 Missed beacon:0
115 </verbatim>
116
117 !Ad-Hoc Mode
118 <verbatim>
119 iwconfig eth2 mode Ad-Hoc
120 iwconfig eth2 essid "wlug-test"
121 iwconfig eth2 channel 6
122 </verbatim>
6 JohnMcPherson 123
4 JohnMcPherson 124 If you did everything correctly you should now be able to get output similar to below, the important settings are ESSID, Mode and Frequency.
125 <verbatim>
126 xenon:~# iwconfig eth2
127 eth2 IEEE 802.11-DS ESSID:"wlug-test" Nickname:"test"
128 Mode:Ad-Hoc Frequency:2.437GHz Cell: 00:02:2D:39:A9:31
129 Bit Rate=11Mb/s Tx-Power=15 dBm Sensitivity:1/0
130 Retry limit:4 RTS thr:off Fragment thr:off
131 Power Management:off
132 Link Quality:36/0 Signal level:-61 dBm Noise level:-97 dBm
133 Rx invalid nwid:0 Rx invalid crypt:3 Rx invalid frag:6514
134 Tx excessive retries:6 Invalid misc:0 Missed beacon:0
135 </verbatim>
136
137 ! Verify Configuration
138 If your output matches the examples above for the 3 important parameters then you are ready to move on to the next step.
139
140 ! Troubleshooting
141 If you don't get output similar to above you could try the following
142 * 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
143 * Check dmesg, syslog, etc for any error messages printed
6 JohnMcPherson 144 * Check that the ESSID and/or any security settings match up between the clients and AccessPoint.
145 * If still stuck, google, or try the WlugMailingList.
146
9 IanMcDonald 147 ! Setting the rate
148 Some cards don't automatically set the rate and may set it at a lower rate. You can fix this by typing for example (for an 802.11g card)
149 <verbatim>
150 iwconfig eth2 rate 54M
151 </verbatim>
4 JohnMcPherson 152
153 !! Setup IP
6 JohnMcPherson 154 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! You can either manually assign network settings, or use [DHCP] (if the AccessPoint is also a DHCP server).
155
4 JohnMcPherson 156
157 !Managed Mode, Ad-Hoc Mode
158 <verbatim>
159 ifconfig eth2 10.10.10.1 netmask 255.255.255.0 broadcast 10.10.10.255 up
160 </verbatim>
161
162 !Verify Configuration - Managed Mode
163 <verbatim>
164 xenon:~# ping 10.10.10.128
165 PING 10.10.10.128 (10.10.10.128): 56 data bytes
166 64 bytes from 10.10.10.128: icmp_seq=0 ttl=64 time=3.9 ms
167 64 bytes from 10.10.10.128: icmp_seq=1 ttl=64 time=3.6 ms
168 64 bytes from 10.10.10.128: icmp_seq=2 ttl=64 time=3.6 ms
169
170 --- 10.10.10.128 ping statistics ---
171 3 packets transmitted, 3 packets received, 0% packet loss
172 round-trip min/avg/max = 3.6/3.7/3.9 ms
173 </verbatim>
174
175 !Verify Configuration - Ad-Hoc Mode
176 <verbatim>
177 xenon:~# ping 10.10.10.254
178 PING 10.10.10.254 (10.10.10.254): 56 data bytes
179 64 bytes from 10.10.10.254: icmp_seq=0 ttl=64 time=3.9 ms
180 64 bytes from 10.10.10.254: icmp_seq=1 ttl=64 time=3.6 ms
181 64 bytes from 10.10.10.254: icmp_seq=2 ttl=64 time=3.6 ms
182
183 --- 10.10.10.254 ping statistics ---
184 3 packets transmitted, 3 packets received, 0% packet loss
185 round-trip min/avg/max = 3.6/3.7/3.9 ms
186 </verbatim>
187
188 !Troubleshooting
189 * Check settings at remote end - do they match configured settings here
190 * Check for any error messages in dmesg, syslog, etc
191 * If still stuck, google, or try the wlug mailing list.
192
193 !! Done
6 JohnMcPherson 194 At this point you are done and successfully have a wireless interface up and running in linux!
195
196 Also see WirelessNetworkSecurityNotes for tips on making sure your network
197 is secure from any random person wandering past with a wireless laptop...
198
199
200 !!! Distro-specific Notes
201
202 !! Debian Sarge ( + Ubuntu?)
203 In /etc/network/interfaces, include the following stanzas:
204
205 <verbatim>
206 # for devices managed by hotplug. This assumes you have
207 # NET_AGENT_POLICY=hotplug
208 # in /etc/default/hotplug, which is the default.
209 mapping hotplug
210 script echo
211
212 # replace eth2 with whatever interface your wireless card gets called
213 # and obviously replace 'MY_SSID' appropriately for your wireless network
214 iface eth2 inet dhcp
215 pre-up iwconfig eth2 essid ''MY_SSID''
216 # if you are using WEP and need to specify an appropriate 13 char key,
217 # comment out the above line and uncomment the following line:
218 # pre-up iwconfig eth2 essid ''MY_SSID' key s:abcdefghijklm
219 </verbatim>
220
10 IanMcDonald 221 Any of the commands mentioned in this page can be added to the above file in Debian/Ubuntu with the word up before it to automatically do this after the card is initialised or pre-up if before the card is initialised.
6 JohnMcPherson 222
4 JohnMcPherson 223 ----
224 CategoryWireless, CategoryNotes

PHP Warning

lib/blame.php:177: Warning: Invalid argument supplied for foreach()