Warn nodes syncing from the same public IP address

I was taking a look at the network activity of my Syncthing relay and saw the following :

image

The two nodes are syncing using the same public IPv4 address. Maybe they can’t see each other on the LAN because they are not on the same subnet (one VLAN each).

I think these two nodes should be warned (on the Web GUI) that they are syncing their data using a public Syncthing relay server on the internet, and should better sync locally.

I’m not sure whether a better solution might be to have the Syncthing relay communicate each node’s private IP address to them so that they can communicate locally.

1 Like

Could they be on different internal networks entirely that happen to be using the same internal network scheme? That seems most likely.

Of course they might have similar internal IP address ranges if NAT is involved. But this request was about the public addresses being the same, as seen from the relay.

I don’t think it’s sensible to let the relay servers exchange address information between clients. That’s what we have global discovery for, and it already communicates all the necessary facts. Both public and private IP addresses are announced there, so the clients will try to get a direct connection through those already.

1 Like

Thanks for the correction. I should have caught that.

Outch !

Even if the VLANs are isolated from one another, an internal relay would be a better solution than letting this job to random relays on the internet.

Another thought about public relays :

My relay in Europe was relaying data for nodes located in South America event if other relays are closer in this region. I suppose there is no rule for a node to select the closest relay in the public list ? GeoIP (country) and/or latency checks could optimize the relay pick and have a better impact on the Internet network load.

I’m not sure what you’re trying to discuss here, but you already know that a VLAN makes a totally separate network, so even if the nodes know each other’s LAN address, they cannot communicate.

And as you figured out, a local relay is what can help you in this case.

As for the relay’s selection algorithm, I don’t have information about it, but my guess is that the nodes do some sort of latency check before picking up one. This is based on the anecdotal observation that nodes do select the fastest route when they are connected via multiple direct paths.

1 Like

[…] but you already know that a VLAN makes a totally separate network, so even if the nodes know each other’s LAN address, they cannot communicate.

Devices on different VLAN can communicate when Inter-VLAN routing is configured on a L3-switch or a router.

I don’t know if Synthing (discovery or relay server) can tell nodes using the same public IP address to try to communicate using their private IP addresses.

Thanks for the new info. I wasn’t aware of this ability.

My guess is that it does, because my nodes some times communicate over VPN. They wouldn’t have known each-other’s VPN address (which is in a private range) unless the relay has snitched.