On Sat, Feb 18, 2012 at 10:18:16AM -0500, Donald Pearson wrote: > Oh I never meant for the script to retrieve that information. That's > something you look up first and define directly in the script.
True, but in the future I might want to add some pre-canned tinc-up/down
scripts to tinc that do this without the user having to edit them first.
> But I did find this with some googling.
>
> @For /f "tokens=3" %%* in (
> 'route.exe print ^|findstr "\<0.0.0.0\>"'
> ) Do @Set "DefaultGateway=%%*"
>
> You can then call %DefaultGateway%.
Oh, that's great, thanks!
> So the only other piece you would need for this to be more universal is a
> way to determine what the remote Tinc server's WAN IP is. You could
> possibly write something that would read the hostfile, in which case you
> would execute this script with a hostfile input, do something similar to
> the snippet above to extract the remote hostname or IP and set that to
> maybe RemoteTinc. Or maybe there's a more direct way in tinc-up?
>
> So.. route ADD %RemoteTinc% MASK 255.255.255.255 %DefaultGateway%
Tinc does know the remote node's WAN IP, and this is already exposed as
%REMOTEADDRESS%.
--
Met vriendelijke groet / with kind regards,
Guus Sliepen <[email protected]>
signature.asc
Description: Digital signature
_______________________________________________ tinc mailing list [email protected] http://www.tinc-vpn.org/cgi-bin/mailman/listinfo/tinc
