Syncthing on a server

Hi everyone, I recently started using Syncthing and I’m really liking it so far. I also installed it on my server, but it seems data to and from the server go through a relay (which limits the speed). However, this server has it’s own public IP address and domain name, so AFAIK it can have a direct connection with my devices that are part of a LAN.

How can I make this faster?

The server finds my devices dynamically, but the devices all have the domain name specified of the server, no dynamic addresses. Any help appreciated!

This is not required for a direct connection. Direct connection means that there are no firewalls or NATs in between that block the traffic.

Did you read the Firewall Setup documentation?

2 Likes

Perhaps “direct connection” was badly chosen, since there is one NAT in between:

Desktop --+
          |
Laptop ---+---[Router, NAT obviously]----  Internet  ---[My Server]
          |
Phone ----+

There is no firewall active on my server. I just don’t see how a relay is necessary, I could even configure my own server to be a relay.

Check if you have any egress filtering on your router.

tenorio

Is there a way to check without going into the settings? I don’t have admin access on the router. Also, why would the router make a difference between sending data to a relay and sending data to my server? The relay works fine, it’s just that it could go faster without it.

Because relay will connect on port 443, syncthing listen on port 22000 by default, if not possible to check your router you can try a ssh tunnel or try another port on syncthing on your server.

tenorio

PS: using ports < 1024 requires root privileges, which is not recomended

Oh well, while configuring the port I noticed that I had given my devices the wrong server address. It’s nice that Syncthing falls back to the relay, but it would also be nice to have some kind of an error if Syncthing can’t reach a device at the specified address.

Sorry to bother you all, works perfectly :slight_smile:

Actually, the relay port is probably unrelated, as this is only relevant if the outgoing traffic is filtered. Also, the default relay port is 22067, not 443.

The difference between a direct and a relayed connection is that for a direct connection, one side must be configured to allow incoming connections at the listen port. When a relay is used, both side use an outgoing connection. This works, because (local) firewalls are usually configured to allow all outgoing traffic, but drop incoming. For an outgoing connection, you also don’t need a port forward when NAT is used.

Direct connection:

Device A ------> Device B

Relayed connection:

Device A ------> Relay <------ Device B
1 Like

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