Hi, Lars

Thanks for your suggestion, will give it a try later to see how it performs.

But, yesterday, I did a below test:

A ConnectTo B and C, B ConnectTo D, C ConnectTo D; All nodes turned 
"IndirectData" on in its host configuration, so the tunnel only follow 
metacomnection instead of direct connect.

D announced default route by having the Subnet = 0.0.0.0/0 statement in its 
host config

The tunnel next hop for A set to C(for Mac, to config the tunnel interface, you 
have to specify the next hop)

And I point A's default route next hop to C as well.

In this case, A's traffic route to Internet is go through C to D to internet, 
but If I add Subnet =0.0.0.0/0 on B, the traffic seems go directly from A to B 
to internet.

Since A have both ConnectTo to B and C(To D through C), and the default gateway 
set to C, why A chose B instead of D's default route?

At this moment, if I shutdown B's tinc daemon, the traffic path for A to 
Internet return back to: to C and the to D

During the whole process, A's default gateway point to C.

Sent from iPhone

> 在 2017年5月2日,上午4:37,Lars Kruse <[email protected]> 写道:
> 
> Hello,
> 
> 
> Am Mon, 1 May 2017 23:35:53 +0800
> schrieb Bright Zhao <[email protected]>:
> 
>> 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
> _______________________________________________
> tinc mailing list
> [email protected]
> https://www.tinc-vpn.org/cgi-bin/mailman/listinfo/tinc
_______________________________________________
tinc mailing list
[email protected]
https://www.tinc-vpn.org/cgi-bin/mailman/listinfo/tinc

Reply via email to