Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way I can configure my notebook as an access point for the desktop pc, my tablet and phone over an internet connection I'm sharing with my neighbor which only connects from the balcony of my house?

share|improve this question
how did you connected your netbook with your neighbour's pc? – Avinash Raj Dec 1 '13 at 12:38

This is the tutorial I am using right now and I am sharing with you. Credit goes to XDA Developers.

  • Open your terminal and paste as

    sudo apt-get install hostapd dnsmasq
  • Then paste these one after one.

    sudo service hostapd stop
    sudo service dnsmasq stop
    sudo update-rc.d hostapd disable
    sudo update-rc.d dnsmasq disable
  • after that paste as

    sudo gedit /etc/dnsmasq.conf

and paste these lines

# Bind to only one interface
# Choose interface for binding
# Specify range of IP addresses for DHCP leasses
  • Then again

      sudo gedit /etc/hostapd.conf

paste this

# Define interface
# Select driver
# Set access point name
# Set access point harware mode to 802.11g
# Set WIFI channel (can be easily changed)
# Enable WPA2 only (1 for WPA, 2 for WPA2, 3 for WPA + WPA2)

Now open a text editor and paste

# Start
# Configure IP address for WLAN
sudo ifconfig wlan0
# Start DHCP/DNS server
sudo service dnsmasq restart
# Enable routing
sudo sysctl net.ipv4.ip_forward=1
# Enable NAT
sudo iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
# Run access point daemon
sudo hostapd /etc/hostapd.conf
# Stop
# Disable NAT
sudo iptables -D POSTROUTING -t nat -o ppp0 -j MASQUERADE
# Disable routing
sudo sysctl net.ipv4.ip_forward=0
# Disable DHCP/DNS server
sudo service dnsmasq stop
sudo service hostapd stop

and save it with any name and do as

chmod +x

so you will have a wifi access point.

Note: ssid=myhotspot

set the access point name as you want by editing there.


here you can set your password as you want.

sudo iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE

change ppp0 to the connection from which you will get Internet.

sudo iptables -D POSTROUTING -t nat -o ppp0 -j MASQUERADE

Here also same change it.

And we are ready to go.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.