zerotier.is
AdLuoboyunAn account comes with 1 GB of trial traffic for 24 hours, used with Clash / MihomoPays by Alipay, WeChat, cryptoGet the trialLuoboyun: 1 GB on registrationFor 24 hours, Alipay / WeChat / cryptoGet the trialAd
  1. Home
  2. How to
  3. Reach the whole home

Reach the whole home

Put a Linux machine with ZeroTier at home as a gateway and reach the NAS, printer and camera without clients. Route, forwarding and iptables in full.

The idea

A Linux machine that is always on sits in both the home LAN and the ZeroTier network and forwards for everyone.

One gateway joins both sides

A route in the console

Under Managed Routes put the home subnet as the destination and the gateway's ZeroTier address as Via. The documentation advises one bit wider: for 192.168.1.0/24 write 192.168.0.0/23, so that devices at home prefer the local network.

The subnet planner works it out.

On the gateway

Forwarding on
echo 'net.ipv4.ip_forward=1' | sudo tee /etc/sysctl.d/99-zt.conf
sudo sysctl -p /etc/sysctl.d/99-zt.conf
With your own adapter names
PHY=eth0; ZT=zt7nnig26
sudo iptables -t nat -A POSTROUTING -o $PHY -j MASQUERADE
sudo iptables -A FORWARD -i $PHY -o $ZT -m state --state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i $ZT -o $PHY -j ACCEPT
Keep the rules after a restart
sudo apt install iptables-persistent
sudo netfilter-persistent save

Try it

Turn off Wi-Fi on the phone and open your router's address over mobile data.

What you seeLook at
Gateway yes, others noForwarding or iptables
Not even the gatewayAuthorization or the route
Slower when at homeThe mask is not one bit wider
What if the router can run ZeroTier?

Better there; one hop less.

The outside network has the same subnet?

They clash. Change the one at home to something unusual.

Up nextBrowse through another device

Pages nearby

Marks: ZeroTier access home network, ZeroTier managed routes, reach NAS remotely