In my home network, I have two routers.. my main internet router (192.168.0.1
) and a machine that routes certain networks over a different connection (192.168.0.78
).
On my Mac, I statically configure the networks that I need to reach to use the machine 192.168.0.78
,
e.g.
route -n add -host 10.11.10.25 192.168.0.78
I'm now using Zerotier to access machines in my homenetwork when I'm on the road.
Zerotier is installed on a machine at home that does NAT, e.g.
Local network IP: 192.168.0.160
Zerotier-IP: 10.144.40.10
On that machine (running Linux) I have the following script enabling NAT/IP-Forwarding:
PHY_IFACE=eth2
ZT_IFACE=ztbtotejk
iptables -t nat -A POSTROUTING -o $PHY_IFACE -j MASQUERADE
iptables -A FORWARD -i $PHY_IFACE -o $ZT_IFACE -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i $ZT_IFACE -o $PHY_IFACE -j ACCEPT
I've configured Zerotier to have a managed route for
192.168.0.78
via 10.144.40.10
I can now ssh
from everywhere to the machine 192.168.0.78
However, routing does not work
ping 10.11.10.25
PING 10.11.10.25 (10.11.10.25): 56 data bytes
ping: sendto: Network is unreachable
Request timeout for icmp_seq 0
traceroute 10.11.10.25
traceroute to 10.11.10.25 (10.11.10.25), 64 hops max, 52 byte packets
1 *traceroute: sendto: Network is unreachable
traceroute: wrote 10.11.10.25 52 chars, ret=-1
*traceroute: sendto: Network is unreachable
any help greatly appreciated!