Raspberry Pi as a wi-Fi Access point using Joy-IT

These are steps I followed to make the Raspberry Pi act as a Wi-Fi access point.

I am using a Raspberry Pi B with Joy-iT WLAN stick inserted into one of the USB ports.

I have the ethernet cable connected to the Pi for the incoming internet connection.

The OS running on the Pi is the Raspbian Wheezy.

I have connected the Pi to my TV using the HDMI and I use the Microsoft Wireless Keyboard 800 as the input device.

1) Remove existing hostapd if any.

sudo apt-get autoremove hostapd

2) Get the modified RealTek driver and extract it. Ensure that the ethernet cable is connected to the Pi.

Thanks to : http://jenssegers.be/blog/43/Realtek-RTL8188-based-access-point-on-Raspberry-Pi.

wget https://github.com/jenssegers/RTL8188-hostapd/archive/v1.1.tar.gz
tar -zxvf v1.1.tar.gz

3) Build the driver that was downloaded in the previous step. This step takes some time. initially it may seem that nothing is happening but after some time the compiler CC messages appear.

cd RTL8188-hostapd-1.1/hostapd
sudo make

4) Install the driver.

sudo make install

5) Edit the /etc/udhcpd.conf using nano.

sudo nano /etc/udhcpd.conf

Change the contents to :

interface wlan0
remaining yes
opt dns
opt subnet
opt router
opt lease 864000

5) Edit the /etc/default/udhcpd using nano.

sudo nano /etc/default/udhcpd

comment the DHCPD_ENABLED=”no” (i.e. put the hash at the beginning of the line):


6) Run the following command. Gives a static IP to the Pi.

sudo ifconfig wlan0

7) Make the above step automatic at boot. Edit the /etc/network/interfaces.

sudo nano /etc/network/interfaces

Replace the line iface wlan0 inet dhcp to:

iface wlan0 inet static

If the line iface wlan0 inet dhcp is not present, add the above lines to the bottom of the file.
Comment the below lines (i.e. put the hash at the beginning of the line).

#allow-hotplug wlan0
#wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
#iface default inet manual

8) Edit or create the /etc/hostapd/hostapd.conf .

sudo nano /etc/hostapd/hostapd.conf


Choose ssid and wpa_passphrase of your liking. This will be the name and the password of the Wi-Fi access point created by the Pi.

9) Make the configuration file created in the previous step active. Edit /etc/default/hostapd

sudo nano /etc/default/hostapd

Change the


line to


Do not forget to remove the # at the beginning of the line.

10) Enable IP forwarding in the kernel.

sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward" 

Edit the /etc/sysctl.conf file to make this step automatic at boot.

sudo nano /etc/sysctl.conf

Add the below line at the bottom of this file.


11) Run the below commands to enable NAT.

sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
sudo iptables -A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT

Make this step automatic at boot.

sudo sh -c "iptables-save > /etc/iptables.ipv4.nat"

12) Edit /etc/network/interfaces.

sudo nano /etc/default/hostapd

Add the below line at the bottom of this file.

up iptables-restore < /etc/iptables.ipv4.nat

13) Run the following commands as the last step to make the Pi an Acess point.

sudo service hostapd start
sudo service udhcpd start

Make the Pi an Access Point right from its boot.

sudo update-rc.d hostapd enable
sudo update-rc.d udhcpd enable

The above steps make the Pi a decent access point. Sometimes there have been issues where the PI stops being an Access Point and I need to run the below commands to restart the hostapd and udhcpd.

sudo service hostapd restart
sudo service udhcpd restart

The steps I have followed are from the following sources:



Leave a Reply

Your email address will not be published. Required fields are marked *