Inconsistent LAN/relay for one connection on network

I have three devices on one network: Android, macOS and Fedora. uPnP is enabled on the router.

On macOS, syncthing can connect directly to both the Android and Fedora devices: the web console shows TCP LAN, and transfers are fast for macOS-Fedora and macOS-Android.

However, the Android and Fedora devices do not connect directly to each other. Transfers are always slow. The connection type is sometimes Relay LAN, and sometimes TCP WAN.

What might I do to improve the Android-Fedora behavior? I would think that the capacity for a fast, direct connection would be transitive among devices.

I have tried uninstalling/reinstalling and adding/removing devices on both the Android and Fedora. All are running syncthing 1.28.

This sounds like a network problem rather than a Syncthing problem — something is preventing your Android device from connecting regularly to the Fedora device directly. Are you using a VPN on either the Android or Fedora device? Are they on the same network?

So all three are connected to the same Wi-Fi network?

Between macOS, Android, and Fedora – unless the default policy has changed in macOS – Fedora is the only one of the three that ships with a firewall enabled.

There are various solutions available, but one simple option is to tell Fedora you want to make Syncthing visible on the network.

Fortunately, Fedora’s firewalld management tool ships with a large set of profiles for commonly used network services that includes Syncthing.

List the available service profiles:

firewall-cmd --get-services

Enable the Syncthing profile so that it persists between system restarts:

firewall-cmd --permanent --add-service=syncthing

Replace the current active in-memory configuration with the new one:

firewall-cmd --reload

Display the current in-memory configuration:

firewall-cmd --list-all

To establish a connection between peers without a relay, Syncthing needs one side to be reachable on network port 22000 (the default). See Syncthing’s Firewall Setup page for more details.

So macOS ↔ Android and macOS ↔ Fedora end up using the faster direct TCP LAN connection because Android and Fedora can reach Syncthing on macOS. But on Fedora – with its firewall enabled – Android cannot initiate a direct connection. And depending on the version of Android, it might not “hear” Syncthing on Fedora announcing it’s available (aka. “local discovery”).

2 Likes

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