Thread: DNS Tunnel
View Single Post
Posts: 18 | Thanked: 3 times | Joined on Mar 2007 @ Göteborg, Sweden
#38
Today I successfully established a DNS tunnel with iodine. I tested it at different hotspots from two of the major wireless operators in Sweden. Both are using unencrypted networks with web login.

Here is my recipe (exchange mytunnel.mydomain.com with your subdomain):

Run iodined on your server:
Code:
iodined -f 10.9.0.1 mytunnel.mydomain.com
Choose a password.

Save this shell script on your tablet and run it as root. It will change the default gateway so all traffic is routed through the tunnel. Enter the password you chose above when asked:
Code:
#!/bin/sh

DOMAIN="mytunnel.mydomain.com"
IFACE="wlan0"

RESOLV="/tmp/resolv.conf"
GW=`route -n | tail -1 | cut -d ' ' -f 10`

for NS in `grep nameserver  $RESOLV.$IFACE | cut -d ' ' -f 2`
do
  echo route add $NS gw $GW $IFACE
  route add $NS gw $GW $IFACE
done

echo iodine $NS $DOMAIN
iodine $NS $DOMAIN
route del default
route add default gw 10.9.0.1 dns0
This script makes a few assumptions on the output of the route command but it has worked for me.

To stop the tunnel, run:
Code:
killall iodine
This will not restore the default gateway. Just reconnect to the network if you want it back.