Skip navigation

Tag Archives: tether

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: