How to make Syncthing use the SSH forwarding for data transit?


(5wl4omaa9k) #1

I have:

  • home computer (public IP 123.123.123.123), Syncthing running, http://127.0.0.1:8384 works.

  • distant container/server (IP 10.10.10.10) that I connect via SSH on port 1234 from home computer with:

    ssh -p 1234 root@10.10.10.10 -L 8385:localhost:8384
    

    Then http://127.0.0.1:8385 works well: it opens the server’s Syncthing configuration page.

Problem: in the right bottom Remote Devices list, I see the connection is done via a relay. It is thus very slow (less than 100 KB / sec).

Question: how to configure the device so that it uses the SSH forwarding tunnel?

I tried, on my home computer’s Syncthing, to configure the “distant server Device” with Edit Device > Advanced > Addresses, and add this in it:

tcp://127.0.0.1:8385

I hoped that my home computer would try to reach the distant server with 127.0.0.1:8385 being tunnelled to 10.10.10.10:8384 via SSH, but it does not work: it still uses the relay instead.

Note: It’s close to issue with ssh forwarding but not exactly the same, the latter didn’t help.


(Jakob Borg) #2

There is a difference between the GUI port (8384) and the sync port (22000). To get Syncthing to talk to another Syncthing you need to forward the sync port and point it at the forwarded sync port.

So pretty much what you’re doing, but port 22000.


(5wl4omaa9k) #3

Thank you very much. As I still need to forward 8384 (to be able to see the distant server’s Syncthing config in my local browser) to 8385, should I redirect both like this:

ssh -p 1234 root@10.10.10.10 -L 8385:localhost:8384 -L 22001:localhost:22000

and include this in local’s Edit Device > Advanced > Addresses:

tcp://127.0.0.1:22001

?


(Jakob Borg) #4

Looks reasonable