For Windows you can do this through the command prompt (run as administrator in Vista & Win7).
First get the current default gateway. Enter the command "route print" Look for the line where Network Destination and Netmask are 0.0.0.0. The gateway listed on that same line is the current default gateway. The first change is to set a static route to the internet IP of the remote Tinc participant, using your "normal" default gateway as your next hop using the "route ADD" command. This will enable us to change our default gateway, without breaking the necessary route to keep the VPN alive. Example: route ADD <IP address of remote Tinc participant> MASK 255.255.255.255 <IP of your normal default gateway> Example: route ADD 173.66.67.97 MASK 255.255.255.255 192.168.0.1 Now you change your default gateway to the VPN IP address of the remote Tinc participant. If for example your VPN network is 10.10.10.0/30. You may have the address 10.10.10.1 while the remote side has the address 10.10.10.2. The remote address is what we need. Changing the default gateway is done with the "route CHANGE" command. Example: route CHANGE 0.0.0.0 MASK 0.0.0.0 <VPN IP address of the remote Tinc participant> Example: route CHANGE 0.0.0.0 MASK 0.0.0.0 10.10.10.2 You will now be using the remote VPN participant as your default gateway to the internet. The last thing to be verify is that the remote participant is configured to route traffic, so be sure to enable IP routing on the remote node and configure any necessary firewalls. Scripting this would simply be adding these commands to a plain text file with the ".bat" extension. Windows will recognize it as executable by default. On Sun, May 8, 2011 at 6:51 AM, Guus Sliepen <[email protected]> wrote: > On Mon, May 02, 2011 at 05:33:57PM +0200, Benjamin Henrion wrote: > >> On Mon, May 2, 2011 at 5:31 PM, ZioPRoTo (Saverio Proto) >> <[email protected]> wrote: >> > Yes u can. >> >> But Tinc does not have all the right scripts for each platform to do >> that without any pain. > > Indeed, only for Linux there are example scripts on the wiki: > > http://tinc-vpn.org/examples/redirect-gateway/ > > If anyone knows how to do something similar on *BSD, MacOS/X or Windows, let > me > know. > > -- > Met vriendelijke groet / with kind regards, > Guus Sliepen <[email protected]> > > _______________________________________________ > tinc mailing list > [email protected] > http://www.tinc-vpn.org/cgi-bin/mailman/listinfo/tinc > > _______________________________________________ tinc mailing list [email protected] http://www.tinc-vpn.org/cgi-bin/mailman/listinfo/tinc
