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
Step 1:
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
For more detail: WiFi ā Access Point out of a Raspberry Pi (Repeater)