summaryrefslogtreecommitdiffstats
path: root/slackbook/html/network-configuration-wireless.html
blob: fa86dcc26560735e362f5ff1c46c114257d8aa01 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="generator" content="HTML Tidy, see www.w3.org" />
<title>Wireless</title>
<meta name="GENERATOR" content="Modular DocBook HTML Stylesheet Version 1.7" />
<link rel="HOME" title="Slackware Linux Essentials" href="index.html" />
<link rel="UP" title="Network Configuration" href="network-configuration.html" />
<link rel="PREVIOUS" title="PPP" href="network-configuration-ppp.html" />
<link rel="NEXT" title="Network File Systems" href="network-configuration-nfs.html" />
<link rel="STYLESHEET" type="text/css" href="docbook.css" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body class="SECT1" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#840084"
alink="#0000FF">
<div class="NAVHEADER">
<table summary="Header navigation table" width="100%" border="0" cellpadding="0"
cellspacing="0">
<tr>
<th colspan="3" align="center">Slackware Linux Essentials</th>
</tr>

<tr>
<td width="10%" align="left" valign="bottom"><a href="network-configuration-ppp.html"
accesskey="P">Prev</a></td>
<td width="80%" align="center" valign="bottom">Chapter 5 Network Configuration</td>
<td width="10%" align="right" valign="bottom"><a href="network-configuration-nfs.html"
accesskey="N">Next</a></td>
</tr>
</table>

<hr align="LEFT" width="100%" />
</div>

<div class="SECT1">
<h1 class="SECT1"><a id="NETWORK-CONFIGURATION-WIRELESS"
name="NETWORK-CONFIGURATION-WIRELESS">5.5 Wireless</a></h1>

<p>Wireless networking is still a relatively new thing in the world of computers, yet is
quickly catching on as more people begin to purchase laptops and want networking on the
go, without having to fool with some old twisted pair cable. This trend doesn't appear to
be slowing down. Unfortunately, wireless networking isn't yet as strongly supported in
Linux as traditional wired networking.</p>

<p>There are three basic steps to configuring an 802.11 wireless Ethernet card:</p>

<ol type="1">
<li>
<p>Hardware support for the wireless card</p>
</li>

<li>
<p>Configure the card to connect to a wireless access point</p>
</li>

<li>
<p>Configure the network</p>
</li>
</ol>

<div class="SECT2">
<h2 class="SECT2"><a id="AEN2033" name="AEN2033">5.5.1 Hardware Support</a></h2>

<p>Hardware support for a wireless card is provided through the kernel, either with a
module or built in to the kernel. Generally, most newer Ethernet cards are provided
through kernel modules, so you'll want to determine the appropriate kernel module and
load it through <tt class="FILENAME">/etc/rc.d/rc.modules</tt>. <tt
class="COMMAND">netconfig</tt> may not detect your wireless card, so you'll probably need
to determine the card yourself. See <a
href="http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/"
target="_top">http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/</a> for more
information on kernel drivers for various wireless cards.</p>
</div>

<div class="SECT2">
<h2 class="SECT2"><a id="AEN2044" name="AEN2044">5.5.2 Configure the Wireless
Settings</a></h2>

<p>The vast majority of this work is done by <tt class="COMMAND">iwconfig</tt>, so as
always read the man page for <tt class="COMMAND">iwconfig</tt> if you need more
information.</p>

<p>First, you'll want to configure your wireless access point. Wireless access points
vary quite a bit in their terminology, and how to configure them, so you may need to
adjust a bit to accommodate your hardware. In general, you'll need at least the following
information:</p>

<ul>
<li>
<p>The domain ID, or name of the network (called the ESSID by <tt
class="COMMAND">iwconfig</tt>)</p>
</li>

<li>
<p>The channel the WAP uses</p>
</li>

<li>
<p>The encryption settings, including any keys used (preferably in hexadecimal)</p>
</li>
</ul>

<div class="WARNING">
<table class="WARNING" width="100%" border="0">
<tr>
<td width="25" align="CENTER" valign="TOP"><img src="./imagelib/admon/warning.png"
hspace="5" alt="Warning" /></td>
<td align="LEFT" valign="TOP">
<p>A NOTE ABOUT WEP. WEP is quit flawed, but it's much better than nothing. If you wish a
greater degree of security on your wireless network, you should investigate VPNs or
IPSec, both of which are beyond the scope of this document. You might also configure your
WAP not to advertise its domain ID/ ESSID. A thorough discussion of wireless policy is
beyond the scope of this section, but a quick Google search will turn up more than you
ever wanted to know.</p>
</td>
</tr>
</table>
</div>

