ZeroTier and Syncthing

So ZeroTier calls itself a, “smart programmable Ethernet switch for planet Earth” turning my far-flung machines into a giant virtual local network.

Syncthing doesn’t seem to automatically take advantage of this enhanced connectivity. There are no ports to open since all machines on the network treat each other as local but I can see all of my data transfer activity is going over relays and connectivity is intermittent.

Given all machines on this network are assigned from in the 10.147.20.0/24 range, how do I tell Syncthing to route over this net?

You can configure device IPs manually, or tell the ethernet hippies of planet earth to add support for broadcasts/multicasts, as that is what is used for local discovery.

3 Likes

So just to clarify: I would add each individual device IP at 10.147.20.* I expect to sync with to every other device’s Global Discovery Servers?

No, you have to setup explicit IPs, because the network prevents local discovery.

Pardon the ignorance but how would I do this?

You specify tcp://[ip address of the remote device] in the address configuration for that remote device.

How you assign devices static addresses in your magical network, I have no idea.

Gotcha. May I use the udp:// prefix?

Syncthing does not use/support udp

Thank you. Adding in the static addresses manually seems to have solved my intermittent connectivity issues. All devices show as solidly connected now.

As a network guy, I’ve experience with both ZeroTier and Syncthing, altough I haven’t really used them together so far.

First, I need to clarify a few things: ZeroTier is a full virtual network (similar to a VPN) which DOES support multicasts & broadcast (pure Ethernet & IPv4 & IPv6 & everything else).

BUT: Multicasts and broadcasts on Windows are horribly broken and only use the interface with the lowest metric available (e.g your physical network cable). On Linux, things should work fine, but since you’re describing issues I presume you’re using Windows on at least one machine?

Setting static addresses is fine, since ZeroTier does not have any dynamic stuff like DHCP built-in (yet) and all addresses are static by default. But in case you do want to get multicasts/broadcasts working on Windows, I’ve contributed to ZeroTier’s wiki with possible workarounds. Again, note that this is purely an issue with Windows being a broken operating system and is not caused by either ZeroTier or syncthing.

I was hoping someone with greater knowledge in this domain would step in. Thank you!

Unfortunately, the answer isn’t so easy as all my devices are running Linux (laptop runs NixOS, server runs Synology’s DSM), Android (one phone on Pie, one tablet running FireOS 5) or iOS (one iPhone SE). The iOS device I just switched over and haven’t tested so all devices I have had issues with are running a Linux kernel.

Barring specific weirdness, the usual issue preventing local discovery is the default local firewall.

Okay that’s unusual. I automatically assumed Windows because “broadcast not working when using multiple interfaces” is like one of my top 10 network issues on Windows.

In general, the network implementation on *Nix systems is more sane and handles multiple interfaces more cleanly compared to Windows, so in theory it should work.

As for your issue: You can just set up static addresses for all devices and forget about it. That’s an absolutely acceptable solution, since ZeroTier networks in general maintain their assigned IP addresses. Only if you plan to add/remove devices often, or have a dynamic ZeroTier-enviroment you should prefer an automatic configuration.

If you still want to debug this further, I have a few ideas:

  1. I assume you run your own ZeroTier network and have access to the network controller (for most people this is the web gui)? If so, re-check your configuration - are broadcasts enabled on the controller, any custom rules on the controller?

  2. As calmh said: Any local firewalls?

  3. What’s the listen address for your syncthing instances? Have you tried binding them to your ZeroTier addresses (set listen addresses to the ZT-IP’s)?

  4. You could check - for example using WireShark - if your machines are actually sending the local discovery packets on (any) interface. You’re searching for UDP packets send to IP 255.255.255.255 (global broadcast) port 21027 (ignore IPv6 for the moment). The broadcast address could differ depending on your listen address configuration, I haven’t checked this. Those packets should be send over a tunX (e.g tun0) interface, which belongs to ZeroTier. In case they’re being sent over a different interface, it’s likely a misconfiguration. If they’re not being send at all, it’s likely a firewall issue. If they’re being send correctly, it might be an issue with the receiving side.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.