<div dir="ltr"><div>There is no concept of "client" or "server" in tinc. tinc is purely peer-to-peer. "ConnectTo" statements only indicate which node will attempt to establish the initial connection, but once the connection is established, direction does not matter.<br><br></div>It is unclear from your message which node is responsible for which subnet. If X/32 truly belongs to C, then simply set Subnet = X/32 in C's local host file. If you do that, then C will advertise this subnet to the rest of the network, including B and A. There is no need to change anything in B's configuration. tinc will take care of the routing for you, and A will be informed (through the tinc protocol) that the subnet belongs to C, and that any packets meant for X should therefore be sent to C.<br><br>These packets will then be sent directly to C using UDP (tinc is clever and will try various NAT traversal techniques). If that's not possible for any reason, tinc will automatically fall back to relaying packets through B.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On 1 May 2017 at 11:00, Bright Zhao <span dir="ltr"><<a href="mailto:startryst@gmail.com" target="_blank">startryst@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi, Tinc experts<br>
<br>
Diagram as below, A is trying to access host X behind C:<br>
<br>
A >> B >> C — “host X"<br>
<br>
B is the tinc server for A, but also B is the tinc client to connect to C.<br>
<br>
My question is, if I only use one VPN (/etc/tinc/myvpn), then the host configuration for B will be tricky.<br>
<br>
As the tinc server to A, B’s host config (/etc/tinc/myvpn/hosts/B) needs have the Subnet = X/32, which indicate the VPN serve for this host.<br>
But as the tinc client to C, B’s host config shouldn’t include Subnet = X/32, because X/32 is behind C.<br>
<br>
If not direct connection available from A to C, the only way I can figure it out is to setup two VPNs, /etc/tinc/vpn1 and /etc/tinc/vpn2:<br>
<br>
A >> vpn1 >> B >> vpn2 >> C — “host X”<br>
<br>
If so, the /etc/tinc/vpn1/hosts/B can have Subnet =X/32; but the /etc/tinc/vpn2/hosts/B can exclude Subnet =X/32 since it’s the client side for C.<br>
<br>
Let me know if there’s any other simple way to achieve this.<br>
______________________________<wbr>_________________<br>
tinc mailing list<br>
<a href="mailto:tinc@tinc-vpn.org">tinc@tinc-vpn.org</a><br>
<a href="https://www.tinc-vpn.org/cgi-bin/mailman/listinfo/tinc" rel="noreferrer" target="_blank">https://www.tinc-vpn.org/cgi-<wbr>bin/mailman/listinfo/tinc</a><br>
</blockquote></div><br></div>