Thursday, 7 November 2013

Hostapd - user space daemon for AP and authentication server

To make hotspot on a laptop, Check if iwlist to check if it has AP capability as shown below.


Download hostpad source code from http://hostap.epitest.fi/hostapd/. Read http://wireless.kernel.org/en/users/Documentation/hostapd for further details.
root@ramapriya:/home/ramapriya/hostapd-2.4/hostapd#cp defconfig .config
root@ramapriya:/home/ramapriya/hostapd-2.4/hostapd#make
You get two binaries after successful make: hostapd and hostapd_cli.

Once set up is ready, change hostapd.conf file in hostapd folder.
A sample configuration is given below:


interface=wlan0
ctrl_interface=/var/run/hostapd
ssid=Shim_te_ccmp
hw_mode=g
wpa_passphrase=123456789012
wpa_key_mgmt=WPA-PSK
wpa_pairwise=CCMP
ht_capab=[SHORT-GI-20][TX-STBC][HT40-][RX-STBC1]
channel=1
rts_threshold=2346
fragm_threshold=2346
beacon_int=100
wpa=2
ieee80211n=1
wmm_enabled=1
wpa_group_rekey=0
wps_state=1

2. Start hostapd.
./hostapd  hostapd.conf

3. Start the AP using the configuration in hostapd.conf file.
./hostapd_cli

Possible errors:
fatal error: netlink/genl/genl.h: No such file or directory
Solution:
sudo apt-get install libnl-dev