Automatic route add/del instead of supernetting

Guus Sliepen guus at tinc-vpn.org
Wed Aug 31 18:55:21 CEST 2005


On Mon, Aug 29, 2005 at 03:53:06PM +0200, Holger Zuleger wrote:

> So I will give the subnet-up/down script a try. But for the second part
> of my question (host route for every node pointing to the external
> device) there is currently no solution, right?

The tinc daemon passes some information to the scripts via environment
variables. One of them, that is also passed to the subnet-up/subnet-down
script is REMOTEADDRESS, that is set to the address of the node that
owns the subnet. So you can do something like this in subnet-up:

#!/bin/sh
ip route add $SUBNET dev $INTERFACE
ip route add $REMOTEADDRESS dev eth0

Of course this assumes that $SUBNET is larger than a single address. You
can also use the REMOTEPORT environment variable if you want, you'll
need iptables fwmark or the advanced routing options to be able to route
based on port numbers, but it is possible.

-- 
Met vriendelijke groet / with kind regards,
    Guus Sliepen <guus at sliepen.eu.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://brouwer.uvt.nl/pipermail/tinc-devel/attachments/20050831/92942901/attachment.pgp


More information about the tinc-devel mailing list