Syncthing: Sync Protocol Listen Addresses don't work
Closed this issue · 4 comments
Which addon?
syncthing
Describe the bug / To Reproduce
Under "Actions"->"Settings" -> "Connections", it is possible to set the Sync Protocol Listen Addresses. When setting this input to tcp://192.168.178.21:22000
or rather tcp4://192.168.178.21:22000
, i get the following error message (after clicking on "Listeners 0/1"):
Listener Failures
Syncthing is not listening for connection attempts from other devices on any address. Only outgoing connections from this device may work.
Some listening addresses could not be enabled to accept connections:
tcp://192.168.178.21:22000: listen tcp 192.168.178.21:22000: bind: cannot assign requested address
The log output is as followed:
2023-04-22 23:49:25 Listen (BEP/tcp): listen tcp 192.168.178.21:22000: bind: cannot assign requested address
I also found out that setting it to the local loopback device tcp://127.0.0.1:22000
works fine, but the other devices are not able to connect to it:
dial tcp 192.168.178.21:22000:
connectex: Es konnte
keine Verbindung
hergestellt werden, da
der Zielcomputer die
Verbindung verweigerte
(says that 192.168.178.21:22000
refused the connection)
Is there any mapping of ip-addresses necessary, because the docker container does not know it's host ip? Or am I missing something crucial here?
EDIT:
When setting it to tcp://0.0.0.0:22000
the connection was possible. I don't quite understand how this is possible... Also from the logs i could see that it connecting to the containers ip 172.30.33.5
. So i tried to set tcp://172.30.33.5:22000
(should be a private ip and therefore the one of docker??) and it worked as well.
I don't like this so i would be happy if there is a solution to use the real ip address of my home assistant.
Expected behavior
The device should be able to listen to it's own ip address.
Screenshots
System
- Supervisor version: 2023.04.0
- Host system version: 10.0
Thank you very much for your support :)
If the address is empty it will accept all connections inside the docker container. So it will accept also the request which are mapped through Home Assistant OS.
The IP from which those routed requests are coming is the 172.30.32.2
. (as far as I know)
The syncthing executable should be discoverable without any additional configuration in the gui.
Thank you for your quick response 😊
Well in case you are wondering why i'm trying to configure this: My goal is to use Syncthing completely local in my home network. So I do not want Syncthing to use external connections to a relay for example or even be discoverable externally. I know everything is encrypted in syncthing, but it gives me a better feeling, knowing no data leaves my local home network.
- Setting "Sync Protocol Listen Addresses" empty, leads to the problem that the devices can't establish a connection - i/o timeout. It show the warning:
Listener Status: Syncthing is not listening for connection attempts from other devices on any address. Only outgoing connections from this device may work.
- Can I set it to 172.30.33.5 permanently? At the moment this works fine, but will restarts influence this ip? I have no clue how the ip setup in the syncthing docker container works, could you please give me a short insight?
- 172.30.33.5 is a internal ip address only visible in my local network. Am i right?
- Yes, without additional configuration in the gui it was also working, because the Default listen addresses (default) are containing
tcp://0.0.0.0:22000
.
EDIT:
The following tcp://172.30.33.5:22000
works, like described in my previous edit of the initial post. However setting it to tcp://172.30.32.2:22000
did not.
To your questions:
- All settings you making are persistent between restarts of the addon. Only re-installing will delete them.
- The 172.* ips are internal IPs of the internal Home Assistant OS system. They are not available from outside your HA host.
From my understanding of the syncthing settings (and my access logs from): To reach an local only instance it is enough to disable the global device search and NAT traversal features. Without NAT on your router it won't be able to get accessed from outside your network.