<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
span.E-MailFormatvorlage17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=DE link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span lang=EN-US>Thank you guys for your answers.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US>&gt; If you only have the nodes behind the
NAT ConnectTo the node with a public IP<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>&gt; address, they will never be able to
discover that they are on the same LAN.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>&gt; However, if you add a &quot;ConnectTo
= Node2&quot; to Node1's tinc.conf, and add<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>&gt; &quot;Address = 192.168.0.102&quot; to
Node1's hosts/Node2 file, then it will make a<o:p></o:p></span></p>

<p class=MsoNormal>&gt; direct connection.<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal><span lang=EN-US>Unfortunately, the nodes get their IP by
DHCP, so a fixed address would not help.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>Setting up a local node behind each router
with a static IP is also not possible, since my nodes are often on-the-go in foreign
networks, where I am unable to set up static addresses by myself.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US>&gt; Tin does no autoconnect to each other,
it does only connect if you set<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>&gt; &quot;connectto&quot; line in
tinc.conf. But tinc does mesh after connect, so all<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>&gt; connections will be announced and
packtes will find destination<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>&gt; automaticly.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US>As far as I understood the documentation, &#8220;connectto&#8221;
is used to connect nodes to each other in order to exchange meta-information,
where each node is located at (IP:PORT).<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>The actual &#8220;meshing&#8221; always
occurs directly between all nodes, unless this is impossible due to firewalls
etc.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>So shouldn&#8217;t it be enough to connect
all nodes to a centralized one (Node3), where they can exchange their address-details
in order to connect diretly to those addresses afterwards?<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US>I have attached a sketch of my issue.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>The upper half shows the physical setup
with 3 nodes, one static and two behind a router.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>The bottom half shows the communication flow
between node1 and node2. The packets follow the line to the NAT-Port, get
passed to the other NAT-Port and back to the target node.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>The dottet line shows the desired flow,
which would be much shorter than going over the router.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US>In my opinion, tinc does not support
multiple endpoints, hence Node3 saves only the publicly visible (NATed) endpoints
for Node1 and Node2.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>The privately visible endpoints in the LAN are
not saved and announced back. Therefore, Node1 and Node2 never know, they are
on the same network.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US>Do you have any advice for me, how to
achieve the desired behavior?<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>I&#8217;d suggest that each node announces
its local endpoint to other nodes on connectto and the other node saves this
endpoint together with the publicly visible one where it sees the packets
coming from.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>That would enable each node to select the &#8220;best&#8221;
endpoint to connect to the other node.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>This selection could either be algorithmic by
calculating the shortest distance to the other endpoint or by trying out and
selecting the one with the lowest round trip time.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US>Best<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US>Daniel<o:p></o:p></span></p>

</div>

</body>

</html>