<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
  <!ENTITY % general-entities SYSTEM "../../general.ent">
  %general-entities;
]>

<sect1 id="ch-beyond-net-hostapd" role="wrap">
  <?dbhtml filename="hostapd.html"?>

  <title>hostapd-&hostapd-version;</title>

  <indexterm zone="ch-beyond-net-hostapd">
    <primary sortas="a-hostapd">hostapd</primary>
  </indexterm>

  <sect2 role="package">
    <title/>

    <para>Hostapd is a daemon required for setting up a wireless access point, 
    it supports WEP, WPA and WPA2 encryption and can optionally use EAP for 
    authentification, but since this feature requires OpenSSL only basic 
    WEP/WPA/WPA2 encryption will be compiled here.</para>

  </sect2>

  <sect2 role="installation">
    <title>Installation of hostapd</title>

    <para os="a">By default only a very basic hostapd is made, but hostapd 
    supports a lot of other options as well. Write a basic config file for 
    hostapd:</para>

<screen os="b"><userinput>cd hostapd; cat &gt; .config &lt;&lt; EOF
<literal># Support for nl80211 driver
CONFIG_DRIVER_NL80211=y
# Use v2.0 of the netlink appi
CFLAGS += -DCONFIG_LIBNL20
LDFLAGS += -lnl-genl

CONFIG_RSN_PREAUTH=y

# PeerKey handshake for Station to Station Link (IEEE 802.11e DLS)
CONFIG_PEERKEY=y
# Support draft ieee 802.11n
CONFIG_IEEE80211N=y

# Remove debugging code that is printing out debug messages to stdout.
# This can be used to reduce the size of the hostapd considerably if debugging
# code is not needed.
CONFIG_NO_STDOUT_DEBUG=y
EOF</literal></userinput></screen>

    <para os="c">Compile the package:</para>

<screen os="d"><userinput>make CFLAGS="-g -Os -Wall"</userinput></screen>

    <para os="e">Install the package:</para>

<screen os="f"><userinput>cp hostapd hostapd_cli ${CLFS}/targetfs/usr/sbin</userinput></screen>

  </sect2>

  <sect2 role="bootscripts">
   <title>Installation of hostapd Bootscripts</title>

    <para os="h">From the clfs-bootscripts package, install the hostapd bootscripts:</para>

<screen os="i"><userinput>make install-hostapd DESTDIR=${CLFS}/targetfs</userinput></screen>

  </sect2>

  <sect2 role="configuration">
   <title>Configure hostapd</title>

    <para os="j">Create hostapd.conf, this example file will create a WPA2 
    encrypted host access point with the name dummy and password foobar123 on 
    channel 4:</para>

<screen os="k"><userinput>cat &gt; ${CLFS}/targetfs/etc/hostapd.conf &lt;&lt; EOF
<literal># Sample hostapd.conf
# See hostapd/hostapd.conf in your hostap source tree for a more detailed version
interface=wlan0
bridge=br0
ctrl_interface=/var/run/hostapd
ssid=<replaceable>dummy</replaceable>
#country_code=US
country_code=<replaceable>EU</replaceable>
hw_mode=g
channel=<replaceable>4</replaceable>

# wpa=1 only allow WPA1
# wpa=2 allow WPA2 only
# wpa=3 allow WPA1 + WPA2
wpa=2
wpa_passphrase=<replaceable>foobar123</replaceable>
# b43 drivers seem to have issues at the moment with CCMP encryption
# dropping packets among other things so use TKIP (AES) only for now
wpa_pairwise=TKIP
rsn_pairwise=TKIP
EOF</literal></userinput></screen>

  </sect2>

  <sect2 id="contents-hostapd" role="content">
    <title>Contents of hostapd</title>

    <segmentedlist>
      <segtitle>Installed programs</segtitle>

      <seglistitem>
        <seg>To be Written</seg>
      </seglistitem>
    </segmentedlist>

  </sect2>

</sect1>
