<html><body bgcolor="#FFFFFF"><div><span class="Apple-style-span" style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.296875); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); ">El 07/07/2011, a las 13:32, Guus Sliepen <<a href="mailto:guus@tinc-vpn.org">guus@tinc-vpn.org</a>> escribió:</span><br></div><div><br></div><div></div><blockquote type="cite"><div><span>On Thu, Jul 07, 2011 at 01:09:00PM +0200, Loic Dachary wrote:</span><br><span></span><br><blockquote type="cite"><span>I setup tinc on two hosts with IP 192.168.200.102 on the first and IP</span><br></blockquote><blockquote type="cite"><span>192.168.200.101 on the second. And it works. Now I would like to route</span><br></blockquote><blockquote type="cite"><span>packets thru 192.168.200.101 from 192.168.200.102 by adding the</span><br></blockquote><blockquote type="cite"><span>following route:</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>ip route add 10.10.70.0/24 via 192.168.200.101 dev TINCDEVICE</span><br></blockquote><span></span><br><span>Gateway routes do not work as you expect in router mode. The above is</span><br><span>equivalent to the same command without the via part:</span><br><span></span><br><span>ip route add 10.10.70.0/24 dev TINCDEVICE</span><br><span></span><br><span>You can either use Mode = switch, in which case the gateway route will work as</span><br><span>you intended, or you can keep using router mode, but then you have to add</span><br><span>"Subnet = 10.10.70.0/24" to hosts/name_of_second_node, so that tinc will know</span><br><span>that packets with addresses in that Subnet have to be sent to the second node.</span><br><span></span><br><blockquote type="cite"><span>However, when I ping 10.10.70.254 from 192.168.200.102, I see the packet</span><br></blockquote><blockquote type="cite"><span>being sent to TINCDEVICE (tcmpdump)</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>13:04:17.675440 IP 192.168.200.102 > 10.10.70.254: ICMP echo request, id</span><br></blockquote><blockquote type="cite"><span>6201, seq 1, length 64</span><br></blockquote><span></span><br><span>You can see in the tcpdump that there is no mention of "192.168.200.101" in</span><br><span>that packet. The only effect a via statement has is on Ethernet networks, where</span><br><span>ARP will be used to find which MAC address belongs to the gateway address, and</span><br><span>then packets will be sent to that MAC address. Still, it went to the right</span><br><span>interface.</span><br><span></span><br><blockquote type="cite"><span>13:04:17.675467 IP 10.10.70.254 > 192.168.200.102: ICMP net 10.10.70.254</span><br></blockquote><blockquote type="cite"><span>unreachable - unknown, length 92</span><br></blockquote><span></span><br><span>This is tinc complaining it doesn't know about 10.10.70.254.</span><br><span></span><br><span>I hope this helps.</span><br></div></blockquote><br><span class="Apple-style-span" style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.296875); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); "><div>And verify that:</div><div><br></div><div><span class="Apple-style-span" style="font-family: Times; -webkit-tap-highlight-color: rgba(26, 26, 26, 0.292969); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); font-size: medium; color: rgb(64, 32, 10); "><a name="linux-directors"><li><pre># Enables packet forwarding
net.ipv4.ip_forward = 1
</pre><div><br></div></li></a></span><br>Enviado desde mi Móvil</div></span></body></html>