2006-06-23 11:54:47 +03:00
|
|
|
|
2007-06-07 21:06:07 +03:00
|
|
|
iodine - http://code.kryo.se/iodine
|
2006-06-23 11:54:47 +03:00
|
|
|
|
2007-06-07 21:06:07 +03:00
|
|
|
***********************************
|
2006-06-23 11:54:47 +03:00
|
|
|
|
|
|
|
This is a piece of software that lets you tunnel IPv4 data through a DNS
|
|
|
|
server. This can be usable in different situations where internet access is
|
|
|
|
firewalled, but DNS queries are allowed.
|
|
|
|
|
|
|
|
|
2006-08-13 22:18:35 +03:00
|
|
|
QUICKSTART:
|
|
|
|
|
|
|
|
Try it out within your own LAN! Follow these simple steps:
|
|
|
|
- On your server, run: ./iodined -f 10.0.0.1 test.asdf
|
|
|
|
(If you already use the 10.0.0.0 network, use another internal net like
|
|
|
|
172.16.0.0)
|
2006-11-18 18:26:39 +02:00
|
|
|
- Enter a password
|
2006-08-13 22:18:35 +03:00
|
|
|
- On the client, run: ./iodine -f 192.168.0.1 test.asdf
|
|
|
|
(Replace 192.168.0.1 with the server's ip address)
|
2006-11-18 18:26:39 +02:00
|
|
|
- Enter the same password
|
2006-08-13 22:18:35 +03:00
|
|
|
- Now the client has the tunnel ip 10.0.0.2 and the server has 10.0.0.1
|
|
|
|
- Try pinging each other through the tunnel
|
|
|
|
- Done! :)
|
|
|
|
To actually use it through a relaying nameserver, see below.
|
|
|
|
|
|
|
|
|
2006-06-23 11:54:47 +03:00
|
|
|
HOW TO USE:
|
|
|
|
|
|
|
|
Server side:
|
|
|
|
To use this tunnel, you need control over a real domain (like mytunnel.com),
|
2008-08-08 00:18:15 +03:00
|
|
|
and a server with a public IP number. If the server already runs a DNS
|
|
|
|
server, change the listening port and then use the -b option to let
|
|
|
|
iodined forward the DNS requests. Then, delegate a subdomain
|
|
|
|
(say, tunnel1.mytunnel.com) to the server. If you use BIND for the domain,
|
|
|
|
add these lines to the zone file:
|
2006-06-23 11:54:47 +03:00
|
|
|
|
|
|
|
tunnel1host IN A 10.15.213.99
|
2006-06-24 14:46:50 +03:00
|
|
|
tunnel1 IN NS tunnel1host.mytunnel.com.
|
2006-06-23 11:54:47 +03:00
|
|
|
|
2007-05-30 11:49:11 +03:00
|
|
|
Do not use CNAME instead of A above.
|
2007-06-12 19:41:46 +03:00
|
|
|
If your server has a dynamic IP, use a dynamic dns provider:
|
|
|
|
|
|
|
|
tunnel1 IN NS tunnel1host.mydyndnsprovider.com
|
|
|
|
|
2006-06-23 11:54:47 +03:00
|
|
|
Now any DNS querys for domains ending with tunnel1.mytunnnel.com will be sent
|
|
|
|
to your server. Start iodined on the server. The first argument is the tunnel
|
|
|
|
IP address (like 192.168.99.1) and the second is the assigned domain (in this
|
|
|
|
case tunnel1.mytunnel.com). The -f argument will keep iodined running in the
|
|
|
|
foreground, which helps when testing. iodined will start a virtual interface,
|
2006-11-18 18:26:39 +02:00
|
|
|
and also start listening for DNS queries on UDP port 53. Either enter a
|
|
|
|
password on the commandline (-P pass) or after the server has started. Now
|
|
|
|
everything is ready for the client.
|
2006-06-23 11:54:47 +03:00
|
|
|
|
2006-06-23 14:38:20 +03:00
|
|
|
Client side:
|
|
|
|
All the setup is done, just start iodine. It also takes two
|
|
|
|
arguments, the first is the local relaying DNS server and the second is the
|
|
|
|
domain used (tunnel1.mytunnnel.com). If DNS queries are allowed to any
|
|
|
|
computer, you can use the tunnel endpoint (example: 10.15.213.99 or
|
|
|
|
tunnel1host.mytunnel.com) as the first argument. The tunnel interface will get
|
2006-11-18 18:26:39 +02:00
|
|
|
an IP close to the servers (in this case 192.168.99.2) and a suitable MTU.
|
|
|
|
Enter the same password as on the server either by argument or after the client
|
|
|
|
has started. Now you should be able to ping the other end of the tunnel from
|
|
|
|
either side.
|
2006-06-23 11:54:47 +03:00
|
|
|
|
|
|
|
|
2006-06-23 14:38:20 +03:00
|
|
|
MISC. INFO:
|
|
|
|
|
|
|
|
Try experimenting with the MTU size (-m option) to get maximum bandwidth. It is
|
|
|
|
set to 1024 by default, which seems to work with most DNS servers. If you have
|
2007-06-07 21:06:07 +03:00
|
|
|
problems, try setting it to 220 as this ensures all packets to be < 512 bytes.
|
|
|
|
Some DNS servers enforce a 512 byte packet limit, and this is probably the case
|
|
|
|
if you can ping through the tunnel but not login via SSH.
|
2006-06-23 14:38:20 +03:00
|
|
|
|
|
|
|
If you have problems, try inspecting the traffic with network monitoring tools
|
|
|
|
and make sure that the relaying DNS server has not cached the response. A
|
|
|
|
cached error message could mean that you started the client before the server.
|
|
|
|
|
2006-11-02 08:38:16 +02:00
|
|
|
The upstream data is sent gzipped encoded with Base32. DNS protocol allows
|
2006-06-23 14:38:20 +03:00
|
|
|
one query per packet, and one query can be max 256 chars. Each domain name part
|
|
|
|
can be max 63 chars. So your domain name and subdomain should be as short as
|
|
|
|
possible to allow maximum throughput.
|
|
|
|
|
|
|
|
|
2006-11-05 15:18:57 +02:00
|
|
|
TIPS & TRICKS:
|
|
|
|
|
|
|
|
If your port 53 is taken on a specific interface by an application that does
|
|
|
|
not use it, use -p on iodined to specify an alternate port (like -p 5353) and
|
|
|
|
use for instance iptables (on Linux) to forward the traffic:
|
|
|
|
iptables -t nat -A PREROUTING -i eth0 -p udp --dport 53 -j DNAT --to :5353
|
|
|
|
(Sent in by Tom Schouten)
|
|
|
|
|
|
|
|
|
2006-06-23 14:38:20 +03:00
|
|
|
PORTABILITY:
|
2006-06-23 11:54:47 +03:00
|
|
|
|
2007-03-21 08:43:22 +02:00
|
|
|
iodine has been tested on Linux (arm, ia64, x86, AMD64 and SPARC64), FreeBSD
|
2007-06-09 21:30:27 +03:00
|
|
|
(ia64, x86), OpenBSD (x86), NetBSD (x86) and MacOS X (ppc and x86, with
|
2006-08-25 19:17:04 +03:00
|
|
|
http://www-user.rhrk.uni-kl.de/~nissler/tuntap/). It should work on other
|
2006-11-08 01:12:02 +02:00
|
|
|
unix-like systems as well that has TUN/TAP tunneling support (after some
|
|
|
|
patching). Let us know if you get it to run on other platforms.
|
2006-06-23 11:54:47 +03:00
|
|
|
|
|
|
|
|
|
|
|
THE NAME:
|
|
|
|
|
|
|
|
The name iodine was chosen since it starts with IOD (IP Over DNS) and since
|
2006-06-23 14:38:20 +03:00
|
|
|
iodine has atomic number 53, which happens to be the DNS port number.
|
2006-06-23 11:54:47 +03:00
|
|
|
|
|
|
|
|
2006-08-13 22:18:35 +03:00
|
|
|
THANKS:
|
|
|
|
|
|
|
|
- To kuxien for FreeBSD and OS X testing
|
2006-11-02 08:38:16 +02:00
|
|
|
- To poplix for code audit
|
2006-08-13 22:18:35 +03:00
|
|
|
|
|
|
|
|
2006-06-23 11:54:47 +03:00
|
|
|
AUTHORS & LICENSE:
|
|
|
|
|
2007-03-21 02:00:27 +02:00
|
|
|
Copyright (c) 2006-2007 Bjorn Andersson <flex@kryo.se>, Erik Ekman <yarrick@kryo.se>
|
2006-06-23 11:54:47 +03:00
|
|
|
|
2006-06-23 14:38:20 +03:00
|
|
|
Permission to use, copy, modify, and distribute this software for any purpose
|
|
|
|
with or without fee is hereby granted, provided that the above copyright notice
|
|
|
|
and this permission notice appear in all copies.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
|
|
|
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
|
|
PERFORMANCE OF THIS SOFTWARE.
|
2006-11-18 18:08:47 +02:00
|
|
|
|
|
|
|
|
2007-03-21 08:40:53 +02:00
|
|
|
MD5 implementation by L. Peter Deutsch (license and source in src/md5.[ch])
|
2006-11-18 18:08:47 +02:00
|
|
|
Copyright (C) 1999, 2000, 2002 Aladdin Enterprises. All rights reserved.
|