📄 network-wireless.html
字号:
card.</p><p>There are a few different ways to configure a wireless client. These are based on thedifferent wireless modes, generally BSS (infrastructure mode, which requires an accesspoint), and IBSS (ad-hoc, or peer-to-peer mode). In our example, we will use the mostpopular of the two, BSS mode, to talk to an access point.</p><div class="SECT4"><h4 class="SECT4"><a id="AEN25571" name="AEN25571">19.3.3.3.1. Requirements</a></h4><p>There is only one real requirement for setting up FreeBSD as a wireless client. Youwill need a wireless card that is supported by FreeBSD.</p></div><div class="SECT4"><h4 class="SECT4"><a id="AEN25574" name="AEN25574">19.3.3.3.2. Setting Up a WirelessFreeBSD Client</a></h4><p>You will need to know a few things about the wireless network you are joining beforeyou start. In this example, we are joining a network that has a name of <varclass="LITERAL">my_net</var>, and encryption turned off.</p><p>Note: In this example, we are not using encryption, which is a dangerous situation. Inthe next section, you will learn how to turn on encryption, and why it is important to doso, and why some encryption technologies still do not completely protect you.</p><p>Make sure your card is recognized by FreeBSD:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">ifconfig -a</kbd>wi0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 inet6 fe80::202:2dff:fe2d:c938%wi0 prefixlen 64 scopeid 0x7 inet 0.0.0.0 netmask 0xff000000 broadcast 255.255.255.255 ether 00:09:2d:2d:c9:50 media: IEEE 802.11 Wireless Ethernet autoselect (DS/2Mbps) status: no carrier ssid "" stationname "FreeBSD Wireless node" channel 10 authmode OPEN powersavemode OFF powersavesleep 100 wepmode OFF weptxkey 1</pre><p>Now, we will set the card to the correct settings for our network:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbdclass="USERINPUT">ifconfig wi0 inet 192.168.0.20 netmask 255.255.255.0 ssid my_net</kbd></pre><p>Replace <tt class="HOSTID">192.168.0.20</tt> and <tt class="HOSTID">255.255.255.0</tt>with a valid IP address and netmask on your wired network. Remember, our access point isbridging the data between the wireless network, and the wired network, so it will appearto the other devices on your network that you are on the wired network just as theyare.</p><p>Once you have done that, you should be able to ping hosts on the wired network just asif you were connected using a standard wired connection.</p><p>If you are experiencing problems with your wireless connection, check to make surethat your are associated (connected) to the access point:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">ifconfig wi0</kbd></pre><p>should return some information, and you should see:</p><pre class="SCREEN">status: associated</pre><p>If it does not show associated, then you may be out of range of the access point, donot have encryption on, or possibly have a configuration problem.</p></div></div><div class="SECT3"><h3 class="SECT3"><a id="AEN25598" name="AEN25598">19.3.3.4. Encryption</a></h3><p>Encryption on a wireless network is important because you no longer have the abilityto keep the network contained in a well protected area. Your wireless data will bebroadcast across your entire neighborhood, so anyone who cares to read it can. This iswhere encryption comes in. By encrypting the data that is sent over the airwaves, youmake it much more difficult for any interested party to grab your data right out of theair.</p><p>The two most common ways to encrypt the data between your client and the access point,are WEP, and <span class="CITEREFENTRY"><spanclass="REFENTRYTITLE">ipsec</span>(4)</span>.</p><div class="SECT4"><h4 class="SECT4"><a id="AEN25608" name="AEN25608">19.3.3.4.1. WEP</a></h4><p>WEP is an abbreviation for Wired Equivalency Protocol. WEP is an attempt to makewireless networks as safe and secure as a wired network. Unfortunately, it has beencracked, and is fairly trivial to break. This also means it is not something to rely onwhen it comes to encrypting sensitive data.</p><p>It is better than nothing, so use the following to turn on WEP on your new FreeBSDaccess point:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbdclass="USERINPUT">ifconfig wi0 inet up ssid my_net wepmode on wepkey 0x1234567890 media DS/11Mbps mediaopt hostap</kbd></pre><p>And you can turn on WEP on a client with this command:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbdclass="USERINPUT">ifconfig wi0 inet 192.168.0.20 netmask 255.255.255.0 ssid my_net wepmode on wepkey 0x1234567890</kbd></pre><p>Note that you should replace the <var class="LITERAL">0x1234567890</var> with a moreunique key.</p></div><div class="SECT4"><h4 class="SECT4"><a id="AEN25623" name="AEN25623">19.3.3.4.2. IPsec</a></h4><p><span class="CITEREFENTRY"><span class="REFENTRYTITLE">ipsec</span>(4)</span> is amuch more robust and powerful tool for encrypting data across a network. This isdefinitely the preferred way to encrypt wireless data over a network. You can read moreabout <span class="CITEREFENTRY"><span class="REFENTRYTITLE">ipsec</span>(4)</span>security and how to implement it in the <a href="ipsec.html">IPsec</a> section of thehandbook.</p></div></div><div class="SECT3"><h3 class="SECT3"><a id="AEN25633" name="AEN25633">19.3.3.5. Tools</a></h3><p>There are a small number of tools available for use in debugging and setting up yourwireless network, and here we will attempt to describe some of them and what they do.</p><div class="SECT4"><h4 class="SECT4"><a id="AEN25636" name="AEN25636">19.3.3.5.1. The <bclass="APPLICATION">bsd-airtools</b> Package</a></h4><p>The <b class="APPLICATION">bsd-airtools</b> package is a complete toolset thatincludes wireless auditing tools for WEP key cracking, access point detection, etc.</p><p>The <b class="APPLICATION">bsd-airtools</b> utilities can be installed from the <ahref="http://www.FreeBSD.org/cgi/url.cgi?ports/net/bsd-airtools/pkg-descr"><ttclass="FILENAME">net/bsd-airtools</tt></a> port. Information on installing ports can befound in <a href="ports.html">Chapter 4</a> of the handbook.</p><p>The program <tt class="COMMAND">dstumbler</tt> is the packaged tool that allows foraccess point discovery and signal to noise ratio graphing. If you are having a hard timegetting your access point up and running, <tt class="COMMAND">dstumbler</tt> may help youget started.</p><p>To test your wireless network security, you may choose to use ``dweputils'' (<ttclass="COMMAND">dwepcrack</tt>, <tt class="COMMAND">dwepdump</tt> and <ttclass="COMMAND">dwepkeygen</tt>) to help you determine if WEP is the right solution toyour wireless security needs.</p></div><div class="SECT4"><h4 class="SECT4"><a id="AEN25653" name="AEN25653">19.3.3.5.2. The <bclass="APPLICATION">wicontrol</b>, <b class="APPLICATION">ancontrol</b> and <bclass="APPLICATION">raycontrol</b> Utilities</a></h4><p>These are the tools you use to control how your wireless card behaves on the wirelessnetwork. In the examples above, we have chosen to use <span class="CITEREFENTRY"><spanclass="REFENTRYTITLE">wicontrol</span>(8)</span>, since our wireless card is a <ttclass="DEVICENAME">wi0</tt> interface. If you had a Cisco wireless device, it would comeup as <tt class="DEVICENAME">an0</tt>, and therefore you would use <spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">ancontrol</span>(8)</span>.</p></div><div class="SECT4"><h4 class="SECT4"><a id="AEN25667" name="AEN25667">19.3.3.5.3. The <bclass="APPLICATION">ifconfig</b> Command</a></h4><p><span class="CITEREFENTRY"><span class="REFENTRYTITLE">ifconfig</span>(8)</span> canbe used to do many of the same options as <span class="CITEREFENTRY"><spanclass="REFENTRYTITLE">wicontrol</span>(8)</span>, however it does lack a few options.Check <span class="CITEREFENTRY"><span class="REFENTRYTITLE">ifconfig</span>(8)</span>for command line parameters and options.</p></div></div><div class="SECT3"><h3 class="SECT3"><a id="AEN25682" name="AEN25682">19.3.3.6. Supported Cards</a></h3><div class="SECT4"><h4 class="SECT4"><a id="AEN25684" name="AEN25684">19.3.3.6.1. Access Points</a></h4><p>The only cards that are currently supported for BSS (as an access point) mode aredevices based on the Prism 2, 2.5, or 3 chipsets. For a complete list, look at <spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">wi</span>(4)</span>.</p></div><div class="SECT4"><h4 class="SECT4"><a id="AEN25690" name="AEN25690">19.3.3.6.2. Clients</a></h4><p>Almost all 802.11b wireless cards are currently supported under FreeBSD. Most cardsbased on Prism, Spectrum24, Hermes, Aironet, and Raylink will work as a wireless networkcard in IBSS (ad-hoc, peer-to-peer, and BSS) mode.</p></div></div></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-routing.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-bluetooth.html"accesskey="N">Next</a></td></tr><tr><td width="33%" align="left" valign="top">Gateways and Routes</td><td width="34%" align="center" valign="top"><a href="advanced-networking.html"accesskey="U">Up</a></td><td width="33%" align="right" valign="top">Bluetooth</td></tr></table></div></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -