subnet-down

Guus Sliepen guus at tinc-vpn.org
Wed Mar 22 07:51:23 CET 2017


On Tue, Mar 21, 2017 at 06:51:37PM +0100, albi at life.de wrote:

> We run tinc in router mode on over 10 server.
> Some server announce the same subnet.
> I can add routing with subnet-up and remove routing with subnet-down. But if I do this, my routing will be removed when
> only one anncounce comes in, even there is an other server who still has the routing to the same network.
> Is it possible to run subnet-down only it the last announce to a subnet is going down?

Currently there's nothing in tinc that makes this easy. There are two
possible workaround:

1. Use different weights for the otherwise identical Subnets, and ensure
   you pass that along to the route up/down commands so the kernel can also
   distinguish them.

2. Do some form of reference counting yourself. An easy way from a shell
   script is to just touch/rm files. An example subnet-up script:

#!/bin/sh
DIR=`echo $SUBNET | tr / _`
mkdir -p $DIR
touch $DIR/$NODE
ip route add ...

The corresponding down script:

#!/bin/sh
DIR=`echo $SUBNET | tr / _`
rm $DIR/$NODE
if [ -z "`ls $DIR`" ]; then
  ip route del ...
fi

-- 
Met vriendelijke groet / with kind regards,
     Guus Sliepen <guus at tinc-vpn.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://www.tinc-vpn.org/pipermail/tinc/attachments/20170322/d19f3371/attachment.sig>


More information about the tinc mailing list