Raspberry Pi as Wireless Access Point

Make RaPi into a WAP.

from Paul's article located here

 

Install the packages required

   Type: sudo apt-get install hostapd bridge-utils iw

At this time you should be able to test that the nano wifi you have inserted does not support the nl80211 api which the current versions of hostapd require to function.

   Type: iw list

   Output: 

nl80211 not found

The output above is a good sign that we are on track and require the older hostapd to function (we download it later).

Modify the default configuration files as shown

   Type: sudo nano /etc/default/hostapd

   File Content:

DAEMON_CONF=”/etc/hostapd/hostapd.conf”

 create the configuration file as shown below and consider changing the ‘ssid’ & ‘wpa_passphrase' to match your own preference a word of warning the wpa_passphrase is between 8 - 63 charaters long. The 'country_code' should also be adjusted to match your location

   Type: sudo nano /etc/hostapd/hostapd.conf

   File Content:

interface=wlan0

bridge=br0

driver=rtl871xdrv

country_code=NZ

ctrl_interface=wlan0

ctrl_interface_group=0

ssid=RPiAP

hw_mode=g

channel=1

wpa=3

wpa_passphrase=PASSWORD

wpa_key_mgmt=WPA-PSK

wpa_pairwise=TKIP

rsn_pairwise=CCMP

beacon_int=100

auth_algs=3

macaddr_acl=0

wmm_enabled=1

eap_reauth_period=360000000

Make a backup of the existing configuration file and then modify as shown for a simple DHCP client configuration.

   Type: sudo cp /etc/network/interfaces /etc/network/interfaces.bak

   Type: sudo nano /etc/network/interfaces

   File Content:

 

auto lo

auto br0

iface lo inet loopback

iface br0 inet dhcp

        bridge_fd 1

        bridge_hello 3

        bridge_maxage 10

        bridge_stp off

        bridge_ports eth0 wlan0

allow-hotplug eth0

iface eth0 inet manual

allow-hotplug wlan0

iface wlan0 inet manual

 Backup the existing hostapd binary file

   Type : cd /usr/sbin

Type: sudo cp /usr/sbin/hostapd /usr/sbin/hostapd.bak

Now delete the original

   Type: sudo rm -f hostapd

Download the replacement hostapd binary for one that supports the rtl driver api

   Type: sudo wgethttp://dl.dropbox.com/u/1663660/hostapd/hostapd

Set ownership and permissions of the downloaded file

   Type: sudo chown root:root hostapd

   Type: sudo chmod 755 hostapd

Finaly, restart the subsystems to activate the changes.

   Type: sudo service networking restart

   Type: sudo service hostapd restart

You should see the your Raspberry Pi SSID on a Wifi scan of another device, the range is quite short so make sure you are close by.