| 1 | .\" groff -man -Tascii iodine.8 |
|---|
| 2 | .TH IODINE 8 "JUL 2008" "User Manuals" |
|---|
| 3 | .SH NAME |
|---|
| 4 | iodine, iodined \- tunnel IPv4 over DNS |
|---|
| 5 | .SH SYNOPSIS |
|---|
| 6 | .B iodine [-v] |
|---|
| 7 | |
|---|
| 8 | .B iodine [-h] |
|---|
| 9 | |
|---|
| 10 | .B iodine [-f] [-u |
|---|
| 11 | .I user |
|---|
| 12 | .B ] [-P |
|---|
| 13 | .I password |
|---|
| 14 | .B ] [-m |
|---|
| 15 | .I fragsize |
|---|
| 16 | .B ] [-t |
|---|
| 17 | .I chrootdir |
|---|
| 18 | .B ] [-d |
|---|
| 19 | .I device |
|---|
| 20 | .B ] [-m |
|---|
| 21 | .I fragsize |
|---|
| 22 | .B ] [-z |
|---|
| 23 | .I context |
|---|
| 24 | .B ] |
|---|
| 25 | .B [ |
|---|
| 26 | .I nameserver |
|---|
| 27 | .B ] |
|---|
| 28 | .I topdomain |
|---|
| 29 | |
|---|
| 30 | .B iodined [-v] |
|---|
| 31 | |
|---|
| 32 | .B iodined [-h] |
|---|
| 33 | |
|---|
| 34 | .B iodined [-c] [-s] [-f] [-D] [-u |
|---|
| 35 | .I user |
|---|
| 36 | .B ] [-t |
|---|
| 37 | .I chrootdir |
|---|
| 38 | .B ] [-d |
|---|
| 39 | .I device |
|---|
| 40 | .B ] [-m |
|---|
| 41 | .I mtu |
|---|
| 42 | .B ] [-l |
|---|
| 43 | .I listen_ip |
|---|
| 44 | .B ] [-p |
|---|
| 45 | .I port |
|---|
| 46 | .B ] [-n |
|---|
| 47 | .I external ip |
|---|
| 48 | .B ] [-b |
|---|
| 49 | .I dnsport |
|---|
| 50 | .B ] [-P |
|---|
| 51 | .I password |
|---|
| 52 | .B ] [-z |
|---|
| 53 | .I context |
|---|
| 54 | .B ] |
|---|
| 55 | .I tunnel_ip |
|---|
| 56 | .B [ |
|---|
| 57 | .I /netmask |
|---|
| 58 | .B ] |
|---|
| 59 | .I topdomain |
|---|
| 60 | .SH DESCRIPTION |
|---|
| 61 | .B iodine |
|---|
| 62 | lets you tunnel IPv4 data through a DNS |
|---|
| 63 | server. This can be useful in situations where Internet access is firewalled, |
|---|
| 64 | but DNS queries are allowed. It needs a TUN/TAP device to operate. The |
|---|
| 65 | bandwidth is asymmetrical with limited upstream and up to 1 Mbit/s downstream. |
|---|
| 66 | .B iodine |
|---|
| 67 | is the client application, |
|---|
| 68 | .B iodined |
|---|
| 69 | is the server. |
|---|
| 70 | .SH OPTIONS |
|---|
| 71 | .SS Common Options: |
|---|
| 72 | .TP |
|---|
| 73 | .B -v |
|---|
| 74 | Print version info and exit. |
|---|
| 75 | .TP |
|---|
| 76 | .B -h |
|---|
| 77 | Print usage info and exit. |
|---|
| 78 | .TP |
|---|
| 79 | .B -f |
|---|
| 80 | Keep running in foreground. |
|---|
| 81 | .TP |
|---|
| 82 | .B -u user |
|---|
| 83 | Drop privileges and run as user 'user' after setting up tunnel. |
|---|
| 84 | .TP |
|---|
| 85 | .B -t chrootdir |
|---|
| 86 | Chroot to 'chrootdir' after setting up tunnel. |
|---|
| 87 | .TP |
|---|
| 88 | .B -d device |
|---|
| 89 | Use the TUN device 'device' instead of the normal one, which is dnsX on Linux |
|---|
| 90 | and otherwise tunX. |
|---|
| 91 | .TP |
|---|
| 92 | .B -P password |
|---|
| 93 | Use 'password' to authenticate. If not used, |
|---|
| 94 | .B stdin |
|---|
| 95 | will be used as input. Only the first 32 characters will be used. |
|---|
| 96 | .TP |
|---|
| 97 | .B -z context |
|---|
| 98 | Apply SELinux 'context' after initialization. |
|---|
| 99 | .SS Client Options: |
|---|
| 100 | .TP |
|---|
| 101 | .B -m fragsize |
|---|
| 102 | Maximum downstream fragsize. Not setting this will cause the client to probe |
|---|
| 103 | the maximum accepted downstream packet size. |
|---|
| 104 | .SS Server Options: |
|---|
| 105 | .TP |
|---|
| 106 | .B -c |
|---|
| 107 | Disable checks on client IP on all incoming requests. |
|---|
| 108 | .TP |
|---|
| 109 | .B -s |
|---|
| 110 | Don't try to configure IP address or MTU. This should only be used if |
|---|
| 111 | you have already configured the device that will be used. |
|---|
| 112 | .TP |
|---|
| 113 | .B -D |
|---|
| 114 | Increase debug level. Level 1 prints info about each RX/TX packet. |
|---|
| 115 | .TP |
|---|
| 116 | .B -m mtu |
|---|
| 117 | Set 'mtu' as mtu size for the tunnel device. This will be sent to the client |
|---|
| 118 | on connect, and the client will use the same mtu. |
|---|
| 119 | .TP |
|---|
| 120 | .B -l listen_ip |
|---|
| 121 | Make the server listen only on 'listen_ip' instead of on 0.0.0.0 for incoming |
|---|
| 122 | connections. |
|---|
| 123 | .TP |
|---|
| 124 | .B -p port |
|---|
| 125 | Make the server listen on 'port' instead of 53 for traffic. |
|---|
| 126 | .B Note: |
|---|
| 127 | You must make sure the dns requests are forwarded to this port yourself. |
|---|
| 128 | .TP |
|---|
| 129 | .B -n external ip |
|---|
| 130 | The IP address to return in NS responses. Default is to return the address used |
|---|
| 131 | as destination in the query. |
|---|
| 132 | .TP |
|---|
| 133 | .B -b dnsport |
|---|
| 134 | If this port is specified, all incoming requests not inside the tunnel domain |
|---|
| 135 | will be forwarded to this port on localhost, to be handled by a real dns. |
|---|
| 136 | .SS Client Arguments: |
|---|
| 137 | .TP |
|---|
| 138 | .B nameserver |
|---|
| 139 | The nameserver to use to relay the dns traffic. This can be any relaying |
|---|
| 140 | nameserver or the ip number of the server running iodined if reachable. |
|---|
| 141 | This argument is optional, and if not specified a nameserver will be read |
|---|
| 142 | from the |
|---|
| 143 | .I /etc/resolv.conf |
|---|
| 144 | file. |
|---|
| 145 | .TP |
|---|
| 146 | .B topdomain |
|---|
| 147 | The dns traffic will be sent as querys of type NULL for subdomains under |
|---|
| 148 | \'topdomain'. This is normally a subdomain to a domain you own. Use a short |
|---|
| 149 | domain name to get better throughput. If |
|---|
| 150 | .B nameserver |
|---|
| 151 | is the iodined server, then the topdomain can be chosen freely. This argument |
|---|
| 152 | must be the same on both the client and the server. |
|---|
| 153 | .SS Server Arguments: |
|---|
| 154 | .TP |
|---|
| 155 | .B tunnel_ip[/netmask] |
|---|
| 156 | This is the servers ip address on the tunnel interface. The client will be |
|---|
| 157 | given the next ip number in the range. It is recommended to use the |
|---|
| 158 | 10.0.0.0 or 172.16.0.0 ranges. The default netmask is /27, can be overriden |
|---|
| 159 | by specifying it here. Using a smaller network will limit the number of |
|---|
| 160 | concurrent users. |
|---|
| 161 | .TP |
|---|
| 162 | .B topdomain |
|---|
| 163 | The dns traffic will is expected to be sent as querys of type NULL for |
|---|
| 164 | subdomains under 'topdomain'. This is normally a subdomain to a domain you |
|---|
| 165 | own. Use a short domain name to get better throughput. This argument must be |
|---|
| 166 | the same on both the client and the server. |
|---|
| 167 | .SH EXAMPLES |
|---|
| 168 | .SS Quickstart: |
|---|
| 169 | .TP |
|---|
| 170 | Try it out within your own LAN! Follow these simple steps: |
|---|
| 171 | .TP |
|---|
| 172 | - On your server, run: ./iodined \-f 10.0.0.1 test.asdf |
|---|
| 173 | (If you already use the 10.0.0.0 network, use another internal net like |
|---|
| 174 | 172.16.0.0) |
|---|
| 175 | .TP |
|---|
| 176 | - Enter a password |
|---|
| 177 | .TP |
|---|
| 178 | - On the client, run: ./iodine \-f 192.168.0.1 test.asdf |
|---|
| 179 | (Replace 192.168.0.1 with the server's ip address) |
|---|
| 180 | .TP |
|---|
| 181 | - Enter the same password |
|---|
| 182 | .TP |
|---|
| 183 | - Now the client has the tunnel ip 10.0.0.2 and the server has 10.0.0.1 |
|---|
| 184 | .TP |
|---|
| 185 | - Try pinging each other through the tunnel |
|---|
| 186 | .TP |
|---|
| 187 | - Done! :) |
|---|
| 188 | .TP |
|---|
| 189 | To actually use it through a relaying nameserver, see below. |
|---|
| 190 | .SS Full setup: |
|---|
| 191 | |
|---|
| 192 | .TP |
|---|
| 193 | .B Server side: |
|---|
| 194 | To use this tunnel, you need control over a real domain (like mytunnel.com), |
|---|
| 195 | and a server with a public IP number. If the server already runs a DNS |
|---|
| 196 | server, change the listening port and then use the \-b option to let |
|---|
| 197 | iodined forward the DNS requests. Then, delegate a subdomain |
|---|
| 198 | (say, tunnel1.mytunnel.com) to the server. If you use BIND for the domain, |
|---|
| 199 | add these lines to the zone file (replace 10.15.213.99 with your server ip): |
|---|
| 200 | |
|---|
| 201 | .nf |
|---|
| 202 | tunnel1host IN A 10.15.213.99 |
|---|
| 203 | tunnel1 IN NS tunnel1host.mytunnel.com. |
|---|
| 204 | .fi |
|---|
| 205 | |
|---|
| 206 | Now any DNS querys for domains ending with tunnel1.mytunnnel.com will be sent |
|---|
| 207 | to your server. Start iodined on the server. The first argument is the tunnel |
|---|
| 208 | IP address (like 192.168.99.1) and the second is the assigned domain (in this |
|---|
| 209 | case tunnel1.mytunnel.com). The \-f argument will keep iodined running in the |
|---|
| 210 | foreground, which helps when testing. iodined will start a virtual interface, |
|---|
| 211 | and also start listening for DNS queries on UDP port 53. Either enter a |
|---|
| 212 | password on the commandline (\-P pass) or after the server has started. Now |
|---|
| 213 | everything is ready for the client. |
|---|
| 214 | .TP |
|---|
| 215 | .B Client side: |
|---|
| 216 | All the setup is done, just start iodine. It also takes two |
|---|
| 217 | arguments, the first is the local relaying DNS server and the second is the |
|---|
| 218 | domain used (tunnel1.mytunnnel.com). If DNS queries are allowed to any |
|---|
| 219 | computer, you can use the tunnel endpoint (example: 10.15.213.99 or |
|---|
| 220 | tunnel1host.mytunnel.com) as the first argument. The tunnel interface will get |
|---|
| 221 | an IP close to the servers (in this case 192.168.99.2) and a suitable MTU. |
|---|
| 222 | Enter the same password as on the server either by argument or after the client |
|---|
| 223 | has started. Now you should be able to ping the other end of the tunnel from |
|---|
| 224 | either side. |
|---|
| 225 | .TP |
|---|
| 226 | .B Routing: |
|---|
| 227 | The normal case is to route all traffic through the DNS tunnel. To do this, first |
|---|
| 228 | add a route to the nameserver you use with the default gateway as gateway. Then |
|---|
| 229 | replace the default gateway with the servers IP address within the DNS tunnel, |
|---|
| 230 | and configure the server to do NAT. |
|---|
| 231 | .TP |
|---|
| 232 | .B Troubleshooting: |
|---|
| 233 | Use the \-D option on the server to show received and sent queries, or a |
|---|
| 234 | tool like Wireshark/tcpdump. The iodined server replies to NS requests sent for |
|---|
| 235 | subdomains of the tunnel domain. If your domain is tunnel.com, send a NS |
|---|
| 236 | request for foo.tunnel.com to see if the delegation works. dig is a good tool |
|---|
| 237 | for this: dig \-t NS foo123.tunnel.com |
|---|
| 238 | .TP |
|---|
| 239 | .B MTU issues: |
|---|
| 240 | These issues should be solved now, with automatic fragmentation of downstream |
|---|
| 241 | packets. There should be no need to set the MTU explicitly on the server. |
|---|
| 242 | .SH BUGS |
|---|
| 243 | File bugs at http://dev.kryo.se/iodine/ |
|---|
| 244 | .SH AUTHORS |
|---|
| 245 | Erik Ekman <yarrick@kryo.se> and Bjorn Andersson <flex@kryo.se> |
|---|