mirror of
https://github.com/yarrick/iodine.git
synced 2024-12-22 21:33:33 +02:00
Add tip from Tom, add port selection on iodined
This commit is contained in:
parent
20c8aa56db
commit
125f6c82e6
3 changed files with 20 additions and 5 deletions
|
@ -7,7 +7,7 @@ iodine - IP over DNS is now easy
|
|||
|
||||
CHANGES:
|
||||
|
||||
2006-11-06: 0.3.3
|
||||
2006-11-05: 0.3.3
|
||||
- Fixed possible buffer overflow
|
||||
(Found by poplix)
|
||||
- Reworked dns hostname encoding
|
||||
|
|
9
README
9
README
|
@ -73,6 +73,15 @@ can be max 63 chars. So your domain name and subdomain should be as short as
|
|||
possible to allow maximum throughput.
|
||||
|
||||
|
||||
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)
|
||||
|
||||
|
||||
PORTABILITY:
|
||||
|
||||
iodine has been tested on Linux (x86 and SPARC64), FreeBSD (x86), OpenBSD (x86),
|
||||
|
|
14
iodined.c
14
iodined.c
|
@ -168,7 +168,7 @@ static void
|
|||
usage() {
|
||||
extern char *__progname;
|
||||
|
||||
printf("Usage: %s [-v] [-h] [-f] [-u user] [-t chrootdir] [-d device] [-m mtu] [-l ip address to listen on] "
|
||||
printf("Usage: %s [-v] [-h] [-f] [-u user] [-t chrootdir] [-d device] [-m mtu] [-l ip address to listen on] [-p port]"
|
||||
"tunnel_ip topdomain\n", __progname);
|
||||
exit(2);
|
||||
}
|
||||
|
@ -178,7 +178,7 @@ help() {
|
|||
extern char *__progname;
|
||||
|
||||
printf("iodine IP over DNS tunneling server\n");
|
||||
printf("Usage: %s [-v] [-h] [-f] [-u user] [-t chrootdir] [-d device] [-m mtu] [-l ip address to listen on] "
|
||||
printf("Usage: %s [-v] [-h] [-f] [-u user] [-t chrootdir] [-d device] [-m mtu] [-l ip address to listen on] [-p port]"
|
||||
"tunnel_ip topdomain\n", __progname);
|
||||
printf(" -v to print version info and exit\n");
|
||||
printf(" -h to print this help and exit\n");
|
||||
|
@ -188,6 +188,7 @@ help() {
|
|||
printf(" -d device to set tunnel device name\n");
|
||||
printf(" -m mtu to set tunnel device mtu\n");
|
||||
printf(" -l ip address to listen on for incoming dns traffic (default 0.0.0.0)\n");
|
||||
printf(" -p port to listen on for incoming dns traffic (default 53)\n");
|
||||
printf("tunnel_ip is the IP number of the local tunnel interface.\n");
|
||||
printf("topdomain is the FQDN that is delegated to this server.\n");
|
||||
exit(0);
|
||||
|
@ -214,6 +215,7 @@ main(int argc, char **argv)
|
|||
int mtu;
|
||||
struct passwd *pw;
|
||||
in_addr_t listen_ip;
|
||||
int port;
|
||||
|
||||
username = NULL;
|
||||
newroot = NULL;
|
||||
|
@ -221,13 +223,14 @@ main(int argc, char **argv)
|
|||
foreground = 0;
|
||||
mtu = 1024;
|
||||
listen_ip = INADDR_ANY;
|
||||
port = 53;
|
||||
|
||||
packetbuf.len = 0;
|
||||
packetbuf.offset = 0;
|
||||
outpacket.len = 0;
|
||||
q.id = 0;
|
||||
|
||||
while ((choice = getopt(argc, argv, "vfhu:t:d:m:l:")) != -1) {
|
||||
while ((choice = getopt(argc, argv, "vfhu:t:d:m:l:p:")) != -1) {
|
||||
switch(choice) {
|
||||
case 'v':
|
||||
version();
|
||||
|
@ -253,6 +256,9 @@ main(int argc, char **argv)
|
|||
case 'l':
|
||||
listen_ip = inet_addr(optarg);
|
||||
break;
|
||||
case 'p':
|
||||
port = atoi(optarg);
|
||||
break;
|
||||
default:
|
||||
usage();
|
||||
break;
|
||||
|
@ -292,7 +298,7 @@ main(int argc, char **argv)
|
|||
goto cleanup0;
|
||||
if (tun_setip(argv[0]) != 0 || tun_setmtu(mtu) != 0)
|
||||
goto cleanup1;
|
||||
if ((dnsd_fd = open_dns(argv[1], 53, listen_ip)) == -1)
|
||||
if ((dnsd_fd = open_dns(argv[1], port, listen_ip)) == -1)
|
||||
goto cleanup2;
|
||||
|
||||
my_ip = inet_addr(argv[0]);
|
||||
|
|
Loading…
Reference in a new issue