Problem with private Relay

Hey,

first of all, I want to say that I am completely inexperienced when it comes to Syncthing and therefore hope that you won’t be too hard on me. The following problem presents itself to me:

I have two networks, let’s call them Network A and Network B, and there are two Syncthing clients as well as one Syncthing relay server. Client A is located in Network A and Client B in Network B, while the relay server is located in Network B. Now, I would like to synchronize Client A and B through the relay server. Both clients seem to successfully join the relay server, but the two clients still cannot find each other. If I connect both clients without the relay server and specify the destination IP in the form tcp://ip-address:22000 for both clients, it works. Both clients and the relay server are also reachable via ping.

It is worth noting that this is a pure test lab without an internet connection, and even if the setup may seem pointless, I would like to understand why it does not work or how it could work.

On both clients, the relay was entered under Sync Protocol Listen Addresses in the following form: relay://ip-relay:22067/?id=RELAY-ID

My Relay-Server Config:

[Unit] Description=Syncthing Relay Daemon After=syslog.target network.target remote-fs.target nss-lookup.target

[Service] Type=simple ExecStart=‘/usr/local/bin/strelaysrv’ -keys=‘/etc/strelaysrv’ -pools=‘’ User=strelaysrv

[Install] WantedBy=multi-user.target

Some logs:

In addition, I would like to add that the ports 8384/tcp 22000/tcp 22000/udp 21027/udp 22067/tcp 22070/tcp have been opened on both clients as well as on the relay server to exclude any issues with the firewall. At times, the firewall was temporarily disabled on all three devices, but the problem still persisted.

This may be a discovery issue.

For syncthing to connect to a given device via a relay, it must know on which relay the given device is available on. Connecting two devices to the same relay doesn’t fix this: The relay server isn’t chatty by itself and won’t tell you about other connected peers.

Syncthing usually resolves this via discovery: Each device publishes the relay(s) it is available on to discovery. Then other devices retrieve this information from discovery and connect to them - via any of the available methods, which may include relays.

Since you are apparently running offline, global discovery likely does not work. You can manually override discovery by setting the relay address in the remote device’s addresses field (not only the local devices listen address).

Otherwise, self hosting global discovery and pointing your instance to that should work as well, enabling the “dynamic” remote addresses to work.

3 Likes

Yes, that has solved the problem, now everything is synchronizing too! Thank you very much for the quick help!

2 Likes

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