Redirect active connections to a OpenVPn tunnel

This forum is for general conversation and user-user networking.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Post Reply
Fhilps
OpenVpn Newbie
Posts: 3
Joined: Thu Oct 27, 2011 9:34 pm

Redirect active connections to a OpenVPn tunnel

Post by Fhilps » Sat Nov 12, 2011 5:13 am

That's my problem.

I have access to the internet through a wifi connection (Host 1 - 192.168.1.101) in my private network 192.168.1.0/24.
The router has an LAN interface 192.168.1.1 and a WAN interface 187.xx.xx.xx.

In this same network there is a host 2 (192.168.1.100) that is running an openvpn server with address 10.4.0.1. This server is in a Windows 7 with redirect-gateway. The forwarding in windows is already perfectly running.

I'd like to start a download from the internet on host 1 and during the download, establish a tunnel to the server and go on the download via tunnel.
The host 1's active connection must be transfered to the tunnel.

Is it possible ?

I need this a lot. Any help ?
Thanks.

User avatar
janjust
Forum Team
Posts: 2703
Joined: Fri Aug 20, 2010 2:57 pm
Location: Amsterdam
Contact:

Re: Redirect active connections to a OpenVPn tunnel

Post by janjust » Sat Nov 12, 2011 10:03 pm

it's not possible to transfer an existing active connection from one connection to another. This has nothing to do with VPNs but with basic TCP/IP networking:

All network connections are based on SRC IP + SRC Port talking to DEST IP + DEST Port
If you change the SRC IP and/or SRC Port then it's a new connection. Unless your download software can do an automatic reconnect you're out of luck

Fhilps
OpenVpn Newbie
Posts: 3
Joined: Thu Oct 27, 2011 9:34 pm

Re: Redirect active connections to a OpenVPn tunnel

Post by Fhilps » Tue Nov 22, 2011 12:24 am

Now a have a new network configuration.

Internet ---------[1] Notebook1 [2]-------[3] Wifi Router [3]----- [4] Cel Android

[1] = cabled real IP
[2] = 192.168.1.1
[3] = 192.168.1.2
[4] = 192.168.1.3

I'd like to establish a tunnel between Android and the real IP of notebook 1, so when Android go to 3G network all traffic arriving in notebook 1 from the internet to 192.168.1.3 (Android) must be forwarded to the Android address in tunnel.

In tunnel notebook 1 has address 10.3.0.1 and Android 10.3.0.2

I tried to use route 192.168.1.3 255.255.255.255 10.3.0.2 in configuration openvpn file in notebook 1.
But when this route is added to routing table I can't get a ping response from Android.

Notebook 1 runs Windows 7
Could this be a limitation of Windows 7 ?

User avatar
Mimiko
Forum Team
Posts: 1564
Joined: Wed Sep 22, 2010 3:18 am

Re: Redirect active connections to a OpenVPn tunnel

Post by Mimiko » Tue Nov 29, 2011 7:07 am

I'd like to establish a tunnel between Android and the real IP of notebook 1, so when Android go to 3G network all traffic arriving in notebook 1 from the internet to 192.168.1.3 (Android) must be forwarded to the Android address in tunnel.
You can't do this, because all trafic from internet will arrive to you public IP, not the unrouted on real internet IP 192.168.1.3. Private ip ranges a dropped on the internet switches.
You have to use a more complex software and de-packet all packets till the very first packet wich may hold the source IP of 192.168.1.3. See the IP standart.

Post Reply