<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Ah. The solution was trivial.<div class=""><br class=""></div><div class="">On B side, Ubuntu server:</div><div class=""><br class=""></div><div class="">post-up iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE</div><div class=""><br class=""></div><div class="">On my server eth0 doesn't exist it has another name: ens160.</div><div class=""><br class=""></div><div class="">Now it's working.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><div><blockquote type="cite" class=""><div class="">On 25 Mar 2018, at 11:19, Adrián Mihálko <<a href="mailto:adriankoooo@gmail.com" class="">adriankoooo@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="">A side (<a href="http://192.168.2.0/24" class="">192.168.2.0/24</a>):</div><div class=""><br class=""></div><div class="">LEDE router 192.168.2.1 (static route to access remote side <a href="http://192.168.1.0/24" class="">192.168.1.0/24</a> pointing to 192.168.2.100)</div><div class=""><br class=""></div><div class="">Pi Zero with Wireguard (192.168.2.100, WG: 192.168.5.2)</div><div class=""><br class=""></div><div class="">Config:</div><div class=""><br class=""></div><div class="">auto wg0</div><div class="">iface wg0 inet static</div><div class=""> pre-up ip link add dev wg0 type wireguard</div><div class=""> post-up wg setconf wg0 /etc/wireguard/wireguard.conf</div><div class=""> post-up ip link set dev wg0 up</div><div class=""> post-up ip route add <a href="http://192.168.1.0/24" class="">192.168.1.0/24</a> via 192.168.5.1 dev wg0</div><div class=""> post-up iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE</div><div class=""> address 192.168.5.2</div><div class=""> netmask 255.255.255.0</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">B side (<a href="http://192.168.1.0/24" class="">192.168.1.0/24</a>):</div><div class=""><br class=""></div><div class="">Unifi router 192.168.1.1 (static route to access remote side <a href="http://192.168.2.0/24" class="">192.168.2.0/24</a> pointing to 192.168.1.54)</div><div class=""><br class=""></div><div class="">Ubuntu server with Wireguard (192.168.1.54, WG: 192.168.5.1)</div><div class=""><br class=""></div><div class="">Config:</div><div class=""><br class=""></div><div class="">iface wg0 inet static</div><div class=""> pre-up /sbin/ip link add dev wg0 type wireguard</div><div class=""> post-up /usr/bin/wg setconf wg0 /etc/wireguard/wg0.conf</div><div class=""> post-up /sbin/ip route add <a href="http://192.168.2.0/24" class="">192.168.2.0/24</a> via 192.168.5.2 dev wg0</div><div class=""> post-up iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE</div><div class=""> post-down /sbin/ip link del wg0</div><div class=""> address 192.168.5.1</div><div class=""> netmask 255.255.255.0</div><div class=""><br class=""></div><div class="">---</div><div class=""><br class=""></div><div class="">Everything is working great, except that on the "Pi Zero with Wireguard" I can't access/ping remote devices in the <a href="http://192.168.1.0/24" class="">192.168.1.0/24</a> range, only the remote server 192.168.1.54. From any other machine in the same "A side" I am able to access devices in the <a href="http://192.168.1.0/24" class="">192.168.1.0/24</a> range, just from the Pi Zero itself not.</div><div class=""><br class=""></div><div class="">What I am missing here?</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">pi@raspberrypizero:~ $ ping 192.168.1.54</div><div class="">PING 192.168.1.54 (192.168.1.54) 56(84) bytes of data.</div><div class="">64 bytes from <a href="http://192.168.1.54/" class="">192.168.1.54</a>: icmp_seq=1 ttl=64 time=48.6 ms</div><div class="">64 bytes from <a href="http://192.168.1.54/" class="">192.168.1.54</a>: icmp_seq=2 ttl=64 time=134 ms^C</div><div class="">--- 192.168.1.54 ping statistics ---</div><div class="">2 packets transmitted, 2 received, 0% packet loss, time 1002ms</div><div class="">rtt min/avg/max/mdev = 48.671/91.554/134.437/42.883 ms</div><div class="">pi@raspberrypizero:~ $ ping 192.168.1.100</div><div class="">PING 192.168.1.100 (192.168.1.100) 56(84) bytes of data.</div><div class="">^C</div><div class="">--- 192.168.1.100 ping statistics ---</div><div class="">6 packets transmitted, 0 received, 100% packet loss, time 5188ms</div><div class=""><br class=""></div><div class="">pi@raspberrypizero:~ $ traceroute 192.168.1.100</div><div class="">traceroute to 192.168.1.100 (192.168.1.100), 30 hops max, 60 byte packets</div><div class=""> 1 192.168.5.1 (192.168.5.1) 42.279 ms 43.834 ms 44.678 ms</div><div class=""> 2 * * *</div><div class=""> 3 * * *</div><div class=""> 4 * * *</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">---</div><div class=""><br class=""></div><div class="">B side is working great, I am able to ping everything, even from the Ubuntu server.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Regards,</div><div class="">Adrian</div></div>
</div></blockquote></div><br class=""></div></body></html>