<p>Once you've gathered the above information, and assuming you've used <tt
class="COMMAND">modprobe</tt> to load the appropriate kernel driver, you can edit <tt
class="FILENAME">rc.wireless.conf</tt> and add your settings. The <tt
class="FILENAME">rc.wireless.conf</tt> file is a bit untidy. The least effort is to
modify the generic section with your ESSID and KEY, and CHANNEL if required by your card.
(Try not setting CHANNEL, and if it works, great; if not, set the CHANNEL as
appropriate.) If you're daring, you can modify the file so that only the necessary
variables are set. The variable names in <tt class="FILENAME">rc.wireless.conf</tt>
correspond to the <tt class="COMMAND">iwconfig</tt> parameters, and are read by <tt
class="FILENAME">rc.wireless</tt> and used in the appropriate <tt
class="COMMAND">iwconfig</tt> commands.</p>

<p>If you have your key in hexadecimal, that's ideal, since you can be fairly confident
that your WAP and <tt class="COMMAND">iwconfig</tt> will agree on the key. If you only
have a string, you can't be sure how your WAP will translate that into a hexadecimal key,
so some guesswork may be needed (or get your WAP's key in hex).</p>

<p>Once you've modified <tt class="FILENAME">rc.wireless.conf</tt>, run <tt
class="FILENAME">rc.wireless</tt> as <tt class="USERNAME">root</tt>, then run <tt
class="FILENAME">rc.inet1</tt>, again as <tt class="USERNAME">root</tt>. You can test
your wireless networking with standard testing tools such as <tt
class="COMMAND">ping</tt>, along with <tt class="COMMAND">iwconfig</tt>. If you have a
wired interface you may wish to use <tt class="COMMAND">ifconfig</tt> to turn those
interfaces off while you test your wireless networking to ensure there's no interference.
You may also want to test your changes through a reboot.</p>

<p>Now that you've seen how to edit <tt class="FILENAME">/etc/rc.d/rc.wireless</tt> for
you default network, let's take a closer look at iwconfig and see how it all works. This
will teach you the quick and dirty way of setting up wifi for those times when you find
yourself at an Internet cafe, coffee shop, or any other wifi hot spot and wish to get
online.</p>

<p>The first step is to tell your wireless NIC what network to join. Make sure you
replace &#8220;<tt class="FILENAME">eth0</tt>&#8221; with whatever network interface your
wireless card uses and change &#8220;<var class="REPLACEABLE">mynetwork</var>&#8221; to
the essid you wish to use. Yes, we know you're smarter than that. Next you'll have to
specify the encryption key (if any) used on your wireless network. Finally specify the
channel to use (if needed).</p>

<table border="0" bgcolor="#E0E0E0" width="100%">
<tr>
<td>
<pre class="SCREEN">
<samp class="PROMPT">#</samp> <kbd class="USERINPUT">iwconfig eth0 essid "<var
class="REPLACEABLE">mynetwork</var>"</kbd>
<samp class="PROMPT">#</samp> <kbd class="USERINPUT">iwconfig eth0 key <var
class="REPLACEABLE">XXXXXXXXXXXXXXXXXXXXXXXXXXX</var></kbd>
<samp class="PROMPT">#</samp> <kbd class="USERINPUT">iwconfig eth0 channel n</kbd>
</pre>
</td>
</tr>
</table>

<p>That should be all on the wireless end of things.</p>
</div>

<div class="SECT2">
<h2 class="SECT2"><a id="AEN2101" name="AEN2101">5.5.3 Configure the Network</a></h2>

<p>This is done in the exact same way as wired networks. Simply refer to earlier sections
of this chapter.</p>
</div>
</div>

<div class="NAVFOOTER">
<hr align="LEFT" width="100%" />
<table summary="Footer navigation table" width="100%" border="0" cellpadding="0"
cellspacing="0">
<tr>
<td width="33%" align="left" valign="top"><a href="network-configuration-ppp.html"
accesskey="P">Prev</a></td>
<td width="34%" align="center" valign="top"><a href="index.html"
accesskey="H">Home</a></td>
<td width="33%" align="right" valign="top"><a href="network-configuration-nfs.html"
accesskey="N">Next</a></td>
</tr>

<tr>
<td width="33%" align="left" valign="top">PPP</td>
<td width="34%" align="center" valign="top"><a href="network-configuration.html"
accesskey="U">Up</a></td>
<td width="33%" align="right" valign="top">Network File Systems</td>
</tr>
</table>
</div>
</body>
</html>