Instructables

WiFi - Access Point out of a Raspberry Pi (bridged to eth0)

Picture of WiFi - Access Point out of a Raspberry Pi (bridged to eth0)
What do you need?

A Raspberry Pi, model B.
A boot SD card for the Raspberry Pi.
A USB WiFi device that supports "Access Point" mode.
An Ethernet cable to connect to the local network.

How does it work?

The Raspberry Pi is configured as a WiFi Hotspot, just like you would see in an internet cafe. It allows you to connect to the internet over WiFi using the Raspberry Pi as the bridge to the internet. The basic steps are

  • Enable a WiFi Access Point and broadcast on the channel of your choice
  • Assign dynamic IP addresses to any device that connects to WiFi network
  • Join the WiFi and Ethernet networks together by using Network Address Translation
 
Remove these adsRemove these ads by Signing Up

Step 1:

Picture of


1. Install the necessary software.
sudo aptitude install hostapd hostap-utils iw bridge-utils


2.Edit the file Hostapd:

sudo nano /etc/init.d/hostapd

and add to (DAEMON_CONF=) the following line:

DAEMON_CONF=/etc/hostapd/hostapd.conf


Save nano(CTRL+O)and Exit(CTRL+X)


3.Configure Hostapd.conf

You can create an open network, or a WPA-secured network, or a WPA-secured network. A secure network is recommended to prevent unauthorized use andtampering, but you can also create an open network. To create a WPA-secured network, edit the file /etc/hostapd/hostapd.conf (create it if it doesn't exist) and add the following lines:

sudo nano /etc/hostapd/hostapd.conf

ctrl_interface=/var/run/hostapd
###############################
# Basic Config
###############################
macaddr_acl=0 auth_algs=1
# Most modern wireless drivers in the kernel need driver=nl80211
driver=nl80211
##########################
# Local configuration...
##########################
interface=wlan0
bridge=br0
hw_mode=g
ieee80211n=1
channel=1
ssid=RaspberryPI_AP
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=3
wpa_passphrase=MY_PASSPHRASE
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP


Save nano(CTRL+O)and Exit(CTRL+X)

Important:
!! Change ssid=, channel=, and wpa_passphrase= to values of your choice. SSID is the hotspot's name
!! which is broadcast to other devices, channel is what frequency the hotspot will run on,
!! wpa_passphrase is the password for the wireless network


(If you would like to create an open network, put the following text into /etc/hostapd/hostapd.conf:)

sudo nano /etc/hostapd/hostapd.conf


ctrl_interface=/var/run/hostapd
###############################
# Basic Config
###############################
macaddr_acl=0 auth_algs=1
# Most modern wireless drivers in the kernel need driver=nl80211
driver=nl80211
##########################
# Local configuration...
##########################
interface=wlan0
bridge=br0
ssid=RaspberryPI_AP
hw_mode=g
ieee80211n=1
channel=1
auth_algs=1
wmm_enabled=0


Save nano(CTRL+O)and Exit(CTRL+X)
thecensor1 month ago

I'm interested in Internet billing capability. Is that possible?

thanks

Timofte Andrei10 months ago
Hi! I have a little question: I want to use raspi as AP but i also want to connect my raspi directly to network cable which is actually a PPPoE network. I've tried to change eth0 with ppp0 but i don't get any result... is it something wrong? thanks
rusty010110 months ago
Wanted to say thnak you, I was just looking for something like this. Finding a lot of articles suggesting making a Raspberry pi into an access point, pi-point for example, that then set up the R/pi as a NAT router. This looks a lot more like an AP. Since the AP I'm using at the moment has become unreliable, I'm hoping that I'll be able to use hardware I have on hand to turn an R/pi into a replacement. If all works, I'll update here.