File README.md changed (mode: 100644) (index 06443ef..de1c5ad) |
... |
... |
The -L switch works (almost) the same way it does in SSH. For the uninitiated, - |
54 |
54 |
|
|
55 |
55 |
Alternatively, SSH ProxyCommand mode works too: |
Alternatively, SSH ProxyCommand mode works too: |
56 |
56 |
|
|
57 |
|
ssh -o ProxyCommand='./tuntox -i <ToxID> -P localhost:22' gdr@localhost |
|
|
57 |
|
ssh -o ProxyCommand='./tuntox -i <ToxID> -W localhost:22' gdr@localhost |
58 |
58 |
|
|
59 |
59 |
Fun stuff: [VPN over Tox](VPN.md) |
Fun stuff: [VPN over Tox](VPN.md) |
60 |
60 |
|
|
File VPN.md changed (mode: 100644) (index 73faf4c..7fe339a) |
... |
... |
On the server (where tuntox is already running): |
8 |
8 |
|
|
9 |
9 |
On the client: |
On the client: |
10 |
10 |
|
|
11 |
|
socat -d -d TUN:10.20.30.40/24,up 'SYSTEM:./tuntox -P 127.0.0.1@9876 -i 86e70ffe9f835b12667d296f2df9c307ba1aff06' |
|
|
11 |
|
socat -d -d TUN:10.20.30.40/24,up 'SYSTEM:./tuntox -W 127.0.0.1@9876 -i 86e70ffe9f835b12667d296f2df9c307ba1aff06' |
12 |
12 |
|
|
13 |
13 |
Viola, you have a point-to-point VPN. On client: |
Viola, you have a point-to-point VPN. On client: |
14 |
14 |
|
|
|
... |
... |
Also: inefficient, insecure (requires PermitRootLogin yes on server). |
28 |
28 |
|
|
29 |
29 |
On the client: |
On the client: |
30 |
30 |
|
|
31 |
|
socat -d -d TUN:10.20.30.40/24,up 'SYSTEM:ssh root@localhost -o ProxyCommand=\"./tuntox -P "127.0.0.1:22" -d -i 86e70ffe9f835b12667d296f2df9c307ba1aff06\" socat -d -d - "TUN:10.20.30.41/24,up"' |
|
|
31 |
|
socat -d -d TUN:10.20.30.40/24,up 'SYSTEM:ssh root@localhost -o ProxyCommand=\"./tuntox -W "127.0.0.1:22" -d -i 86e70ffe9f835b12667d296f2df9c307ba1aff06\" socat -d -d - "TUN:10.20.30.41/24,up"' |
32 |
32 |
|
|
33 |
33 |
# ping 10.20.30.41 |
# ping 10.20.30.41 |
34 |
34 |
PING 10.20.30.41 (10.20.30.41) 56(84) bytes of data. |
PING 10.20.30.41 (10.20.30.41) 56(84) bytes of data. |
File main.c changed (mode: 100644) (index 4d211d7..0d2e5e8) |
... |
... |
void help() |
1181 |
1181 |
fprintf(stderr, " -i <toxid> - remote point Tox ID\n"); |
fprintf(stderr, " -i <toxid> - remote point Tox ID\n"); |
1182 |
1182 |
fprintf(stderr, " -L <localport>:<remotehostname>:<remoteport>\n"); |
fprintf(stderr, " -L <localport>:<remotehostname>:<remoteport>\n"); |
1183 |
1183 |
fprintf(stderr, " - forward <remotehostname>:<remoteport> to 127.0.0.1:<localport>\n"); |
fprintf(stderr, " - forward <remotehostname>:<remoteport> to 127.0.0.1:<localport>\n"); |
1184 |
|
fprintf(stderr, " -P <remotehostname>:<remoteport> - forward <remotehostname>:<remoteport> to\n"); |
|
|
1184 |
|
fprintf(stderr, " -W <remotehostname>:<remoteport> - forward <remotehostname>:<remoteport> to\n"); |
1185 |
1185 |
fprintf(stderr, " stdin/stdout (SSH ProxyCommand mode)\n"); |
fprintf(stderr, " stdin/stdout (SSH ProxyCommand mode)\n"); |
1186 |
1186 |
fprintf(stderr, " -p - ping the server from -i and exit\n"); |
fprintf(stderr, " -p - ping the server from -i and exit\n"); |
1187 |
1187 |
fprintf(stderr, " Common:\n"); |
fprintf(stderr, " Common:\n"); |
|
... |
... |
int main(int argc, char *argv[]) |
1237 |
1237 |
} |
} |
1238 |
1238 |
log_printf(L_DEBUG, "Forwarding remote port %d to local port %d\n", remote_port, local_port); |
log_printf(L_DEBUG, "Forwarding remote port %d to local port %d\n", remote_port, local_port); |
1239 |
1239 |
break; |
break; |
1240 |
|
case 'P': |
|
|
1240 |
|
case 'W': |
1241 |
1241 |
/* Pipe forwarding */ |
/* Pipe forwarding */ |
1242 |
1242 |
client_mode = 1; |
client_mode = 1; |
1243 |
1243 |
client_pipe_mode = 1; |
client_pipe_mode = 1; |
1244 |
1244 |
if(parse_pipe_port_forward(optarg, &remote_host, &remote_port) < 0) |
if(parse_pipe_port_forward(optarg, &remote_host, &remote_port) < 0) |
1245 |
1245 |
{ |
{ |
1246 |
|
log_printf(L_ERROR, "Invalid value for -P option - use something like -P 127.0.0.1:22\n"); |
|
|
1246 |
|
log_printf(L_ERROR, "Invalid value for -W option - use something like -W 127.0.0.1:22\n"); |
1247 |
1247 |
exit(1); |
exit(1); |
1248 |
1248 |
} |
} |
1249 |
1249 |
if(min_log_level == L_UNSET) |
if(min_log_level == L_UNSET) |
File scripts/tokssh changed (mode: 100755) (index 0017221..6bdb74d) |
... |
... |
then |
29 |
29 |
# last argument is user@toxid |
# last argument is user@toxid |
30 |
30 |
user=${arruserhost[0]} |
user=${arruserhost[0]} |
31 |
31 |
toxid=${arruserhost[1]} |
toxid=${arruserhost[1]} |
32 |
|
ssh -o ProxyCommand="tuntox -i $toxid -P 127.0.0.1:%p $secret" $args $user@localhost |
|
|
32 |
|
ssh -o ProxyCommand="tuntox -i $toxid -W 127.0.0.1:%p $secret" $args $user@localhost |
33 |
33 |
else |
else |
34 |
34 |
# last argument is just toxid |
# last argument is just toxid |
35 |
|
ssh -o ProxyCommand="tuntox -i $userhost -P 127.0.0.1:%p $secret" $args localhost |
|
|
35 |
|
ssh -o ProxyCommand="tuntox -i $userhost -W 127.0.0.1:%p $secret" $args localhost |
36 |
36 |
fi |
fi |
37 |
37 |
|
|
File util.c changed (mode: 100644) (index b1353b3..4d75fe5) |
... |
... |
int parse_local_port_forward(char *string, int *local_port, char **hostname, int |
114 |
114 |
return 0; |
return 0; |
115 |
115 |
} |
} |
116 |
116 |
|
|
117 |
|
/* Parse the -P parameter */ |
|
|
117 |
|
/* Parse the -W parameter */ |
118 |
118 |
/* 0 = success */ |
/* 0 = success */ |
119 |
119 |
int parse_pipe_port_forward(char *string, char **hostname, int *remote_port) |
int parse_pipe_port_forward(char *string, char **hostname, int *remote_port) |
120 |
120 |
{ |
{ |