?? network-wireless.html
字號(hào):
<!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 Networking</title><meta name="GENERATOR" content="Modular DocBook HTML Stylesheet Version 1.7" /><link rel="HOME" title="FreeBSD 使用手冊(cè)" href="index.html" /><link rel="UP" title="Advanced Networking" href="advanced-networking.html" /><link rel="PREVIOUS" title="Gateways and Routes" href="network-routing.html" /><link rel="NEXT" title="Bluetooth" href="network-bluetooth.html" /><link rel="STYLESHEET" type="text/css" href="docbook.css" /><meta http-equiv="Content-Type" content="text/html; charset=GB2312" /></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">FreeBSD 使用手冊(cè)</th></tr><tr><td width="10%" align="left" valign="bottom"><a href="network-routing.html"accesskey="P">Prev</a></td><td width="80%" align="center" valign="bottom">Chapter 19. Advanced Networking</td><td width="10%" align="right" valign="bottom"><a href="network-bluetooth.html"accesskey="N">Next</a></td></tr></table><hr align="LEFT" width="100%" /></div><div class="SECT1"><h1 class="SECT1"><a id="NETWORK-WIRELESS" name="NETWORK-WIRELESS">19.3. WirelessNetworking</a></h1><i class="AUTHORGROUP"><span class="CONTRIB">Written by</span> Eric Anderson.</i> <div class="SECT2"><h2 class="SECT2"><a id="AEN25459" name="AEN25459">19.3.1. Introduction</a></h2><p>It can be very useful to be able to use a computer without the annoyance of having anetwork cable attached at all times. FreeBSD can be used as a wireless client, and evenas a wireless ``access point''.</p></div><div class="SECT2"><h2 class="SECT2"><a id="AEN25463" name="AEN25463">19.3.2. Wireless Modes ofOperation</a></h2><p>There are two different ways to configure 802.11 wireless devices: BSS and IBSS.</p><div class="SECT3"><h3 class="SECT3"><a id="AEN25466" name="AEN25466">19.3.2.1. BSS Mode</a></h3><p>BSS mode is the mode that typically is used. BSS mode is also called infrastructuremode. In this mode, a number of wireless access points are connected to a wired network.Each wireless network has its own name. This name is called the SSID of the network.</p><p>Wireless clients connect to these wireless access points. The IEEE 802.11 standarddefines the protocol that wireless networks use to connect. A wireless client can be tiedto a specific network, when a SSID is set. A wireless client can also attach to anynetwork by not explicitly setting a SSID.</p></div><div class="SECT3"><h3 class="SECT3"><a id="AEN25470" name="AEN25470">19.3.2.2. IBSS Mode</a></h3><p>IBSS mode, also called ad-hoc mode, is designed for point to point connections. Thereare actually two types of ad-hoc mode. One is IBSS mode, also called ad-hoc or IEEEad-hoc mode. This mode is defined by the IEEE 802.11 standards. The second is called demoad-hoc mode or Lucent ad-hoc mode (and sometimes, confusingly, ad-hoc mode). This is theold, pre-802.11 ad-hoc mode and should only be used for legacy installations. We will notcover either of the ad-hoc modes further.</p></div></div><div class="SECT2"><h2 class="SECT2"><a id="AEN25473" name="AEN25473">19.3.3. Infrastructure Mode</a></h2><div class="SECT3"><h3 class="SECT3"><a id="AEN25475" name="AEN25475">19.3.3.1. Access Points</a></h3><p>Access points are wireless networking devices that allow one or more wireless clientsto use the device as a central hub. When using an access point, all clients communicatethrough the access point. Multiple access points are often used to cover a complete areasuch as a house, business, or park with a wireless network.</p><p>Access points typically have multiple network connections: the wireless card, and oneor more wired Ethernet adapters for connection to the rest of the network.</p><p>Access points can either be purchased prebuilt, or you can build your own with FreeBSDand a supported wireless card. Several vendors make wireless access points and wirelesscards with various features.</p></div><div class="SECT3"><h3 class="SECT3"><a id="AEN25480" name="AEN25480">19.3.3.2. Building a FreeBSD AccessPoint</a></h3><div class="SECT4"><h4 class="SECT4"><a id="AEN25485" name="AEN25485">19.3.3.2.1. Requirements</a></h4><p>In order to set up a wireless access point with FreeBSD, you need to have a compatiblewireless card. Currently, only cards with the Prism chipset are supported. You will alsoneed a wired network card that is supported by FreeBSD (this should not be difficult tofind, FreeBSD supports a lot of different devices). For this guide, we will assume youwant to <span class="CITEREFENTRY"><span class="REFENTRYTITLE">bridge</span>(4)</span>all traffic between the wireless device and the network attached to the wired networkcard.</p><p>The hostap functionality that FreeBSD uses to implement the access point works bestwith certain versions of firmware. Prism 2 cards should use firmware version 1.3.4 ornewer. Prism 2.5 and Prism 3 cards should use firmware 1.4.9. Older versions of thefirmware way or may not function correctly. At this time, the only way to update cards iswith <span class="TRADEMARK">Windows</span>® firmware update utilities available fromyour card's manufacturer.</p></div><div class="SECT4"><h4 class="SECT4"><a id="AEN25493" name="AEN25493">19.3.3.2.2. Setting It Up</a></h4><p>First, make sure your system can see the wireless card:</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>Do not worry about the details now, just make sure it shows you something to indicateyou have a wireless card installed. If you have trouble seeing the wireless interface,and you are using a PC Card, you may want to check out <span class="CITEREFENTRY"><spanclass="REFENTRYTITLE">pccardc</span>(8)</span> and <span class="CITEREFENTRY"><spanclass="REFENTRYTITLE">pccardd</span>(8)</span> manual pages for more information.</p><p>Next, you will need to load a module in order to get the bridging part of FreeBSDready for the access point. In order to load the <span class="CITEREFENTRY"><spanclass="REFENTRYTITLE">bridge</span>(4)</span> module, simply run the followingcommand:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">kldload bridge</kbd></pre><p>It should not have produced any errors when loading the module. If it did, you mayneed to compile the <span class="CITEREFENTRY"><spanclass="REFENTRYTITLE">bridge</span>(4)</span> code into your kernel. The <ahref="network-bridging.html">Bridging</a> section of the handbook should be able to helpyou accomplish that task.</p><p>Now that you have the bridging stuff done, we need to tell the FreeBSD kernel whichinterfaces to bridge together. We do that by using <span class="CITEREFENTRY"><spanclass="REFENTRYTITLE">sysctl</span>(8)</span>:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">sysctl net.link.ether.bridge=1</kbd><samp class="PROMPT">#</samp> <kbdclass="USERINPUT">sysctl net.link.ether.bridge_cfg="wi0 xl0"</kbd><samp class="PROMPT">#</samp> <kbdclass="USERINPUT">sysctl net.inet.ip.forwarding=1</kbd></pre><p>Now it is time for the wireless card setup.</p><p>The following command will set the card into an access point:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbdclass="USERINPUT">ifconfig wi0 ssid my_net channel 11 media DS/11Mbps mediaopt hostap up stationname "FreeBSD AP"</kbd> </pre><p>The <span class="CITEREFENTRY"><span class="REFENTRYTITLE">ifconfig</span>(8)</span>line brings the <tt class="DEVICENAME">wi0</tt> interface up, sets its SSID to <varclass="LITERAL">my_net</var>, and sets the station name to <var class="LITERAL">FreeBSDAP</var>. The <var class="OPTION">media DS/11Mbps</var> sets the card into 11Mbps modeand is needed for any <var class="OPTION">mediaopt</var> to take effect. The <varclass="OPTION">mediaopt hostap</var> option places the interface into access point mode.The <var class="OPTION">channel 11</var> option sets the 802.11b channel to use. The<span class="CITEREFENTRY"><span class="REFENTRYTITLE">wicontrol</span>(8)</span> manpage has valid channel options for your regulatory domain.</p><p>Now you should have a complete functioning access point up and running. You areencouraged to read <span class="CITEREFENTRY"><spanclass="REFENTRYTITLE">wicontrol</span>(8)</span>, <span class="CITEREFENTRY"><spanclass="REFENTRYTITLE">ifconfig</span>(8)</span>, and <span class="CITEREFENTRY"><spanclass="REFENTRYTITLE">wi</span>(4)</span> for further information.</p><p>It is also suggested that you read the section on encryption that follows.</p></div><div class="SECT4"><h4 class="SECT4"><a id="AEN25559" name="AEN25559">19.3.3.2.3. StatusInformation</a></h4><p>Once the access point is configured and operational, operators will want to see theclients that are associated with the access point. At any time, the operator maytype:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">wicontrol -l</kbd>1 station:00:09:b7:7b:9d:16 asid=04c0, flags=3<ASSOC,AUTH>, caps=1<ESS>, rates=f<1M,2M,5.5M,11M>, sig=38/15</pre><p>This shows that there's one station associated, along with its parameters. The signalindicated should be used as a relative indication of strength only. Its translation todBm or other units varies between different firmware revisions.</p></div></div><div class="SECT3"><h3 class="SECT3"><a id="AEN25566" name="AEN25566">19.3.3.3. Clients</a></h3><p>A wireless client is a system that accesses an access point or another clientdirectly.</p><p>Typically, wireless clients only have one network device, the wireless networking
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -