Skip navigation

Step 1: Tethering

Running Android? Install azilink
Something else? Find a way to tether…

Make note of the device you’re using to connect (e.g. azilink –> tun0, “real tethering” –> usb0, etc)

Step 2: Ad-Hoc Network

— Server side (the tethered device) —

# Set up ad-hoc network:
iwconfig wlan0 mode ad-hoc
iwconfig wlan0 essid Jkrez # <-- network name here
ifconfig wlan0

# Some quick permissions…
echo 1 > /proc/sys/net/ipv4/ip_forward
vi /etc/sysctl.conf
net.ipv4.ip_forward = 1

# Make me a router! (note -o “output” device, -i “input” device)
iptables -A FORWARD -o tun0 -i wlan0 -s -m conntrack --ctstate NEW -j ACCEPT
iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
iptables -t nat -A POSTROUTING -j MASQUERADE

— DHCP Server —

Don’t want to manually configure clients? Time for a little dhcp3d server action:

sudo apt-get install dhcp3-server

edit /etc/default/dhcpd3-server

INTERFACES="tun0" #<-- same interface name as above

edit /etc/dhcpd3/dhcpd.conf
Add/change the following:


option domain-name “Jkrez”; #essid from before
option domain-name-servers #Google dns, or your favorite dns

subnet netmask {
option routers;
option subnet-mask
option time-offset -18000; #Eastern timezone

Then run:
sudo /etc/init.d/dhcpd3-server

Now clients should be able to auto connect. Enjoy!

— Don’t want to mess with a dhcp server? —

Set up a client (GUI edition!)

In NetworkManager try to connect to Jkrez (this will fail since no dhcp)
Right Click and “edit connections”, in Wireless tab select Jkrez and “Edit”
Go to IPv4 Settings and enter:
IP # Unique IP for each client

DNS # Or your favorite nameserver

These steps can also be done via CLI; setup ad-hoc wifi same way using iwconfig, ip/mask/gateway via ifconfig, and dns vi /etc/resolv.conf


Thanks to my friend Pat, and the following linux links for tips along the way:


One Comment

  1. I was recommended this website by my cousin. I am not sure whether this post is written by
    him as no one else know such detailed about my trouble.
    You are amazing! Thanks!

2 Trackbacks/Pingbacks

  1. […] Making A Ubuntu Hotspot ( […]

  2. By Wireless bridge, update | cartesian product on 21 Jul 2011 at 12:38 pm

    […] Making A Ubuntu Hotspot ( […]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: