New Update - Zero Tier
I recently discovered the great service Zero Tier. Luckily, there already is an Addon for Hassio
My goal is to replace my VPN (from Unifi) with the ZeroTier solution. However, i do not know if its possible to install ZeroTier on my Unifi Gear (USG). Therefore i needed the possibility for my Hassio Zero Tier to route all traffic from all my LANs (and VLANs) to my ZeroTier Network.
By default, this is not working and i was reading a lot of different things that are required. I tried setting up firewall rules on my unifi gear but nothing worked. Finally i found a great post explaining how to “bridge” the networks.
https://www.reddit.com/r/zerotier/comments/9714a2/easy_way_of_bridging_lan_for_remote_access/
So basically, we need to adjust the IP Tables. I used the same method as in my post above via using the terminal addon. However for IP Tables the terminal addon even works when protection mode is enabled.
So first i checked my current iptables with this command:
iptables -L
then i added my network and all the VLANs: (enp2s0 = NIC ID for my LAN Network. ztc**** = NIC ID for my ZeroTier Lan.) You can find it easily via
ncmli connection
iptables -t nat -A POSTROUTING -o enp2s0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o enp2s0.10 -j MASQUERADE
iptables -t nat -A POSTROUTING -o enp2s0.20 -j MASQUERADE
iptables -t nat -A POSTROUTING -o enp2s0.30 -j MASQUERADE
iptables -A FORWARD -i enp2s0 -o ztc****** -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i enp2s0.10 -o ztc****** -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i enp2s0.20 -o ztc****** -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i enp2s0.30 -o ztc****** -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i ztc****** -o enp2s0 -j ACCEPT
iptables -A FORWARD -i ztc****** -o enp2s0.10 -j ACCEPT
iptables -A FORWARD -i ztc****** -o enp2s0.20 -j ACCEPT
iptables -A FORWARD -i ztc****** -o enp2s0.30 -j ACCEPT
Now it is time to also configure the Zero Tier network. So simply login to your zerotier network website https://my.zerotier.com/
In “Managed Routes” you need to add for every LAN or VLAN to the “Destination” side and on the “via” side you add the ZeroTier IP of the Hassio Addon.
This can look like this in the end:
And with this its done. I now can ping and access all of my Lan (& VLAN) devices via ZeroTier.