Access Point from WiFi Stick

belkinBefore going to vacation I realized that I only have computer which is connected directly to internet and no WiFi at all available at the location of my vacation. At home I have an old Belkin WiFi stick which I thought to through away several times and kept forgetting. I felt that this stick would be useful for connecting my smartphone via WiFi at my vacation location. Well, I simply didnt know how to do it. But this time I decided to investigate the possibility. To make things short – I made it and apparently all process is not difficult at all.

Before continue I must describe my circumstances – old PC with Linux Mint 15 (Ubuntu based), old Belkin WiFi stick like the one on photograph, ppp connection via cable. Belkin device has default address wlan0 and ppp connection is ppp0
1. I installed DHCP server and hostapd on computer with command:
sudo apt-get update && apt-get install dhcp3-server hostapd

2. I created a file, in my home folder, called hostapd.conf with following content:


3. I have setup DHCP server by editing file /etc/dhcp/dhcpd.conf
ddns-update-style none;
ignore client-updates;
option local-wpad code 252 = text;

subnet netmask {
# — default gateway
option routers;
# — Netmask
option subnet-mask;
# — Broadcast Address
option broadcast-address;
# — Domain name servers, tells the clients which DNS servers to use.
option domain-name-servers,,;
option time-offset
default-lease-time 1209600;
max-lease-time 1814400;
DO NOT FORGET TO BACKUP ORIGINAL FILE – do: sudo cp /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.bak before editing it’s content.

4. Created a script to start access point:
#Initial wifi interface configuration
ifconfig wlan0 up netmask
sleep 2
###########Start DHCP, comment out / add relevant section##########
#Thanks to Panji
#Doesn’t try to run dhcpd when already running
if [ “$(ps -e | grep dhcpd)” == “” ]; then
dhcpd wlan0 &
#Enable NAT
iptables –flush
iptables –table nat –flush
iptables –delete-chain
iptables –table nat –delete-chain
iptables –table nat –append POSTROUTING –out-interface ppp0 -j MASQUERADE
iptables –append FORWARD –in-interface wlan0 -j ACCEPT

#Thanks to lorenzo
#Uncomment the line below if facing problems while sharing PPPoE, see lorenzo’s comment for more details
#iptables -I FORWARD -p tcp –tcp-flags SYN,RST SYN -j TCPMSS –clamp-mss-to-pmtu

sysctl -w net.ipv4.ip_forward=1
#start hostapd
hostapd -B /home/myuser/hostapd.conf 1>/dev/null

I have named this file startap and made it executable by sudo chmod +x startap

After starting this file you should see your wifi access point on your smartphone. Remember that this script must be run with super user permissions – sudo …

5. Last optional thing was I made this script to run on startup of my computer: I copied my file to /etc/init.d folder, then I run the following command: sudo update-rc.d startap defaults

After restart my access point was there.

Materials taken from

Bookmark and Share
Here can be your banner, contact me about conditions.