Update of the Wireless part to match 8.X. This is a work in progress,

the "FreeBSD Host Access Points" section will be updated soon.

Requested by:	many
This commit is contained in:
Marc Fonvieille 2010-03-27 20:25:00 +00:00
parent 0bd1cd2a3a
commit da25ebf7ec
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=35578

View file

@ -821,8 +821,13 @@ route_net2="-net 192.168.1.0/24 192.168.1.1"</programlisting>
<para>In the rest of this document, we will use an <para>In the rest of this document, we will use an
&man.ath.4; device, the device name in the examples must &man.ath.4; device, the device name in the examples must
be changed according to your configuration. A list of be changed according to your configuration. A list of
available wireless drivers can be found at the beginning available wireless drivers and supported adapters can be
of the &man.wlan.4; manual page. If a native &os; driver found in the &os; Hardware Notes. Copies of these notes
for various releases and architectures are available on
the <ulink
url="http://www.FreeBSD.org/releases/index.html">Release
Information</ulink> page of the &os; Web site.
If a native &os; driver
for your wireless device does not exist, it may be for your wireless device does not exist, it may be
possible to directly use the &windows; driver with the possible to directly use the &windows; driver with the
help of the <link help of the <link
@ -830,7 +835,7 @@ route_net2="-net 192.168.1.0/24 192.168.1.1"</programlisting>
wrapper.</para> wrapper.</para>
</note> </note>
<para>With a device driver configured you need to also bring <para>Under &os;&nbsp;7.X, with a device driver you need to also bring
in the 802.11 networking support required by the driver. in the 802.11 networking support required by the driver.
For the &man.ath.4; driver these are at least the &man.wlan.4;, For the &man.ath.4; driver these are at least the &man.wlan.4;,
<literal>wlan_scan_ap</literal> and <literal>wlan_scan_ap</literal> and
@ -843,12 +848,9 @@ route_net2="-net 192.168.1.0/24 192.168.1.1"</programlisting>
<programlisting>wlan_scan_ap_load="YES" <programlisting>wlan_scan_ap_load="YES"
wlan_scan_sta_load="YES"</programlisting> wlan_scan_sta_load="YES"</programlisting>
<note> <para>Since &os;&nbsp;8.0, these modules are part of the
<para>Both <literal>wlan_scan_ap</literal> and base &man.wlan.4; driver which is dynamically loaded with
<literal>wlan_scan_sta</literal> modules are required by the adapter driver.</para>
&os;&nbsp;7.X, other &os; versions do not need
them.</para>
</note>
<para>With that you will need the modules <para>With that you will need the modules
that implement cryptographic support for the security that implement cryptographic support for the security
@ -880,21 +882,22 @@ wlan_tkip_load="YES"</programlisting>
compile these drivers into the kernel by adding the compile these drivers into the kernel by adding the
following lines to your kernel configuration file:</para> following lines to your kernel configuration file:</para>
<programlisting>device ath # Atheros IEEE 802.11 wireless network driver <programlisting>device wlan # 802.11 support
device ath_hal # Atheros Hardware Access Layer
options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors
device ath_rate_sample # SampleRate tx rate control for ath
device wlan # 802.11 support
device wlan_scan_ap # 802.11 AP mode scanning
device wlan_scan_sta # 802.11 STA mode scanning
device wlan_wep # 802.11 WEP support device wlan_wep # 802.11 WEP support
device wlan_ccmp # 802.11 CCMP support device wlan_ccmp # 802.11 CCMP support
device wlan_tkip # 802.11 TKIP support</programlisting> device wlan_tkip # 802.11 TKIP support
device wlan_amrr # AMRR transmit rate control algorithm
device ath # Atheros pci/cardbus NIC's
device ath_hal # pci/cardbus chip support
options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors
device ath_rate_sample # SampleRate tx rate control for ath</programlisting>
<para>Both <literal>wlan_scan_ap</literal> and <para>Both following lines are also required by
<literal>wlan_scan_sta</literal> lines are required by
&os;&nbsp;7.X, other &os; versions do not need &os;&nbsp;7.X, other &os; versions do not need
them.</para> them:</para>
<programlisting>device wlan_scan_ap # 802.11 AP mode scanning
device wlan_scan_sta # 802.11 STA mode scanning</programlisting>
<para>With this information in the kernel configuration <para>With this information in the kernel configuration
file, recompile the kernel and reboot your &os; file, recompile the kernel and reboot your &os;
@ -934,10 +937,11 @@ ath0: mac 7.9 phy 4.5 radio 5.6</screen>
probes for available access points. Only the super-user probes for available access points. Only the super-user
can initiate such a scan:</para> can initiate such a scan:</para>
<screen>&prompt.root; <userinput>ifconfig <replaceable>ath0</replaceable> up scan</userinput> <screen>&prompt.root; <userinput>ifconfig <replaceable>wlan0</replaceable> create wlandev <replaceable>ath0</replaceable></userinput>
&prompt.root; <userinput>ifconfig <replaceable>wlan0</replaceable> up scan</userinput>
SSID BSSID CHAN RATE S:N INT CAPS SSID BSSID CHAN RATE S:N INT CAPS
dlinkap 00:13:46:49:41:76 6 54M 29:3 100 EPS WPA WME dlinkap 00:13:46:49:41:76 11 54M -90:96 100 EPS WPA WME
freebsdap 00:11:95:c3:0d:ac 1 54M 22:1 100 EPS WPA</screen> freebsdap 00:11:95:c3:0d:ac 1 54M -83:96 100 EPS WPA</screen>
<note> <note>
<para>You must mark the interface <option>up</option> <para>You must mark the interface <option>up</option>
@ -945,6 +949,21 @@ freebsdap 00:11:95:c3:0d:ac 1 54M 22:1 100 EPS WPA</screen>
require you to mark the interface up again.</para> require you to mark the interface up again.</para>
</note> </note>
<note>
<para>Under &os;&nbsp;7.X, the adapter device, for example
<devicename><replaceable>ath0</replaceable></devicename>,
is used directly instead of the
<devicename>wlan<replaceable>0</replaceable></devicename>
device. This requires you to replace the both previous
lines with:</para>
<screen>&prompt.root; <userinput>ifconfig <replaceable>ath0</replaceable> up scan</userinput></screen>
<para>In the rest of this document, the &os;&nbsp;7.X user
will have to change the command and configuration lines
according to that scheme.</para>
</note>
<para>The output of a scan request lists each BSS/IBSS <para>The output of a scan request lists each BSS/IBSS
network found. Beside the name of the network, network found. Beside the name of the network,
<literal>SSID</literal>, we find the <literal>SSID</literal>, we find the
@ -1013,7 +1032,7 @@ freebsdap 00:11:95:c3:0d:ac 1 54M 22:1 100 EPS WPA</screen>
<para>One can also display the current list of known <para>One can also display the current list of known
networks with:</para> networks with:</para>
<screen>&prompt.root; <userinput>ifconfig <replaceable>ath0</replaceable> list scan</userinput></screen> <screen>&prompt.root; <userinput>ifconfig <replaceable>wlan0</replaceable> list scan</userinput></screen>
<para>This information may be updated automatically by the <para>This information may be updated automatically by the
adapter or manually with a <option>scan</option> request. adapter or manually with a <option>scan</option> request.
@ -1046,13 +1065,22 @@ freebsdap 00:11:95:c3:0d:ac 1 54M 22:1 100 EPS WPA</screen>
up or otherwise configure an interface by listing it in up or otherwise configure an interface by listing it in
<filename>/etc/rc.conf</filename>, e.g.:</para> <filename>/etc/rc.conf</filename>, e.g.:</para>
<programlisting>ifconfig_ath0="DHCP"</programlisting> <programlisting>wlans_ath0="wlan0"
ifconfig_wlan0="DHCP"</programlisting>
<note>
<para>As previously mentioned, &os;&nbsp;7.X will only
require a line related to the adapter device:</para>
<programlisting>ifconfig_ath0="DHCP"</programlisting>
</note>
<para>If there are multiple access points and you want to <para>If there are multiple access points and you want to
select a specific one, you can select it by its select a specific one, you can select it by its
SSID:</para> SSID:</para>
<programlisting>ifconfig_ath0="ssid <replaceable>your_ssid_here</replaceable> DHCP"</programlisting> <programlisting>wlans_ath0="wlan0"
ifconfig_wlan0="ssid <replaceable>your_ssid_here</replaceable> DHCP"</programlisting>
<para>In an environment where there are multiple access <para>In an environment where there are multiple access
points with the same SSID (often done to simplify points with the same SSID (often done to simplify
@ -1061,7 +1089,8 @@ freebsdap 00:11:95:c3:0d:ac 1 54M 22:1 100 EPS WPA</screen>
BSSID of the access point (you can also leave off the BSSID of the access point (you can also leave off the
SSID):</para> SSID):</para>
<programlisting>ifconfig_ath0="ssid <replaceable>your_ssid_here</replaceable> bssid <replaceable>xx:xx:xx:xx:xx:xx</replaceable> DHCP"</programlisting> <programlisting>wlans_ath0="wlan0"
ifconfig_wlan0="ssid <replaceable>your_ssid_here</replaceable> bssid <replaceable>xx:xx:xx:xx:xx:xx</replaceable> DHCP"</programlisting>
<para>There are other ways to constrain the choice of an <para>There are other ways to constrain the choice of an
access point such as limiting the set of frequencies the access point such as limiting the set of frequencies the
@ -1071,7 +1100,8 @@ freebsdap 00:11:95:c3:0d:ac 1 54M 22:1 100 EPS WPA</screen>
specific band you can use the <option>mode</option> specific band you can use the <option>mode</option>
parameter; e.g.:</para> parameter; e.g.:</para>
<programlisting>ifconfig_ath0="mode <replaceable>11g</replaceable> ssid <replaceable>your_ssid_here</replaceable> DHCP"</programlisting> <programlisting>wlans_ath0="wlan0"
ifconfig_wlan0="mode <replaceable>11g</replaceable> ssid <replaceable>your_ssid_here</replaceable> DHCP"</programlisting>
<para>will force the card to operate in 802.11g which is <para>will force the card to operate in 802.11g which is
defined only for 2.4GHz frequencies so any 5GHz channels defined only for 2.4GHz frequencies so any 5GHz channels
@ -1113,7 +1143,8 @@ freebsdap 00:11:95:c3:0d:ac 1 54M 22:1 100 EPS WPA</screen>
&airport; base station you can setup access with &airport; base station you can setup access with
something like:</para> something like:</para>
<programlisting>ifconfig_ath0="authmode shared wepmode on weptxkey <replaceable>1</replaceable> wepkey <replaceable>01234567</replaceable> DHCP"</programlisting> <programlisting>wlans_ath0="wlan0"
ifconfig_wlan0="authmode shared wepmode on weptxkey <replaceable>1</replaceable> wepkey <replaceable>01234567</replaceable> DHCP"</programlisting>
<para>In general shared key authentication is to be <para>In general shared key authentication is to be
avoided because it uses the WEP key material in a avoided because it uses the WEP key material in a
@ -1137,7 +1168,8 @@ freebsdap 00:11:95:c3:0d:ac 1 54M 22:1 100 EPS WPA</screen>
<literal>DHCP</literal> to the configuration for your <literal>DHCP</literal> to the configuration for your
device as shown in various examples above:</para> device as shown in various examples above:</para>
<programlisting>ifconfig_ath0="DHCP"</programlisting> <programlisting>wlans_ath0="wlan0"
ifconfig_wlan0="DHCP"</programlisting>
<para>At this point, you are ready to bring up the <para>At this point, you are ready to bring up the
wireless interface:</para> wireless interface:</para>
@ -1148,24 +1180,24 @@ freebsdap 00:11:95:c3:0d:ac 1 54M 22:1 100 EPS WPA</screen>
<command>ifconfig</command> to see the status of the <command>ifconfig</command> to see the status of the
interface <devicename>ath0</devicename>:</para> interface <devicename>ath0</devicename>:</para>
<screen>&prompt.root; <userinput>ifconfig <replaceable>ath0</replaceable></userinput> <screen>&prompt.root; <userinput>ifconfig <replaceable>wlan0</replaceable></userinput>
ath0: flags=8843&lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&gt; mtu 1500 wlan0: flags=8843&lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&gt; mtu 1500
inet6 fe80::211:95ff:fed5:4362%ath0 prefixlen 64 scopeid 0x1
inet 192.168.1.100 netmask 0xffffff00 broadcast 192.168.1.255
ether 00:11:95:d5:43:62 ether 00:11:95:d5:43:62
media: IEEE 802.11 Wireless Ethernet autoselect (OFDM/54Mbps) inet 192.168.1.100 netmask 0xffffff00 broadcast 192.168.1.255
media: IEEE 802.11 Wireless Ethernet OFDM/54Mbps mode 11g
status: associated status: associated
ssid dlinkap channel 6 bssid 00:13:46:49:41:76 ssid dlinkap channel 11 (2462 Mhz 11g) bssid 00:13:46:49:41:76
authmode OPEN privacy OFF txpowmax 36 protmode CTS bintval 100</screen> country US ecm authmode OPEN privacy OFF txpower 21.5 bmiss 7
scanvalid 60 bgscan bgscanintvl 300 bgscanidle 250 roam:rssi 7
roam:rate 5 protmode CTS wme burst</screen>
<para>The <literal>status: associated</literal> means you <para>The <literal>status: associated</literal> means you
are connected to the wireless network (to the are connected to the wireless network (to the
<literal>dlinkap</literal> network in our case). The <literal>dlinkap</literal> network in our case). The
<literal>bssid 00:13:46:49:41:76</literal> part is the <literal>bssid 00:13:46:49:41:76</literal> part is the
MAC address of your access point; the MAC address of your access point; the
<literal>authmode</literal> line informs you that the <literal>authmode OPEN</literal> part informs you that the
communication is not encrypted communication is not encrypted.</para>
(<literal>OPEN</literal>).</para>
</sect5> </sect5>
<sect5> <sect5>
@ -1178,7 +1210,8 @@ ath0: flags=8843&lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&gt; mtu 1500
parameters you have set up for selecting an access parameters you have set up for selecting an access
point:</para> point:</para>
<programlisting>ifconfig_ath0="ssid <replaceable>your_ssid_here</replaceable> inet <replaceable>192.168.1.100</replaceable> netmask <replaceable>255.255.255.0</replaceable>"</programlisting> <programlisting>wlans_ath0="wlan0"
ifconfig_wlan0="ssid <replaceable>your_ssid_here</replaceable> inet <replaceable>192.168.1.100</replaceable> netmask <replaceable>255.255.255.0</replaceable>"</programlisting>
</sect5> </sect5>
</sect4> </sect4>
@ -1253,7 +1286,8 @@ ath0: flags=8843&lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&gt; mtu 1500
done with WPA and the IP address will be obtained with done with WPA and the IP address will be obtained with
DHCP:</para> DHCP:</para>
<programlisting>ifconfig_ath0="WPA DHCP"</programlisting> <programlisting>wlans_ath0="wlan0"
ifconfig_wlan0="WPA DHCP"</programlisting>
<para>Then, we can bring up the interface:</para> <para>Then, we can bring up the interface:</para>
@ -1262,51 +1296,54 @@ Starting wpa_supplicant.
DHCPDISCOVER on ath0 to 255.255.255.255 port 67 interval 5 DHCPDISCOVER on ath0 to 255.255.255.255 port 67 interval 5
DHCPDISCOVER on ath0 to 255.255.255.255 port 67 interval 6 DHCPDISCOVER on ath0 to 255.255.255.255 port 67 interval 6
DHCPOFFER from 192.168.0.1 DHCPOFFER from 192.168.0.1
DHCPREQUEST on ath0 to 255.255.255.255 port 67 DHCPREQUEST on wlan0 to 255.255.255.255 port 67
DHCPACK from 192.168.0.1 DHCPACK from 192.168.0.1
bound to 192.168.0.254 -- renewal in 300 seconds. bound to 192.168.0.254 -- renewal in 300 seconds.
ath0: flags=8843&lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&gt; mtu 1500 wlan0: flags=8843&lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&gt; mtu 1500
inet6 fe80::211:95ff:fed5:4362%ath0 prefixlen 64 scopeid 0x1
inet 192.168.0.254 netmask 0xffffff00 broadcast 192.168.0.255
ether 00:11:95:d5:43:62 ether 00:11:95:d5:43:62
media: IEEE 802.11 Wireless Ethernet autoselect (OFDM/36Mbps) inet 192.168.0.254 netmask 0xffffff00 broadcast 192.168.0.255
media: IEEE 802.11 Wireless Ethernet OFDM/36Mbps mode 11g
status: associated status: associated
ssid freebsdap channel 1 bssid 00:11:95:c3:0d:ac ssid freebsdap channel 1 (2412 MHz 11g) bssid 00:11:95:c3:0d:ac
authmode WPA privacy ON deftxkey UNDEF TKIP 2:128-bit txpowmax 36 country US ecm authmode WPA2/802.11i privacy ON deftxkey UNDEF
protmode CTS roaming MANUAL bintval 100</screen> AES-CCM 3:128-bit txpower 21.5 bmiss 7 scanvalid 450 bgscan
bgscanintvl 300 bgscanidle 250 roam:rssi 7 roam:rate 5 protmode CTS
wme burst roaming MANUAL</screen>
<para>Or you can try to configure it manually using the <para>Or you can try to configure it manually using the
same <filename>/etc/wpa_supplicant.conf</filename> <link same <filename>/etc/wpa_supplicant.conf</filename> <link
linkend="network-wireless-wpa-wpa-psk">above</link>, and linkend="network-wireless-wpa-wpa-psk">above</link>, and
run:</para> run:</para>
<screen>&prompt.root; <userinput>wpa_supplicant -i <replaceable>ath0</replaceable> -c /etc/wpa_supplicant.conf</userinput> <screen>&prompt.root; <userinput>wpa_supplicant -i <replaceable>wlan0</replaceable> -c /etc/wpa_supplicant.conf</userinput>
Trying to associate with 00:11:95:c3:0d:ac (SSID='freebsdap' freq=2412 MHz) Trying to associate with 00:11:95:c3:0d:ac (SSID='freebsdap' freq=2412 MHz)
Associated with 00:11:95:c3:0d:ac Associated with 00:11:95:c3:0d:ac
WPA: Key negotiation completed with 00:11:95:c3:0d:ac [PTK=TKIP GTK=TKIP]</screen> WPA: Key negotiation completed with 00:11:95:c3:0d:ac [PTK=CCMP GTK=CCMP]
CTRL-EVENT-CONNECTED - Connection to 00:11:95:c3:0d:ac completed (auth) [id=0 id_str=]</screen>
<para>The next operation is the launch of the <para>The next operation is the launch of the
<command>dhclient</command> command to get the IP <command>dhclient</command> command to get the IP
address from the DHCP server:</para> address from the DHCP server:</para>
<screen>&prompt.root; <userinput>dhclient <replaceable>ath0</replaceable></userinput> <screen>&prompt.root; <userinput>dhclient <replaceable>wlan0</replaceable></userinput>
DHCPREQUEST on ath0 to 255.255.255.255 port 67 DHCPREQUEST on wlan0 to 255.255.255.255 port 67
DHCPACK from 192.168.0.1 DHCPACK from 192.168.0.1
bound to 192.168.0.254 -- renewal in 300 seconds. bound to 192.168.0.254 -- renewal in 300 seconds.
&prompt.root; <userinput>ifconfig <replaceable>ath0</replaceable></userinput> &prompt.root; <userinput>ifconfig <replaceable>wlan0</replaceable></userinput>
ath0: flags=8843&lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&gt; mtu 1500 wlan0: flags=8843&lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&gt; mtu 1500
inet6 fe80::211:95ff:fed5:4362%ath0 prefixlen 64 scopeid 0x1
inet 192.168.0.254 netmask 0xffffff00 broadcast 192.168.0.255
ether 00:11:95:d5:43:62 ether 00:11:95:d5:43:62
media: IEEE 802.11 Wireless Ethernet autoselect (OFDM/48Mbps) inet 192.168.0.254 netmask 0xffffff00 broadcast 192.168.0.255
media: IEEE 802.11 Wireless Ethernet OFDM/36Mbps mode 11g
status: associated status: associated
ssid freebsdap channel 1 bssid 00:11:95:c3:0d:ac ssid freebsdap channel 1 (2412 MHz 11g) bssid 00:11:95:c3:0d:ac
authmode WPA privacy ON deftxkey UNDEF TKIP 2:128-bit txpowmax 36 country US ecm authmode WPA2/802.11i privacy ON deftxkey UNDEF
protmode CTS roaming MANUAL bintval 100</screen> AES-CCM 3:128-bit txpower 21.5 bmiss 7 scanvalid 450 bgscan
bgscanintvl 300 bgscanidle 250 roam:rssi 7 roam:rate 5 protmode CTS
wme burst roaming MANUAL</screen>
<note> <note>
<para>If the <filename>/etc/rc.conf</filename> is set up <para>If the <filename>/etc/rc.conf</filename> is set up
with the line <literal>ifconfig_ath0="DHCP"</literal> with the line <literal>ifconfig_wlan0="DHCP"</literal>
then it is no need to run the then it is no need to run the
<command>dhclient</command> command manually, <command>dhclient</command> command manually,
<command>dhclient</command> will be launched after <command>dhclient</command> will be launched after
@ -1319,17 +1356,18 @@ ath0: flags=8843&lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&gt; mtu 1500
<command>wpa_supplicant</command> has authenticated the <command>wpa_supplicant</command> has authenticated the
station:</para> station:</para>
<screen>&prompt.root; <userinput>ifconfig <replaceable>ath0</replaceable> inet <replaceable>192.168.0.100</replaceable> netmask <replaceable>255.255.255.0</replaceable></userinput> <screen>&prompt.root; <userinput>ifconfig <replaceable>wlan0</replaceable> inet <replaceable>192.168.0.100</replaceable> netmask <replaceable>255.255.255.0</replaceable></userinput>
&prompt.root; <userinput>ifconfig <replaceable>ath0</replaceable></userinput> &prompt.root; <userinput>ifconfig <replaceable>wlan0</replaceable></userinput>
ath0: flags=8843&lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&gt; mtu 1500 wlan0: flags=8843&lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&gt; mtu 1500
inet6 fe80::211:95ff:fed5:4362%ath0 prefixlen 64 scopeid 0x1
inet 192.168.0.100 netmask 0xffffff00 broadcast 192.168.0.255
ether 00:11:95:d5:43:62 ether 00:11:95:d5:43:62
media: IEEE 802.11 Wireless Ethernet autoselect (OFDM/36Mbps) inet 192.168.0.100 netmask 0xffffff00 broadcast 192.168.0.255
media: IEEE 802.11 Wireless Ethernet OFDM/36Mbps mode 11g
status: associated status: associated
ssid freebsdap channel 1 bssid 00:11:95:c3:0d:ac ssid freebsdap channel 1 (2412 MHz 11g) bssid 00:11:95:c3:0d:ac
authmode WPA privacy ON deftxkey UNDEF TKIP 2:128-bit txpowmax 36 country US ecm authmode WPA2/802.11i privacy ON deftxkey UNDEF
protmode CTS roaming MANUAL bintval 100</screen> AES-CCM 3:128-bit txpower 21.5 bmiss 7 scanvalid 450 bgscan
bgscanintvl 300 bgscanidle 250 roam:rssi 7 roam:rate 5 protmode CTS
wme burst roaming MANUAL</screen>
<para>When DHCP is not used, you also have to manually set <para>When DHCP is not used, you also have to manually set
up the default gateway and the nameserver:</para> up the default gateway and the nameserver:</para>
@ -1437,29 +1475,31 @@ ath0: flags=8843&lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&gt; mtu 1500
</callout> </callout>
</calloutlist> </calloutlist>
<para>Then add the following line to <para>Then add the following lines to
<filename>/etc/rc.conf</filename>:</para> <filename>/etc/rc.conf</filename>:</para>
<programlisting>ifconfig_ath0="WPA DHCP"</programlisting> <programlisting>wlans_ath0="wlan0"
ifconfig_wlan0="WPA DHCP"</programlisting>
<para>The next step is to bring up the interface with the <para>The next step is to bring up the interface with the
help of the <filename>rc.d</filename> facility:</para> help of the <filename>rc.d</filename> facility:</para>
<screen>&prompt.root; <userinput>/etc/rc.d/netif start</userinput> <screen>&prompt.root; <userinput>/etc/rc.d/netif start</userinput>
Starting wpa_supplicant. Starting wpa_supplicant.
DHCPREQUEST on ath0 to 255.255.255.255 port 67 DHCPREQUEST on wlan0 to 255.255.255.255 port 67 interval 7
DHCPREQUEST on ath0 to 255.255.255.255 port 67 DHCPREQUEST on wlan0 to 255.255.255.255 port 67 interval 15
DHCPACK from 192.168.0.20 DHCPACK from 192.168.0.20
bound to 192.168.0.254 -- renewal in 300 seconds. bound to 192.168.0.254 -- renewal in 300 seconds.
ath0: flags=8843&lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&gt; mtu 1500 wlan0: flags=8843&lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&gt; mtu 1500
inet6 fe80::211:95ff:fed5:4362%ath0 prefixlen 64 scopeid 0x1
inet 192.168.0.254 netmask 0xffffff00 broadcast 192.168.0.255
ether 00:11:95:d5:43:62 ether 00:11:95:d5:43:62
media: IEEE 802.11 Wireless Ethernet autoselect (DS/11Mbps) inet 192.168.0.254 netmask 0xffffff00 broadcast 192.168.0.255
media: IEEE 802.11 Wireless Ethernet DS/11Mbps mode 11g
status: associated status: associated
ssid freebsdap channel 1 bssid 00:11:95:c3:0d:ac ssid freebsdap channel 1 (2412 MHz 11g) bssid 00:11:95:c3:0d:ac
authmode WPA2/802.11i privacy ON deftxkey UNDEF TKIP 2:128-bit country US ecm authmode WPA2/802.11i privacy ON deftxkey UNDEF
txpowmax 36 protmode CTS roaming MANUAL bintval 100</screen> AES-CCM 3:128-bit txpower 21.5 bmiss 7 scanvalid 450 bgscan
bgscanintvl 300 bgscanidle 250 roam:rssi 7 roam:rate 5 protmode CTS
wme burst roaming MANUAL</screen>
<para>As previously shown, it is also possible to bring up <para>As previously shown, it is also possible to bring up
the interface manually with both the interface manually with both
@ -1527,29 +1567,31 @@ ath0: flags=8843&lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&gt; mtu 1500
</callout> </callout>
</calloutlist> </calloutlist>
<para>You also have to add the following line to <para>You also have to add the following lines to
<filename>/etc/rc.conf</filename>:</para> <filename>/etc/rc.conf</filename>:</para>
<programlisting>ifconfig_ath0="WPA DHCP"</programlisting> <programlisting>wlans_ath0="wlan0"
ifconfig_wlan0="WPA DHCP"</programlisting>
<para>The next step is to bring up the interface:</para> <para>The next step is to bring up the interface:</para>
<screen>&prompt.root; <userinput>/etc/rc.d/netif start</userinput> <screen>&prompt.root; <userinput>/etc/rc.d/netif start</userinput>
Starting wpa_supplicant. Starting wpa_supplicant.
DHCPREQUEST on ath0 to 255.255.255.255 port 67 DHCPREQUEST on wlan0 to 255.255.255.255 port 67 interval 7
DHCPREQUEST on ath0 to 255.255.255.255 port 67 DHCPREQUEST on wlan0 to 255.255.255.255 port 67 interval 15
DHCPREQUEST on ath0 to 255.255.255.255 port 67 DHCPREQUEST on wlan0 to 255.255.255.255 port 67 interval 21
DHCPACK from 192.168.0.20 DHCPACK from 192.168.0.20
bound to 192.168.0.254 -- renewal in 300 seconds. bound to 192.168.0.254 -- renewal in 300 seconds.
ath0: flags=8843&lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&gt; mtu 1500 wlan0: flags=8843&lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&gt; mtu 1500
inet6 fe80::211:95ff:fed5:4362%ath0 prefixlen 64 scopeid 0x1
inet 192.168.0.254 netmask 0xffffff00 broadcast 192.168.0.255
ether 00:11:95:d5:43:62 ether 00:11:95:d5:43:62
media: IEEE 802.11 Wireless Ethernet autoselect (DS/11Mbps) inet 192.168.0.254 netmask 0xffffff00 broadcast 192.168.0.255
media: IEEE 802.11 Wireless Ethernet DS/11Mbps mode 11g
status: associated status: associated
ssid freebsdap channel 1 bssid 00:11:95:c3:0d:ac ssid freebsdap channel 1 (2412 MHz 11g) bssid 00:11:95:c3:0d:ac
authmode WPA2/802.11i privacy ON deftxkey UNDEF TKIP 2:128-bit country US ecm authmode WPA2/802.11i privacy ON deftxkey UNDEF
txpowmax 36 protmode CTS roaming MANUAL bintval 100</screen> AES-CCM 3:128-bit txpower 21.5 bmiss 7 scanvalid 450 bgscan
bgscanintvl 300 bgscanidle 250 roam:rssi 7 roam:rate 5 protmode CTS
wme burst roaming MANUAL</screen>
</sect5> </sect5>
<sect5 id="network-wireless-wpa-eap-peap"> <sect5 id="network-wireless-wpa-eap-peap">
@ -1637,26 +1679,28 @@ ath0: flags=8843&lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&gt; mtu 1500
<para>The following must be added to <para>The following must be added to
<filename>/etc/rc.conf</filename>:</para> <filename>/etc/rc.conf</filename>:</para>
<programlisting>ifconfig_ath0="WPA DHCP"</programlisting> <programlisting>wlans_ath0="wlan0"
ifconfig_wlan0="WPA DHCP"</programlisting>
<para>Then, we can bring up the interface:</para> <para>Then, we can bring up the interface:</para>
<screen>&prompt.root; <userinput>/etc/rc.d/netif start</userinput> <screen>&prompt.root; <userinput>/etc/rc.d/netif start</userinput>
Starting wpa_supplicant. Starting wpa_supplicant.
DHCPREQUEST on ath0 to 255.255.255.255 port 67 DHCPREQUEST on wlan0 to 255.255.255.255 port 67 interval 7
DHCPREQUEST on ath0 to 255.255.255.255 port 67 DHCPREQUEST on wlan0 to 255.255.255.255 port 67 interval 15
DHCPREQUEST on ath0 to 255.255.255.255 port 67 DHCPREQUEST on wlan0 to 255.255.255.255 port 67 interval 21
DHCPACK from 192.168.0.20 DHCPACK from 192.168.0.20
bound to 192.168.0.254 -- renewal in 300 seconds. bound to 192.168.0.254 -- renewal in 300 seconds.
ath0: flags=8843&lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&gt; mtu 1500 wlan0: flags=8843&lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&gt; mtu 1500
inet6 fe80::211:95ff:fed5:4362%ath0 prefixlen 64 scopeid 0x1
inet 192.168.0.254 netmask 0xffffff00 broadcast 192.168.0.255
ether 00:11:95:d5:43:62 ether 00:11:95:d5:43:62
media: IEEE 802.11 Wireless Ethernet autoselect (DS/11Mbps) inet 192.168.0.254 netmask 0xffffff00 broadcast 192.168.0.255
media: IEEE 802.11 Wireless Ethernet DS/11Mbps mode 11g
status: associated status: associated
ssid freebsdap channel 1 bssid 00:11:95:c3:0d:ac ssid freebsdap channel 1 (2412 MHz 11g) bssid 00:11:95:c3:0d:ac
authmode WPA2/802.11i privacy ON deftxkey UNDEF TKIP 2:128-bit country US ecm authmode WPA2/802.11i privacy ON deftxkey UNDEF
txpowmax 36 protmode CTS roaming MANUAL bintval 100</screen> AES-CCM 3:128-bit txpower 21.5 bmiss 7 scanvalid 450 bgscan
bgscanintvl 300 bgscanidle 250 roam:rssi 7 roam:rate 5 protmode CTS
wme burst roaming MANUAL</screen>
</sect5> </sect5>
</sect4> </sect4>
@ -1671,7 +1715,8 @@ ath0: flags=8843&lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&gt; mtu 1500
<para>WEP can be set up with <para>WEP can be set up with
<command>ifconfig</command>:</para> <command>ifconfig</command>:</para>
<screen>&prompt.root; <userinput>ifconfig <replaceable>ath0</replaceable> ssid my_net wepmode on weptxkey 3 wepkey 3:0x3456789012 \ <screen>&prompt.root; <userinput>ifconfig <replaceable>wlan0</replaceable> create wlandev <replaceable>ath0</replaceable></userinput>
&prompt.root; <userinput>ifconfig <replaceable>wlan0</replaceable> ssid my_net wepmode on weptxkey 3 wepkey 3:0x3456789012 \
inet <replaceable>192.168.1.100</replaceable> netmask <replaceable>255.255.255.0</replaceable></userinput></screen> inet <replaceable>192.168.1.100</replaceable> netmask <replaceable>255.255.255.0</replaceable></userinput></screen>
<itemizedlist> <itemizedlist>
@ -1719,7 +1764,7 @@ ath0: flags=8843&lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&gt; mtu 1500
<para>Then:</para> <para>Then:</para>
<screen>&prompt.root; <userinput>wpa_supplicant -i <replaceable>ath0</replaceable> -c /etc/wpa_supplicant.conf</userinput> <screen>&prompt.root; <userinput>wpa_supplicant -i <replaceable>wlan0</replaceable> -c /etc/wpa_supplicant.conf</userinput>
Trying to associate with 00:13:46:49:41:76 (SSID='dlinkap' freq=2437 MHz) Trying to associate with 00:13:46:49:41:76 (SSID='dlinkap' freq=2437 MHz)
Associated with 00:13:46:49:41:76</screen> Associated with 00:13:46:49:41:76</screen>
</sect4> </sect4>
@ -1737,12 +1782,12 @@ Associated with 00:13:46:49:41:76</screen>
<para>On the box <hostid>A</hostid>:</para> <para>On the box <hostid>A</hostid>:</para>
<screen>&prompt.root; <userinput>ifconfig <replaceable>ath0</replaceable> ssid <replaceable>freebsdap</replaceable> mediaopt adhoc inet <replaceable>192.168.0.1</replaceable> netmask <replaceable>255.255.255.0</replaceable></userinput> <screen>&prompt.root; <userinput>ifconfig <replaceable>wlan0</replaceable> create wlandev <replaceable>ath0</replaceable></userinput>
&prompt.root; <userinput>ifconfig <replaceable>ath0</replaceable></userinput> &prompt.root; <userinput>ifconfig <replaceable>wlan0</replaceable> ssid <replaceable>freebsdap</replaceable> mediaopt adhoc inet <replaceable>192.168.0.1</replaceable> netmask <replaceable>255.255.255.0</replaceable></userinput>
ath0: flags=8843&lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&gt; mtu 1500 &prompt.root; <userinput>ifconfig <replaceable>wlan0</replaceable></userinput>
inet 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0.255 wlan0: flags=8843&lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&gt; mtu 1500
inet6 fe80::211:95ff:fec3:dac%ath0 prefixlen 64 scopeid 0x4
ether 00:11:95:c3:0d:ac ether 00:11:95:c3:0d:ac
inet 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0.255
media: IEEE 802.11 Wireless Ethernet autoselect &lt;adhoc&gt; (autoselect &lt;adhoc&gt;) media: IEEE 802.11 Wireless Ethernet autoselect &lt;adhoc&gt; (autoselect &lt;adhoc&gt;)
status: associated status: associated
ssid freebsdap channel 2 bssid 02:11:95:c3:0d:ac ssid freebsdap channel 2 bssid 02:11:95:c3:0d:ac
@ -1754,21 +1799,21 @@ Associated with 00:13:46:49:41:76</screen>
<para>On <hostid>B</hostid>, we should be able to detect <para>On <hostid>B</hostid>, we should be able to detect
<hostid>A</hostid>:</para> <hostid>A</hostid>:</para>
<screen>&prompt.root; <userinput>ifconfig <replaceable>ath0</replaceable> up scan</userinput> <screen>&prompt.root; <userinput>ifconfig <replaceable>wlan0</replaceable> up scan</userinput>
SSID BSSID CHAN RATE S:N INT CAPS SSID BSSID CHAN RATE S:N INT CAPS
freebsdap 02:11:95:c3:0d:ac 2 54M 19:3 100 IS</screen> freebsdap 02:11:95:c3:0d:ac 2 54M -90:-96 100 IS</screen>
<para>The <literal>I</literal> in the output confirms the <para>The <literal>I</literal> in the output confirms the
machine <hostid>A</hostid> is in ad-hoc mode. We just have to machine <hostid>A</hostid> is in ad-hoc mode. We just have to
configure <hostid>B</hostid> with a different IP configure <hostid>B</hostid> with a different IP
address:</para> address:</para>
<screen>&prompt.root; <userinput>ifconfig <replaceable>ath0</replaceable> ssid <replaceable>freebsdap</replaceable> mediaopt adhoc inet <replaceable>192.168.0.2</replaceable> netmask <replaceable>255.255.255.0</replaceable></userinput> <screen>&prompt.root; <userinput>ifconfig <replaceable>wlan0</replaceable> create wlandev <replaceable>ath0</replaceable></userinput>
&prompt.root; <userinput>ifconfig <replaceable>ath0</replaceable></userinput> &prompt.root; <userinput>ifconfig <replaceable>wlan0</replaceable> ssid <replaceable>freebsdap</replaceable> mediaopt adhoc inet <replaceable>192.168.0.2</replaceable> netmask <replaceable>255.255.255.0</replaceable></userinput>
ath0: flags=8843&lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&gt; mtu 1500 &prompt.root; <userinput>ifconfig <replaceable>wlan0</replaceable></userinput>
inet6 fe80::211:95ff:fed5:4362%ath0 prefixlen 64 scopeid 0x1 wlan0: flags=8843&lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&gt; mtu 1500
inet 192.168.0.2 netmask 0xffffff00 broadcast 192.168.0.255
ether 00:11:95:d5:43:62 ether 00:11:95:d5:43:62
inet 192.168.0.2 netmask 0xffffff00 broadcast 192.168.0.255
media: IEEE 802.11 Wireless Ethernet autoselect &lt;adhoc&gt; (autoselect &lt;adhoc&gt;) media: IEEE 802.11 Wireless Ethernet autoselect &lt;adhoc&gt; (autoselect &lt;adhoc&gt;)
status: associated status: associated
ssid freebsdap channel 2 bssid 02:11:95:c3:0d:ac ssid freebsdap channel 2 bssid 02:11:95:c3:0d:ac