Multiple default gateway from tinc node

Lars Kruse lists at sumpfralle.de
Mon May 1 22:37:59 CEST 2017


Hello,


Am Mon, 1 May 2017 23:35:53 +0800
schrieb Bright Zhao <startryst at gmail.com>:

> If there’re multiple tinc nodes announce default route in their host
> configuration of Subnet = 0.0.0.0/0, how for the remaining nodes to select
> which is the best route to get out?

it is important to understand that tinc only takes care for exchanging metadata
(e.g. "subnet" definitions of available hosts).
Thus it is up to you (and probably your "subnet-up" script) to turn these
information into a routing setup.
Probably the following subnet-up script is suitable for many use-cases:

  #!/bin/sh
  ip route add "$SUBNET" dev "$INTERFACE" metric "$WEIGHT" 2>/dev/null || true

Please note the "$WEIGHT" variable (see "man tinc.conf") - it will take care for
the "priority" of the default gateways.

Cheers,
Lars


More information about the tinc mailing list